Skip to content
zeeshare.com

writing / FDE and agents

Spec-driven development, for real

Spec-driven development, for realPart 2

The paper trail

On this page
  1. Monday, 9:40
  2. Three documents, three kinds of ID
  3. One ID, cited everywhere
  4. Following a line back
  5. When an ID earns its place
  6. Which ID fits?
  7. In the kit
  8. Three rules of thumb

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.

Requirements: what Plan: why and when Architecture: how Citations Open questions

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 whatwhat a user can do or must see REQ-041 REQ-042 Withdrawn: REQ-017 docs/plan/ the whyscope, order, decisions, questions DEC-018 DEC-019 OQ-07 docs/architecture/ the howprinciples and the system shape P1 to P12 §4 tenancy ADR-0007
Three documents, three kinds of ID. Nothing else in the repository invents its own numbering.
  • 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:

docs/prd/rentals.md, and docs/plan/decisions.md
### 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
A requirement says what. A decision quotes who decided and the exact words, so nobody paraphrases it into something else later.

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:

specAC-1 to AC-5 DEC-018per started hour test nametest_req041_ac2_... code comment# REQ-041 AC-3 commitACME-41: REQ-041 ... pull requestevidence table coverage matrixREQ-041 · COVER CHANGELOGone line REQ-041late returns are charged a fee
One ID, eight places. Search for it and you find every reason, test and change behind the feature.
In code

# REQ-041 AC-3: never more than one day (DEC-018) on the line that does it, not at the top of the file.

In tests

The test name carries the ID: test_req041_ac3_fee_capped_at_day_rate. A failure points at the promise it broke.

In commits

ACME-41: REQ-041 AC-2 per started hour. The ticket for people, the REQ for the record.

In pull requests

The evidence table lists each AC with its proof. Reviewers check rows, not vibes.

In the coverage matrix

Every REQ and AC mapped to the test that proves it, with an honest state.

In the changelog

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:

Start from a line of code min(fee, day_rate) # REQ-041 AC-3 test_ac3_cap spec AC-3 and keep going spec cites DEC-018 DEC-018 quote who, when the reason Without IDs the trail stops at the first hop: "someone wrote this".
Six hops from a line of code to the person who decided it, without asking anyone.

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

Give it an ID when
  • 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.
Do not when
  • 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

IDs never change

Retire an ID by marking it Withdrawn. Never reuse the number for something else.

Cite where it bites

The ID goes on the line, test or commit that depends on it, not in a list somewhere else.

The repo is enough

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.

See services
Next in this seriesSpec-driven development, for realPrinciples and scoped rules4 min read