The commit that moved this post to its current URL also added .claude/specs/improve-blogs.md. It's a spec for six interactive blog components: Tabs, Collapsible, InteractiveChart, MermaidDiagram, CopyableCommand and FileTree. The same commit added all six, and four of them are on this page. The spec follows the template from /spec-create, the first command in this post. The commands had landed in the repo earlier that same evening, in the same commit as the first draft of this post.

The spec also still lists four open questions at the bottom, with no answers written under them. The code answered them; the file never caught up. Keep that in mind while I tell you how disciplined the pipeline is.

The idea is old. Specification-driven development means deciding what you want before you write how. Applying it to coding agents is newer, and not everyone is sold. Birgitta Böckeler looked at Kiro, spec-kit and Tessl for martinfowler.com and came back skeptical: spec-kit's steps and markdown files felt like "overkill for the size of the problem," and she'd "rather review code than all these markdown files." I think she's right about the cost. Most of the rules in my commands exist to keep that cost small.

The mechanism is plain. Instead of typing the same instructions every session ("explore my codebase first", "follow existing patterns", "put the tests in the same phase as the code"), you write them once as slash commands. Markdown files. No SDK, no API, no plugin.

Why raw prompts fail at scale

When you type "add JWT auth to my API", you're asking the model to make dozens of implicit decisions:

  • Which JWT library?
  • Where do tokens get stored?
  • How does it integrate with your existing middleware?
  • What's your error handling pattern?

The model will guess. Sometimes it guesses right. Often it doesn't. And you spend more time debugging AI guesses than you would have spent writing the code yourself.

I don't have a clean before/after number for this. An earlier version of this post had a rework chart; I took it out because nothing had measured it. The closest evidence I have came later: when I ran /insights over a month of Claude Code sessions on a side project, features that started from a written spec ended cleaner than the ones I improvised in chat. That month is its own post.

The pipeline

Five commands, each a single markdown file. My README calls it a six-step flow, because step two isn't a command at all: it's me answering the open questions the first command found. Every step produces something you can read, and every transition waits for your approval:

  1. 1 /spec-create: a rough idea becomes a structured spec, including the open questions only you can answer.
  2. 2 /spec-audit: the model explores the real codebase and enriches the spec with its conventions.
  3. 3 /spec-review: a readiness traffic light. Ready, proceed with assumptions, or blocking.
  4. 4 /spec-plan: three or four small phases, each independently verifiable.
  5. 5 /spec-implement: one phase at a time; your approval gates every transition.

Command 1: create. From idea to structured spec

You give it a name and a rough description. The command writes a structured spec to .claude/specs/<name>.md with context, expected behavior, edge cases, what it must not do, constraints, acceptance criteria and, at the end, the open questions it detected that you need to answer.

Here's the real file, trimmed and translated (I wrote the originals in Spanish):

.claude/commands/spec-create.md
---
description: Create an initial spec in .claude/specs/ from a short prompt
argument-hint: <feature-name> <short description>
allowed-tools: Read, Write, Bash(mkdir:*)
---

# Create Initial Spec

I want to create a spec for the feature: **$ARGUMENTS**

## Your task

1. Create `.claude/specs/` if it doesn't exist
2. Turn my input into a structured spec
3. Save it to `.claude/specs/<feature-name>.md`

<!-- spec template trimmed: context, what I want, expected
     behavior, edge cases, what it must NOT do, constraints,
     acceptance criteria, open questions -->

4. When done, tell me the file you created and which
   open questions I should answer before the next step

**Don't explore the code yet. Only create the spec from what I gave you.**

The frontmatter does real work. argument-hint shows up in autocomplete. allowed-tools lists the tools Claude can use in that turn without asking me, so creating the folder and writing the file doesn't stop for permission.

Instead of guessing your JWT library preference, it asks you.

Command 2: audit. The spec meets your codebase

This is where the model explores your actual project (file structure, naming conventions, error handling, existing dependencies) and appends a technical analysis to the spec: files to touch, files to create, patterns to respect, risks, and the questions you still have to answer.

What the audit explores
  • Project structure (folders, modules, layers)
  • Architecture patterns (MVC, service layer, feature-based)
  • File and function naming conventions
  • Current error handling approach
  • Test organization
  • Dependencies in package.json / requirements.txt
  • Similar files to what you're building (to follow the same pattern)

