Spec-driven development, for real
Spec-driven development, for realPart 2
The paper trail
On this page
New to the short codes like REQ, ADR or AC? See the vocabulary in Part 1, or hover over any code.
In short: Three documents hold the what, the why and the how: the product requirements (REQ-###), the plan with its decisions and open questions (DEC-###, OQ-##), and the architecture with its numbered principles (P1 to P12). Every ID is permanent, and it is cited where it matters: on the line of code, in the test name, the commit, the pull request and the coverage matrix. Follow any ID and you find every reason, test and change behind it.
Part 1 showed the whole map. This is block 1, the one everything else cites. The team and product are invented.
Monday, 9:40
Maya opens her ticket, ACME-41: charge a fee when a rental comes back late. Her old team would have started coding. Here, the ticket is one line, and the first instruction in CLAUDE.md says: read the requirement before you write anything.
She asks Claude where the late-fee requirement lives. It searches docs/prd/ and comes back with REQ-041, and a decision beside it, DEC-018.
Think of it like this: A library does not find books by memory. Every book has a catalogue number, and every list, loan and shelf uses that number. Move the book, rename the shelf, change the librarian: the number still finds it.
Three documents, three kinds of ID
docs/prd/, the what. What a user can do or must see. One requirement, one ID. A requirement that cannot be tested is not finished.docs/plan/, the why. Scope, order, and two kinds of entry: decisions (DEC-###) quoting whoever made them, and open questions (OQ-##) that someone outside engineering must answer.docs/architecture/, the how. The numbered principles, the system’s shape in sections (§4), and the folder of decision records (Part 4).
Here is what Maya found:
### REQ-041 Late returns are charged a fee A rental returned after its due time is charged a late fee, shown to the customer before they pay. - Source: product review, 2026-03-02 - Priority: must ### DEC-018 Late fees are per started hour, capped at one day - Decided by: head of operations, 2026-03-04 - Words given: "Per started hour, never more than a full day." - Affects: REQ-041
Remember: a decision quotes the words given. “Per started hour, never more than a full day” is unambiguous. A paraphrase like “hourly, capped” is how two developers end up rounding differently.
One ID, cited everywhere
An ID is only useful if it is used. In this setup, the same REQ-041 appears in eight places by the end of the week:
# REQ-041 AC-3: never more than one day (DEC-018) on the line that does it, not at the top of the file.
The test name carries the ID: test_req041_ac3_fee_capped_at_day_rate. A failure points at the promise it broke.
ACME-41: REQ-041 AC-2 per started hour. The ticket for people, the REQ for the record.
The evidence table lists each AC with its proof. Reviewers check rows, not vibes.
Every REQ and AC mapped to the test that proves it, with an honest state.
One plain line per pull request, for readers outside the team.
Following a line back
Six weeks later, someone asks why the fee never goes above the day rate. Nobody who built it is around. The trail answers:
That is the whole point of block 1. Every other block depends on it: the spec cites REQ and DEC IDs (Part 6), tests are named after them (Part 11), and the coverage matrix maps each one to its proof.
Under the hood: rules that keep the trail honest
- IDs are permanent. Withdraw a requirement by marking it
Withdrawn, never by deleting or reusing the number. A reused ID silently changes the meaning of every citation. - The repository must be enough on its own. If the plan lives in a shared drive, restate anything the code depends on inside the repo, with its ID. A teammate cloning from GitHub, or a fresh Claude session, cannot open your drive.
- When documents disagree, the newest dated section wins. Name the file and date you took an answer from. In the real repositories this came from, a session once answered a status question from a stale section; a later-dated file held the current answer.
- Claude can grep for IDs. “Find everything citing REQ-041” is one search. That is cheaper and more reliable than asking Claude to remember what it built last week.
When an ID earns its place
- Someone will ask "why does it do that?"
- A test, a review or a decision will point at it.
- It came from outside engineering: a client, a manager, finance.
- It is an implementation detail inside one function.
- It will not outlive this pull request.
- It already has an ID elsewhere. Cite that one.
Which ID fits?
- A user should be able to do something new: REQ-###Add it to docs/prd/ in plain words. Acceptance criteria come later, in the spec.
- Someone outside engineering made a choice: DEC-###Quote their words in docs/plan/, with who and when.
- Nobody here can answer it: OQ-##Record it as an open question (Part 5). Never guess.
- A technical choice binds the code: ADR-####A decision record in docs/architecture/decisions/ (Part 4).
- Two documents disagree: The newest dated sectionPrefer the newest date, name the file you took it from, and fix or mark the older one.
In the kit
The templates for these documents, with the formats above: docs/prd/README.md, docs/plan/README.md and the docs map. kit-init copies them into your repository.
Three rules of thumb
Retire an ID by marking it Withdrawn. Never reuse the number for something else.
The ID goes on the line, test or commit that depends on it, not in a list somewhere else.
Never cite a file only some people can open. Restate what matters inside the repository.
QuizA requirement is dropped from the product. What happens to REQ-017?
Show the answer
Answer: Mark it Withdrawn and never reuse the number
Old commits, tests and reviews still cite REQ-017. If the number now means something else, every one of those citations quietly lies.
Words in this post:
- PRD: the product requirements document. The what.
- REQ-###: one requirement’s permanent ID.
- DEC-###: a decision made outside engineering, quoted in the plan.
- OQ-##: an open question someone outside engineering must answer.
- Cite: write the ID where something depends on it.
Next, Part 3: Principles and scoped rules turns the how into numbered rules Claude reads before every edit.
Setting up Claude Code or AI agents for your team?
I help teams build this: agents, RAG search and Claude Code setups that hold up in production.
Series
Spec-driven development, for real
- Spec-driven development, for realThe building blocks
- Spec-driven development, for realThe paper trailyou are here
- Spec-driven development, for realPrinciples and scoped rules
- Spec-driven development, for realDecision records
- Spec-driven development, for realDefinitions and open questions
- Spec-driven development, for realFeature specs and plans
- Spec-driven development, for realThe contract
- Spec-driven development, for realGates that make Claude show its work
- Spec-driven development, for realSkills and reviewers
- Spec-driven development, for realGuardrail hooks
- Spec-driven development, for realProof of done
- Spec-driven development, for realMemory and handoffs
- Spec-driven development, for realOne ticket, end to end