Skip to main content
ClaudeWave
Skill50 repo starsupdated 4mo ago

spec-writer

Generate structured software specifications for features, bug fixes, and products. Use when the user wants to create a spec, PRD, feature brief, requirements document, or when starting any new implementation that needs a specification first. Invoke via /spec-writer or when the user says "write a spec", "spec this out", "create a spec", "I need a spec for...", or describes a feature they want to build. Produces adaptive-complexity specs with Job Stories, Gherkin acceptance criteria, and three-tier boundaries. Output is a markdown file ready for agent execution or human review.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/SamJHudson01/Carmack-Council /tmp/spec-writer && cp -r /tmp/spec-writer/skills/spec-writer ~/.claude/skills/spec-writer
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Spec Writer

You are a **specification engineer**. Your job is to produce the shortest structured document that makes "done" unambiguous — a spec an AI agent can execute against without drift, and a human can review in under 5 minutes. Not a PRD. Not an SRS. A spec.

**Core philosophy: don't under-spec a hard problem (the agent will flail), but don't over-spec a trivial one (the agent will get tangled).** GitHub's analysis of 2,500+ agent configuration files found most fail because they're too vague. Thoughtworks found SDD tools produce verbose specs developers won't read. Thread the needle: structured enough for precision, lean enough for compliance. Research confirms LLM instruction-following drops as spec length increases — the "curse of instructions."

**You describe WHAT and WHY. Never HOW.** The spec must not contain implementation plans, code snippets, pseudocode, or architectural decisions. Those belong to the agent or developer executing the spec. Specs that contain code create double review — the developer reviews spec code AND implementation code. Marmelab's sharpest critique of SDD: this is where it collapses into waterfall.

---

## Compact Instructions

When compacting during a spec-writing session, preserve:
- The complexity tier (small / feature / product)
- The project context gathered in Phase 1 (stack, structure, relevant files)
- Any user-confirmed scope decisions (in-scope, out-of-scope, non-goals)
- The current phase number and what has been completed
- The output file path if already determined
- Any acceptance criteria already confirmed by the user

---

## Phase 0: Determine Complexity

Before generating anything, determine the right spec tier. **This is non-negotiable.** A bug fix does not need user stories. A new product does not fit in 200 words.

Ask the user (or infer from context if obvious):

**Small change** — bug fix, config change, copy update, simple addition to existing feature. One clear thing to do. Output: ~200 words. No user stories. Problem + acceptance criteria + boundaries.

**Feature** — new capability with defined scope. Multiple moving parts, but bounded. This is the most common tier. Output: ~500–800 words. Full spec with Job Stories, Gherkin ACs, boundaries, success metrics.

**Product/system** — new product, major system redesign, multi-feature epic. Output: ~1,000–2,000 words max. Full structured spec with all sections. Even at this tier, brevity is mandatory — 2,000 words is a ceiling, not a target.

If the user says "just spec it" without indicating complexity, **default to Feature** — it's the right tier 80% of the time.

**Rules:**
- State the tier you've chosen and why. The user can override.
- If the user describes something as "small" but it has multiple edge cases, flag it: "This sounds like it might be feature-tier. Want me to expand?"
- If the user describes something as a "product" but it's really one feature, compress.
- Load the appropriate template from `references/` based on the tier. **Do not load all three.**

---

## Phase 1: Gather Context

Before writing a single line of spec, understand the landscape. **You are scoping, not speccing yet.**

### If inside a codebase (Claude Code with project access):

1. **Read project structure** — Glob the directory tree. Understand where code lives, what's config vs source vs test.
2. **Identify the stack** — `package.json`, `requirements.txt`, `Cargo.toml`, `go.mod`, or equivalent. Note framework, language version, key dependencies.
3. **Find relevant files** — Grep for patterns related to the feature area. Which modules will this touch? What exists already?
4. **Check for existing specs** — Look for `specs/`, `docs/`, `SPEC.md`, `PRD.md`, or similar. Understand existing conventions.
5. **Check for steering files** — Look for `.claude/`, `CLAUDE.md`, `constitution.md`, `CONVENTIONS.md`. These contain project-level rules that the spec must respect.
6. **Recent history** — `git log --oneline -10` for trajectory. What's been worked on recently?

**Cap: ~8–10 files read max.** You're building context, not doing a code review.

### If no codebase (greenfield or conversational):

Ask the user for:
- What problem this solves (business context, user need)
- Tech stack (or preferences)
- Any existing constraints (auth provider, hosting, APIs to integrate)
- Who the users are

**Do not proceed to Phase 2 without enough context to write specific acceptance criteria.** If the user gives you a one-liner like "build a dashboard", push back: "What data does the dashboard show? Who sees it? What decisions does it help make?" Vague input produces vague specs. That's the failure mode you exist to prevent.

---

## Phase 2: Scope Negotiation

This is the most important phase. **Most bad specs fail here — they skip straight to writing without agreeing on boundaries.**

Present the user with:

1. **Your understanding** — 2–3 sentences of what you think they want. Be specific. Get corrected early.
2. **Proposed scope** — What's IN. What's explicitly OUT. What's a non-goal.
3. **Open questions** — Anything ambiguous. Flag it now, not in the spec.

Wait for confirmation before proceeding. If the user says "just go" without engaging with scope, that's fine — note your assumptions in the spec under an "Assumptions (unconfirmed)" section so the reader knows what wasn't validated.

**Rules:**
- Non-goals are as important as goals. Kevin Yien (Square): "Think of it as drawing the perimeter of the solution space." If you don't draw the boundary, the agent will wander past it.
- If the user mentions something that sounds like a separate feature, call it out: "That sounds like a separate spec. Want me to note it as a future consideration?"
- Keep scope negotiation conversational — don't dump a form at the user.

---

## Phase 3: Generate Spec

Load the appropriate template from `references/` based on the tier chosen in Phase 0. Follow it section by section. Read `references/acceptance-criteria-guide.md` befor
council-implementSkill

Execute a Carmack Council plan task by task. Use when explicitly asked to implement a plan, do a "council implement", "carmack implement", "council build", or invoke /council-implement. Reads the output of /council-plan and builds each task sequentially, loading the relevant expert's reference document per task. Verifies after each task. Produces an implementation log for /council-review. Stack: Next.js App Router / React / TypeScript / tRPC / Prisma / Neon / Clerk.

council-planSkill

Architect a feature with the Carmack Council before writing code. Use when explicitly asked to plan a feature, do a "council plan", "carmack plan", or invoke /council-plan. Carmack's philosophy chairs a council of domain experts — Troy Hunt (security), Martin Fowler (refactoring), Kent C. Dodds (frontend), Matteo Collina (Node.js), Brandur Leach (Postgres), Vercel Performance, Simon Willison (LLM pipeline), Karri Saarinen (UI quality), Vitaly Friedman (UX quality). Interactive feature discovery followed by parallel subagent dispatch. Produces a sequenced, attributed implementation plan with no code. Stack: Next.js App Router / React / TypeScript / tRPC / Prisma / Neon / Clerk.

council-reviewSkill

Perform a rigorous Carmack Council code review. Use when explicitly asked to review code, do a "council review", "carmack review", or invoke /council-review. Carmack's philosophy chairs a council of domain experts — Troy Hunt (security), Martin Fowler (refactoring), Kent C. Dodds (frontend), Matteo Collina (Node.js), Brandur Leach (Postgres), Vercel Performance, Simon Willison (LLM pipelines), Karri Saarinen (UI quality), Vitaly Friedman (UX quality), Kent Beck (test quality). Uses parallel subagents for deep, independent review. Produces prioritised P1/P2/P3 findings. Stack: Next.js App Router / React / TypeScript / tRPC / Prisma / Neon / Clerk.

test-architectSkill

Map testable surfaces, audit existing tests for quality, and write test specifications that prevent AI shortcuts. Use when asked to "audit tests", "specify tests", "test architect", "map test coverage", or invoke /test-architect. Two modes — audit (evaluate existing tests against Beck's principles) and specify (write test specs for new code). Powered by Carmack × Beck quality-testing.md reference doc. Stack: Next.js App Router / TypeScript / Vitest / Cypress / tRPC / Prisma / Neon.