The audit runs with context: fork and agent: Explore, so the exploration happens in a separate sub-agent and only its findings come back to the main session. That's the context-isolation trick the context engineering module recommends for read-only work: let a clean window read tens of thousands of tokens, keep only the summary.

This step is aimed at one specific failure in AI-generated code: ignoring the patterns the project already has. After the audit, the model knows your conventions, and the code it writes later fits them.

Command 3: review. The readiness traffic light

Before investing time in implementation, this command evaluates the spec. The emoji come straight from the command file:

🟢 Ready: well-defined. All decisions made. Proceed to planning.

🟡 Can proceed: ambiguity exists, but reasonable assumptions can be made. Each assumption is listed explicitly for you to approve or override.

🔴 Blocking: critical decisions remain. Examples: "Sessions or JWT?", "Which database?", "Does this need real-time?" Fix these before proceeding.

It ends by asking whether you want to adjust anything, and the file says to do nothing else until you answer. If something is red, you fix it now, not after three phases of implementation.

Command 4: plan. Phased implementation

The plan command reads the audited spec and generates a phased plan. Each phase is small, verifiable (clear "done" criteria), and reviewable before the next one starts. Tests go in the same phase as the code. This sample is a composite of the format, not output from one run:

Example plan output
### Phase 1: Database schema and migration
**Objective:** Users table exists with auth fields
**Files:** create migration, modify schema
**Tests:** migration up/down
**Verify:** migration runs without errors

### Phase 2: Auth middleware and utilities
**Objective:** Protected routes return 401 without auth
**Files:** create middleware, create utils, modify app entry
**Tests:** middleware unit tests
**Verify:** curl unprotected → 200, protected → 401

Claude Code's built-in plan mode overlaps with this step, and my plan has the same limit: it lives in the chat. /spec-implement reads "the plan we agreed on" from the conversation. The part that survives the session is the spec file, which is committed next to the code.

Command 5: implement. One phase at a time

The implementation command takes the feature name and a phase number (/spec-implement auth-jwt 2) and executes only that phase. If it hits something that changes the plan, it has to stop and tell me before improvising. After each phase it runs the relevant tests, summarizes the files it touched and the decisions it made, and asks for a green light.

That's what separates it from "generate everything at once". If Phase 1 reveals a problem, you adjust the plan before Phase 2 starts. There's math behind why this works: per-step errors multiply, and a verification gate in the middle of a chain turns one long, fragile run into shorter ones that each reset the error.

The gate only helps if you actually read what's behind it. Approving phase summaries without looking is the rubber-stamping problem the human-in-the-loop module warns about.

Bonus: review commands

Two more commands sit outside the pipeline, for code quality on demand:

CommandWhat it checksOutput
Performance reviewO(n²) loops, N+1 queries, memory leaks, caching, bundle sizesSeverity-ranked findings with fixes
Architecture reviewSOLID principles, coupling, separation of concerns, securityLayer diagram + refactoring roadmap

Set it up

$ mkdir -p .claude/commands

Drop the command files in .claude/commands/. Each file name becomes a command My own README still says /project:spec-create. That prefix is from an older Claude Code; today the command is just /spec-create. : spec-create.md is /spec-create. The specs they generate land in .claude/specs/:

.claude
commands
spec-create.md
spec-audit.md
spec-review.md
spec-plan.md
spec-implement.md
performance.md
architecture.md
specs
improve-blogs.md
gsap-ux-improvement.md

Claude Code has merged custom commands into skills. A file at .claude/commands/spec-create.md and a skill at .claude/skills/spec-create/SKILL.md both create /spec-create, and the old command files keep working. The docs say to prefer a skill for new work because a skill can carry supporting files. A skill can also be loaded by Claude on its own when it looks relevant.

That second part is the one to switch off for this pipeline. Add disable-model-invocation: true to the frontmatter of spec-implement, at least (command files accept the same field), so the only way a phase starts is you typing the command.

The golden rule

My README closes the spec workflow with a "golden rule" (translated from my Spanish), and I'll keep it:

Never skip steps under pressure. The time you "save" by skipping the audit or the review, you pay triple in corrections later.

I still don't have a clean answer to Böckeler's question about what problem size this is for. What I have is a cap in spec-plan.md, a GSAP spec in my own repo that blows past it, and a spec for this page's components whose open questions are still sitting there unanswered. A spec is worth reviewing only while it stays small enough that you actually review it.


Further reading: