SPEC-DRIVEN DEVELOPMENT
The spec is the prompt.
For approximately fifty years, the specification functioned as scaffolding: authored to secure approval, then set aside once implementation began. The code constituted the artifact of record. The document carried no enforced authority.
Autonomous coding agents have reversed this relationship. An agent produces a plausible implementation of whatever intent it infers — quickly, consistently, and in a fixed house style — without the capacity to verify that inference against the author’s actual requirements. Consequently, the scarce, high-value output of a human contributor is no longer the implementation. It is the specification of intent, articulated with sufficient precision that an automated system cannot reasonably misread it.
This is the governing premise of the discipline documented here. What follows is its methodology.
| BEFORE · code is authoritative | AFTER · the spec is authoritative | |
|---|---|---|
| Source of truth | The code in the default branch | The signed specification |
| What a reviewer actually reads | The diff, on its own | The diff, checked against a spec they already approved |
| What survives a rewrite | Nothing — intent is re-read out of the old implementation | The specification; the implementation is regenerated against it |
| What a new session reads first | Whatever context fits in the prompt | The committed spec, plan, and constitution |
| What a stale document costs | A wiki page nobody trusts | A failed build (Traceability & Drift) |
A five-row table contrasts what was authoritative before this inversion against what is authoritative after it. Source of truth: the code in the default branch, versus the signed specification. What a reviewer actually reads: the diff on its own, versus the diff checked against a spec they already approved. What survives a rewrite: nothing, since intent has to be re-read out of the old implementation, versus the specification, with the implementation regenerated against it. What a new session reads first: whatever context fits in the prompt, versus the committed spec, plan, and constitution. What a stale document costs: a wiki page nobody trusts, versus a failed build, per the Traceability and Drift chapter.
The Practice Graph
The loop, anchored to a Jira board — every phase, every artifact, and the ideal kanban board that keeps it resilient to a changed plan.
This chapter operationalizes the loop into a single canvas: a phase-gated dependency graph anchored at the Jira board where a ticket actually starts, followed by the board configuration — columns, WIP limits, swimlanes — that keeps the tracker and the graph in agreement when a plan changes.
Everything that follows in this book is a theory of writing. Before the theory, the practice: a single canvas showing where a ticket enters, what gets written at each phase, who owns each decision, and — the detail a whiteboard version of this diagram always omits — what happens when the plan turns out to be wrong partway through.
The starting point is not a blank page. It is a Jira board, because that is where the work already lives. This chapter draws the loop as a phase-gated dependency graph anchored to that board, then shows the board configuration — columns, WIP limits, swimlanes — that keeps the two in agreement.
SEVEN PHASES, ONE BOARD
KEYSTab moves between blocks · Enter or click pins the detail panel · click ROLE chips to isolate context, agent, human, or artifact blocks · SHOW LOOPS toggles the four dashed resilience edges
A directed graph with seven column phases — The Board, Specify, Clarify, Plan and Tasks, Implement, Analyze and Review, Release and Learn — each containing two to four blocks glyphed by role: hollow square for context, diamond for agent work, circle for a human decision, filled diamond for a committed artifact that gates the next phase. Solid arrows run left to right along the flow. Four dashed loop edges run backward: Clarify's resolved-questions block loops to Specify's signed-criteria block when an answer changes scope; Implement's scope-check loops to Plan and Tasks' draft-plan block when work is discovered outside the approved plan; Analyze and Review's human-review block loops to Specify's signed-criteria block when a convergence check finds unauthorised code; and Release and Learn's practice-library block loops all the way back to the Board's constitution block. Five artifact blocks carry a small Diataxis colour dot: the constitution and the committed spec are tagged Reference, the approved tasks are tagged How-to, the provenance chain is tagged Reference, and the practice library is tagged Explanation. Hovering or focusing any block highlights its connected chain and dims the rest; clicking pins a detail panel below the graph with the block's full description, owner, what it needs, what it unlocks, and the rule that put it there.
The four dashed edges are the part a static process diagram cannot show, and the part that answers the question every team asks first: what happens when the plan changes mid-ticket? It does not stall the graph and it does not get silently absorbed into a growing diff. It re-enters at a named point — Specify if the requirement itself was wrong, Plan & Tasks if the requirement holds but the approach doesn’t — and the graph runs forward again from there. A ticket that bounces backward once or twice before release is the loop working, not the loop failing.
What Diataxis has to do with any of this
Every artifact this loop produces is a piece of writing, and every piece of writing has exactly one job. The four coloured dots on the graph above tag each artifact by which job it does, using the same Diataxis framework this site’s own documentation library runs on.
- Reference — the constitution, the committed spec, the provenance chain. Looked up, never read start to finish.
- How-to — the approved tasks. A task-oriented procedure toward one specific, immediate change.
- Explanation — the practice-library entry. Understanding-oriented: why this ticket bounced, read once.
- Tutorial — not produced by this loop at all, but by whoever wrote the walkthrough that onboards the next engineer onto this board in the first place.
The fuller taxonomy, and this consultancy’s own documentation set organised by it, is at /docs — the Diataxis overview and its own document dependency graph — the figure the graph above was drawn in the image of. The twenty-six-block version of the graph above, with readiness, security scanning, and DORA metrics folded back in, is the Blueprint at /agentic-sdlc.
The graph above is the argument; the board below is the enforcement. A dependency graph on a slide is a claim about how work should move. A Jira board with WIP limits on its gate columns is that claim made expensive to ignore — a ticket physically cannot sit in Plan Review without either an approval or a visible violation of the column’s limit.
Backlog
no limit
Specify
WIP 3
Clarify
WIP 3
Plan Review ★
WIP 2
In Progress
WIP 4
In Review
WIP 3
Done
no limit
REPLAN PATHS — WHERE A CARD MOVES BACKWARD, ON PURPOSE
KEYSClick any card to pin its artifact checklist · hover or focus a replan path to highlight the two columns it connects
A Jira-style board with seven columns — Backlog (no limit), Specify (WIP 3), Clarify (WIP 3), Plan Review with a star marking it as a gate (WIP 2), In Progress (WIP 4), In Review marked as a gate (WIP 3), and Done (no limit) — crossed by three swimlanes for Tier 1 agent-autonomous work, Tier 2 to-plan work, and Tier 3 proposal-only work, coloured green, amber, and red respectively by increasing caution. Seven example ticket cards are distributed across the board, each showing a Jira key, a type, a title, and a coloured left border for its tier; clicking a card opens a detail panel with its artifact checklist. Below the board, three replan paths are listed as backward moves: Clarify back to Specify when an answer changes scope, In Progress back to Plan Review when a scope check fails, and In Review back to Specify when a convergence check finds unauthorised code — each with its reason stated in one line, and hovering one highlights its two columns on the board above.
Two columns carry the graph’s four gates: Plan Review enforces plan approval, and In Review enforces the human diff review. Both are WIP-limited on purpose — a low limit makes a bottleneck visible on the board itself, rather than invisible in a diff that quietly grew past what anyone approved.
Swimlanes are drawn by risk tier, not by team or component, because autonomy is a property of the work (the fuller three-tier rubric — what earns Tier 1 autonomy versus what is proposal-only regardless of who is asking — lives at /agentic-sdlc). The same three tiers, read as decision rights and an escalation path rather than board layout, are .
A BOARD SETUP NOTE, READY TO PASTE INTO YOUR JIRA ADMIN TICKET
Board columns, left to right: Backlog (no WIP limit) Specify (WIP 3) Clarify (WIP 3) Plan Review ★ (WIP 2 — gate: requires human plan approval to exit) In Progress (WIP 4) In Review (WIP 3 — gate: requires human diff review to exit) Done (no WIP limit) Swimlanes: Tier 1 / Tier 2 / Tier 3, by blast radius — not by team or component. Automations to wire on day one: - moving a card OUT of Plan Review requires a "plan-approved" checkbox or a linked ADR - moving a card OUT of In Review requires a merged PR link - a card that re-enters Specify from Clarify or In Review is auto-labelled "replanned" (this is a signal to watch, not a thing to prevent)A diagram that cannot show what happens when the plan changes is describing a different practice than the one your team is about to run.
Why Now
Historical context for the discipline, summarized in one figure.
This chapter situates the discipline historically: a corrective response to unstructured prompting, and a continuation of requirements engineering rather than a novel invention.
The term “vibe coding” — issuing loosely specified prompts and accepting whatever output results — was coined by Andrej Karpathy in early 2025 and was subsequently named Collins Dictionary’s word of the year. The approach is well suited to disposable prototypes and poorly suited to any system requiring ongoing maintenance. By 2026, agent-assisted workflows had matured toward oversight and structure, and use of the term itself had declined accordingly.
Spec-driven development represents a disciplined alternative. Its central claim is narrow and defensible: where an agent generates the majority of an implementation, the specification becomes the highest-leverage artifact a human contributor produces. The relevant skill shifts from authoring implementation code to defining intent with sufficient precision that an automated system cannot misinterpret it.
The underlying practice is not new. Requirements engineering, behaviour-driven development, contract-first API design, and model-based design all precede it by decades. What has changed is the consumer of the document: for the first time, the specification has a reader that will act on it literally, at scale, and in seconds. This changes the standard a specification must meet.
1970s–90s · WATERFALL
Big specs. Long feedback loops. Shadow architecture.
KEYS← → move between stops · Enter / Space selects the focused stop · Tab reaches each stop directly
A five-stop timeline compares feedback-loop length against how much intent stays written down, era by era. 1970s to 1990s, Waterfall: a long feedback loop, but written intent stays high — favorable on intent, unfavorable on loop length. 2000s to 2010s, Agile: the loop shortens, but written intent drops as the spec shrinks to a ticket — neither bar favorable together. 2010s, BDD and contract-first: the loop stays short and written intent recovers slightly, for the parts of the system that mattered most — still not both favorable. 2025, Vibe coding: the shortest loop, but the lowest written intent — comprehension near zero. 2026, Spec-driven: the loop stays short and written intent returns to its highest level — the only stop where both bars are favorable at once.
Spec-driven development does not add documentation overhead. It shortens the feedback loop while preserving specified intent.
What a Spec Actually Is
The design document, compared against the executable specification.
This chapter addresses the most common misconception in the field: that a specification is equivalent to a design document stored in a wiki. A design document is read. A specification is executed.
The most consequential distinction in this discipline, and the one most treatments omit, is this: a specification under this methodology is not documentation describing the system. It is an artifact consumed directly by the agent and enforced by the test suite. If no build fails when the specification and the code diverge, the document produced was a design document, not a specification.
READ BY
Humans
ENFORCEMENT
Advisory — anyone may diverge
LIFECYCLE
Becomes outdated, rarely revisited
LIVES IN
A wiki rarely accessed
READ BY
Humans and agents
ENFORCEMENT
Executable — tests fail on drift
LIFECYCLE
Living, continuously validated
LIVES IN
The repo, next to the code, in CI
Two columns compare a traditional design document against an SDD spec across four dimensions. Read by: a design doc is read by humans; an SDD spec is read by humans and agents. Enforcement: a design doc is advisory, so anyone may diverge from it; an SDD spec is executable, so tests fail on drift. Lifecycle: a design doc becomes outdated over time and is rarely consulted; an SDD spec is living and continuously validated. Lives in: a design doc typically resides in a wiki that is seldom accessed; an SDD spec lives in the repo, next to the code, in continuous integration.
The following three properties distinguish an executable specification from an advisory one:
- 01
The specification is versioned with the code.
It resides in the same repository, the same pull request, and the same review process. A specification maintained in a ticketing system or a chat transcript is invisible to a subsequent agent session — and that session is the one most likely to misinterpret the requirement.
- 02
Its acceptance criteria correspond directly to tests.
One criterion corresponds to one test, identified by a shared identifier. This mapping is what renders drift a detectable condition rather than a matter of interpretation.
- 03
It constrains the scope of agent exploration.
An explicit out of scope section constrains agent behaviour more effectively than any amount of additional detail. An unbounded specification produces an unbounded diff.
The Rigor Ladder
Three levels of methodological rigor: spec-first, spec-anchored, spec-as-source.
This chapter defines three levels of methodological rigor and identifies which is appropriate for most production work. Spec-first, spec-anchored, and spec-as-source are not a maturity progression; each is correct for different circumstances.
Authoritative sources converge on the same three levels of rigor. A common misconception is to treat this hierarchy as a maturity progression to be climbed; it is not. Each level is appropriate for a different category of work, and the highest level remains aspirational for most teams.
| Rung | Definition | Drift | Best for | Cost |
|---|---|---|---|---|
| Spec-first | The spec seeds generation. Afterwards code is allowed to drift. | Accepted | Prototypes, spikes, one-off features | Very low |
| Spec-anchored ★ | Spec and code evolve together; automated tests enforce alignment. Code stays the source of truth. | Detected and corrected | Most production systems | Moderate |
| Spec-as-source | Humans edit only the spec. Code is fully generated and never hand-edited. | Eliminated by construction | Narrow, well-bounded, heavily-tooled domains | High, and demands trusted generation |
This document recommends the spec-anchored level as the appropriate target for most production work. Spec-as-source represents the current locus of industry enthusiasm; spec-anchored represents the current locus of demonstrated value. It retains executable code as the source of truth — the artifact actually deployed to production — and uses the specification as the anchor against which tests verify alignment.
SPEC-ANCHORED · ★ TARGET
- YOU EDIT
- The spec and the code, together, in the same PRs.
- GENERATED
- The first implementation, and every change after, proposed by the agent.
- ENFORCES ALIGNMENT
- Automated tests, each cited to an acceptance criterion in the spec.
- IF INCORRECT
- CI — a cited test fails, or a criterion turns up with no test at all.
▸ specs/ + src/ + tests/ (spec cited in tests)
KEYS← → move between rungs · Enter / Space selects the focused rung · Tab reaches each rung directly
Three ascending rungs represent increasing rigor. Spec-first: you edit only the initial spec; all code is generated once and then allowed to drift; nothing enforces alignment afterward; the drift meter reads full, meaning drift is accepted, not tracked. Spec-anchored, marked as the recommended target: you edit the spec and the code together in the same pull requests; automated tests cited to acceptance criteria enforce alignment; the drift meter reads half, meaning drift is detected and corrected rather than absent. Spec-as-source: you edit only the spec, forever; all code is regenerated wholesale from it; the generation pipeline itself enforces alignment since there is no hand-edit path; the drift meter reads empty, meaning drift is eliminated by construction — though this rung demands tooling maturity most teams do not yet possess. Selecting any rung expands a panel below with what you edit, what is generated, what enforces alignment, what breaks if you are wrong, and a one-line repo signature.
RUNG SELECTOR
Will this code outlive the quarter?
Will more than one person maintain it?
Answer both questions above for a recommendation.
The Loop
Constitution → Specify → Clarify → Plan → Tasks → Implement → Analyze
This chapter documents the canonical workflow and its required human review gates: Constitution → Specify → Clarify → Plan → Tasks → Implement → Analyze.
Every established toolkit implements substantially the same pipeline, under varying nomenclature, with a human review gate at each phase boundary. The specific names are less significant than the boundaries themselves; the boundaries constitute the actual value of the methodology.
| Phase | The agent does | The human owns | Artifact |
|---|---|---|---|
| Constitution | Drafts project-wide rules based on observable repository conventions | Ratifies the rules; once ratified, they are binding rather than advisory. | constitution.md / AGENTS.md |
| Specify | Drafts what and why: user stories, acceptance criteria, out-of-scope | Signs the acceptance criteria | spec.md |
| Clarify | Identifies ambiguities and raises questions prior to planning | Answers, or declares the unknown out of scope | Resolved question log inside the spec |
| Plan | Proposes how: architecture, data model, technical decisions | Approves the approach ★ | plan.md |
| Tasks | Decomposes into atomic, independently shippable items | Checks scope and ordering | tasks.md |
| Implement | Executes tasks, verifying each against its criteria | Reviews the diff against the approved plan | The diff |
| Analyze | Cross-checks spec ↔ plan ↔ tasks ↔ code for consistency | Determines the significance of any inconsistencies found | Convergence report |
SEVEN PHASES, IN ORDER
Proceeding directly from specification to implementation is not recommended. A plan is inexpensive to read and inexpensive to reject; a diff is neither.
DIFF SIZE AT REVIEW
4 files / 180 lines
▸ SELECT A PHASE
Select or focus a node and press Enter to view its inputs, outputs, the consequence of skipping the gate, and the corresponding command in three tools.
KEYSArrow keys move focus between phases · Enter or click opens that phase's inspector · S toggles the skip-the-plan-gate simulation · hovering or focusing Plan dims every other phase
The loop runs Constitution, Specify, Clarify, Plan, Tasks, Implement and Analyze in sequence, with two feedback edges: Clarify returns open questions to Specify, and Analyze returns detected inconsistencies to Specify. Six of the seven phases end in a human sign-off gate — Constitution is ratified, Specify's acceptance criteria are signed, Plan's approach is approved, Tasks' scope and ordering are checked, Implement's diff is reviewed against the approved plan, and Analyze's inconsistencies are decided by a human. Only Clarify is a dialogue rather than a gate: the agent asks, a human answers or declares the unknown out of scope. Simulating a skip of the Plan gate rewires Specify directly to Implement: the Plan and Tasks nodes grey out, and the reviewable diff swells from four files and 180 lines to thirty-one files and 2,400 lines for the same ticket — the review burden moves from a two-page plan to a thirty-one-file diff.
Include this checklist in the pull request description before requesting review of the diff.
The Constitution
The governing constraints an agent must apply before any other artifact.
This chapter defines the artifact that must exist before any specification is written: the project-wide, always-on rules an agent is required to apply before consulting any other document.
A constitution defines the set of project-wide, always-on constraints governing a repository: language and framework, testing standards, dependency policy, security posture, and paths that must not be modified. It should be committed before the first specification is written. Without it, every agent session must re-infer project conventions, and the codebase drifts incrementally across sessions — a pattern that, from the outside, is indistinguishable from a team with no standards at all.
These two files serve a single purpose. AGENTS.md (or CLAUDE.md) is the agent-facing operating manual: stack, commands, conventions, restricted paths, and known failure modes. constitution.md constitutes the governing principles layer: the rules a team would defend in a design review, independent of any specific tooling. Smaller teams may consolidate both into a single file without loss; the failure mode to avoid is maintaining neither.
# Constitution — <project-name>Version: 1.0 · Ratified: <date> · Owner: <name> > Governing principles for this repository. Every spec, plan and task is> subordinate to this document. Where a client agreement is stricter, the> client agreement wins. ## 1 · Stack (non-negotiable without an ADR)- Language: <e.g. TypeScript 5.x, strict mode>- Runtime: <e.g. Node 22>- Framework: <e.g. Next.js 15 App Router>- Data: <e.g. PostgreSQL 16 via Drizzle>- Package manager: <e.g. pnpm — never mix with npm/yarn> ## 2 · Commands (run these; do not invent variants)- Lint: `<make lint>`- Test: `<make test>` single: `<make test T=path::name>`- Build: `<make build>`- All three must pass before any commit is proposed. ## 3 · Principles (ubiquitous EARS form)- THE system SHALL have unit tests for all domain logic.- THE system SHALL NOT log personally identifying data at any level.- THE system SHALL NOT gain a new runtime dependency without a human decision recorded in the plan.- THE system SHALL keep HTTP handlers free of business logic.- THE system SHALL return structured errors from `<errors module>`; never bare exceptions, never silent fallback values. ## 4 · Specification standard- One feature = one directory: `specs/NNN-slug/{spec.md,plan.md,tasks.md}`.- Acceptance criteria SHALL use EARS syntax and carry `AC-NN` identifiers.- Every task SHALL cite the criteria it satisfies.- Every spec SHALL contain an explicit "Out of scope" section.- A spec SHALL be updated in the same pull request as the behaviour it describes. ## 5 · Autonomy tiers| Tier | Work | Agent may | Gate ||------|------|-----------|------|| 1 | Tests, docs, lint, dependency bumps | Work autonomously | PR review || 2 | Feature work, refactors, bug fixes | Propose a plan, then implement | Approved plan || 3 | Auth, crypto, data models, migrations, IaC, public contracts | Analyse and propose only | Line-by-line acceptance + architect sign-off | **Escalation rule:** when the tier is unclear, treat it as the higher one. ## 6 · No-go paths (propose only, never modify)- `migrations/` · `infra/` · `src/generated/` · `vendor/`- `.env*` except `.env.example`, and anything matching `*secret*` ## 7 · Security posture- Production data SHALL NOT appear in any prompt. Use synthetic fixtures.- Every agent-suggested dependency SHALL pass composition and licence scanning.- Secret scanning SHALL run in pre-commit hooks. ## 8 · Definition of done- Lint, tests and build pass via the commands in §2.- New behaviour has tests a human has read and approved.- The diff touches only files named in the approved plan.- The spec reflects the behaviour that shipped. ## 9 · Sharp edges (append every hard-won surprise here)- <e.g. the ORM session is request-scoped; holding it across awaits deadlocks>- <e.g. `make test` requires Docker for the Postgres fixture>KEYSTab through gutter pins, or hover
An annotated constitution.md template with nine gutter markers, reachable by tab or hover, each explaining the significance of that section. The most consequential are the stack declaration — ambiguity there compromises every downstream specification — and the dependency policy, since a hallucinated or typosquatted package represents an active security risk rather than a theoretical one.
Appendix A, one click
The complete constitution template shown above, ready for direct use in a repository, is provided in the appendix.
Writing the Spec
Structure, scope boundaries, and domain-specific language.
This chapter converts the instruction to write a specification into a repeatable structure with defined limits: one feature per specification, one directory, one to three pages.
A specification exceeding three pages is, in practice, two specifications. A specification that reads as pseudo-code represents a program written twice. Between these two failure modes lies a narrow, learnable format.
✕ VAGUE
“Users should be able to log in easily.”
✓ PRECISE
WHEN a user submits a valid email THE system SHALL send a one-time login link valid for 15 minutes.
AMBIGUITY: HIGH → LOW · TESTABLE: NO → YES · TESTS IMPLIED: 0 → 2
KEYSLeft / Right arrow keys, or the REWRITE button, step through four examples; the current example is announced for screen readers
Four rewrites of common vague requirements into EARS-precise acceptance criteria, each followed by a machine-readable ambiguity and testability readout. 'Users should be able to log in easily' becomes 'WHEN a user submits a valid email THE system SHALL send a one-time login link valid for 15 minutes.' 'Handle errors gracefully' becomes 'IF a login link is used more than once THEN the system SHALL reject it with HTTP 410 and record the attempt.' 'Make it fast' becomes 'THE system SHALL return the album list in under 200 ms at p95 for libraries up to 10,000 photos.' 'Should be secure' becomes two criteria: 'THE system SHALL store link tokens as SHA-256 hashes, never in plaintext' and 'WHERE the email has no account THE system SHALL still return HTTP 202.' In every case ambiguity drops from high to low and testability flips from no to yes.
The disciplines
- Write in domain language, not implementation detail. “The system shall reject a reused login link” — not “the controller shall verify
consumed_atis null”. Once a specification references an ORM or comparable implementation detail, design has begun, and it is occurring in the wrong document. - One directory per feature:
specs/004-magic-link/{spec.md,plan.md,tasks.md}. Numbered, ordered, and searchable by convention. - Draft collaboratively; decide independently. An effective specification typically results from dialogue: describe the requirement, allow the model to structure it, and challenge any assumptions it introduces. Subsequently remove anything that was not an explicit decision.
- Specify failure behaviour explicitly. Most deficient specifications describe only the primary success path. The failure behaviour of a system is at least as significant as its success behaviour, and it is precisely the portion an agent will infer independently if it is omitted.
The structure
- 01
Context
One paragraph establishing business context: why the feature exists, for whom, and the current state of the system.
- 02
Goals
Three to five outcomes, stated in domain language.
- 03
Non-goals / out of scope
The scope boundary. This section constrains agent behaviour more than any other.
- 04
User stories
One narrative per capability, stated from the user's perspective.
- 05
Acceptance criteria
EARS notation, numbered, testable, one clause each (Chapter 07).
- 06
Data & interfaces
Limited to what the behaviour requires. The schema belongs in the plan, not here.
- 07
Open questions
Each question requires an assigned owner and a resolution date; without both, it is an aspiration rather than a tracked question.
- 08
Constitution deviations
Any departure from a standing rule, with justification.
Appendix B, one click
The complete spec.md template, ready for direct use in a feature directory.
EARS
Five sentence patterns for acceptance criteria unambiguous to a model.
This chapter presents five sentence patterns for acceptance criteria that leave no room for model misinterpretation. The notation is best learned through direct practice.
EARS — the Easy Approach to Requirements Syntax — is the de facto standard for acceptance criteria unambiguous to both human readers and models. The notation consists of five sentence patterns in their entirety, and can typically be learned within several minutes.
THE KEYWORD LEGEND
| Pattern | Template | Example |
|---|---|---|
| Ubiquitous | THE system SHALL {response} | THE system SHALL log every authentication attempt. |
| Event-driven | WHEN {trigger} THE system SHALL {response} | WHEN a user submits the login form THE system SHALL validate credentials. |
| State-driven | WHILE {state} THE system SHALL {response} | WHILE a sync is running THE system SHALL show a progress indicator. |
| Unwanted behaviour | IF {condition} THEN THE system SHALL {response} | IF validation fails three times THEN THE system SHALL lock the account for 15 minutes. |
| Optional feature | WHERE {feature} THE system SHALL {response} | WHERE MFA is enabled THE system SHALL require a TOTP code. |
Two rules distinguish EARS-shaped text from EARS notation proper:
RULE 01
One clause per criterion. A sentence containing “and” between two distinct behaviours constitutes two criteria, and will become two tests.
RULE 02
Every criterion is assigned an identifier. AC-03, for example. Tasks cite it, tests name it, and commits reference it. This identifier is the thread that renders the specification executable: when a test fails, the specific intent that failed is immediately identifiable.
The benefit is structural: criteria written in this form map nearly one-to-one onto test cases. This mapping is what renders a specification executable rather than advisory, and is also why EARS notation outperforms free prose for agent consumption — it leaves no room for a plausible alternative interpretation.
STAGE 1 — CHOOSE A SHAPE
STAGE 2 — FILL THE SLOTS
THE system SHALL observable response
▸ An invariant — always true, no trigger and no condition. Reserve this for rules, not behaviour.
STAGE 3 — LIVE ANALYSIS
✕ TESTABLE — FAIL
What would you assert in a test?
✓ ATOMIC — PASS
✓ MEASURABLE — PASS
✓ BOUNDED — PASS
KEYSTab through pattern tiles and slot fields · type to see the assembled criterion and meters update (debounced ~400ms) · Wall of Shame switch shows 4 failing examples with zero typing required
An interactive EARS composer in three stages. Stage one: choose one of five sentence shapes — ubiquitous, event-driven, state-driven, unwanted-behaviour, or optional-feature — each shown as a labelled tile with its template. Stage two: fill that pattern's slots in real text fields, each with a hint explaining what belongs there. Stage three: the tool assembles the full criterion live and scores it against four meters — testable, atomic, measurable, and bounded — each reporting pass or fail as text, with a plain-language hint on failure, plus a guessed test name the criterion implies. Fuzzwords like 'fast' or 'appropriately' and unbounded quantifiers like 'some' or 'most' are struck through automatically wherever they appear. A wall-of-shame mode replaces the composer with four pre-written bad criteria, so a reader can observe all four meters fail without entering any text. A criterion constructed this way specifies its own test before any implementation code exists.
Plan & Tasks
Decomposing intent into a reviewable sequence of changes.
This chapter describes the process between an approved specification and a reviewable diff: the plan introduces technical decisions, and tasks decompose intent into an ordered, reviewable change list.
A plan contains
- The stack and versions
- The data model
- The interfaces and contracts
- The sequence of the change
- The decisions, with their alternatives and trade-offs
- The risks
- An explicit statement of what will not be touched
A plan does not contain
Implementation code. Including it would require reviewing the same work twice.
The specification deliberately omits any reference to the technical stack. plan.md is where that constraint is lifted — and where a reviewer performs the least costly, highest-leverage work available anywhere in this methodology.
Tasks follow the plan. Decomposition is not administrative overhead — it is the mechanism by which one unreviewable change is converted into a series of reviewable ones. A well-formed task is atomic (addressing one concern), ordered (with explicit dependencies), independently verifiable, and — non-negotiably — cites the acceptance criterion it satisfies.
- [ ] T1 migration: magic_tokens table refs AC-01, AC-04- [ ] T2 POST /auth/magic-link — issue + send refs AC-01, AC-03- [ ] T3 GET /auth/verify — consume + establish session refs AC-02- [ ] T4 contract tests for the 202 and 410 paths refs AC-02, AC-03- [ ] T5 rate limit the issue endpoint (5/min/IP) refs AC-05The refs column is the operative mechanism. It forms the thread connecting business intent, task, commit, and test. When a failure occurs in production, the relevant question is not what the code does, but which specified intent has been violated — and that answer is retrievable with a single search.
CRITERIA
AC-01
issues a single-use magic link
AC-02
a reused link is rejected with 410
AC-03
a link expires after 15 minutes
AC-04
token is persisted hashed
AC-05
issue endpoint rate-limited 5/min/IP
TASKS
T1
migration: magic_tokens table
T2
POST /auth/magic-link — issue + send
T3
GET /auth/verify — consume + session
T4
contract tests: 202 + 410 paths
T5
rate limit the issue endpoint
COMMITS
C1
feat(auth): magic_tokens migration
C2
feat(auth): issue magic link on login
C3
feat(auth): verify endpoint + session
C4
test(auth): 202/410 contract tests
C5
feat(auth): rate limit issue endpoint
TESTS
X1
magic-link.spec.ts › migration applies
X2
magic-link.spec.ts › issues link, 15m TTL
X3
auth/verify.spec.ts
X4
verify.spec.ts › 410 on reused link
X5
rate-limit.spec.ts › 429 at 5/min
Hover or focus any node to trace its thread across all four columns.
KEYSTab or hover any node to trace its thread · BREAK A TEST button demonstrates the failure trace · RESET returns to the neutral state
Four columns — criteria, tasks, commits, tests — share one consistent magic-link example: five acceptance criteria (AC-01 through AC-05), five tasks (T1 through T5) that cite them, one commit per task, and one test per task. Hovering or focusing any node highlights every node connected to it across all four columns and dims everything else. A 'break a test' button turns the auth/verify test node red and traces the failure backward: the test belongs to task T3, which cites acceptance criterion AC-02, 'a reused link is rejected with 410' — producing the read-out FAILED: auth/verify.spec.ts, task T3, criterion AC-02, 'a reused link is rejected with 410'. Traceability functions not as documentation but as an immediate answer to what failed.
plan.md and tasks.md templates
Templates for both files are provided in the appendix, alongside the constitution and CI script, ready for direct use.
Traceability & Drift
Enforcing and verifying alignment between specification and implementation.
This chapter addresses the strongest practical objection to the methodology — that specifications become stale — by converting drift detection from a matter of discipline into an enforced build failure.
Every abandoned wiki constitutes evidence for this objection, and the objection is correct by default: documents drift because no mechanism fails when they do. The remedy is not discipline, which degrades under deadline pressure, but ensuring that drift causes a build to fail.
A COMMIT TRAILER, CH.1 · CITATION
feat(auth): magic link issue + verify refs specs/004-magic-link/spec.md AC-01, AC-02Four mechanisms, in increasing order of cost:
- 01
1 · Citation
Tests reference their corresponding criterion, and commits reference their specification path. This costs nothing to implement and immediately answers which intent failed.
- 02
2 · Coverage check in CI
A script verifies that every acceptance criterion identifier declared in spec.md appears in at least one test name. An unreferenced criterion causes the build to fail with an enumerated list. This check requires roughly forty lines of code and represents the highest-return automation in this methodology. A template is provided in Appendix D.
- 03
3 · Contract enforcement
Where a specification declares an interface, that interface should be generated or verified directly: OpenAPI schema validation within tests, Pact or Specmatic for consumer-driven contracts, Protobuf for wire formats. The specification thereby ceases to be prose describing the interface and becomes the interface itself.
- 04
4 · Convergence review
Periodically instruct the agent to compare the codebase against the specification, plan, and tasks, and report divergences as a task list. This check is inexpensive to run and surfaces drift that citation alone cannot detect: behaviour present in the code that was never anyone's specified intent.
One practice remains that no tool can replace: when a requirement changes, update the specification first, within the same pull request as the corresponding code. Not afterward, and not in a subsequent ticket. A specification that records a decision made weeks earlier is not serving its function; it must represent the current statement of intent, or it serves no function at all.
Week 0 of 12.
TRACK A — NO ENFORCEMENT
WEEK 0 · 96% · ALIGNED
TRACK B — CI COVERAGE CHECK ENABLED
WEEK 0 · 96% · ALIGNED
END STATE · WEEK 12 — ALIGNMENT 34% vs 96% · UNKNOWN BEHAVIOUR 11 vs 0
Illustrative, not measured — a demonstration of the mechanism, not a study result.
KEYSDrag the range slider, or focus it and press Left / Right, to scrub week by week · the current week and both tracks' status are announced for screen readers
A twelve-week simulated timeline, scrubbed week by week, comparing two tracks. Track A has no enforcement: spec-to-code alignment starts at 96 percent and decays in three steps — a week-three hotfix that leaves the spec unchanged, a week-six new developer who reads the now-wrong spec, and by week nine the spec is actively misleading — ending at 34 percent alignment. Track B has a CI coverage check enabled: the same three events occur, each immediately fails a build and gets corrected the same week, so alignment saw-tooths back up near 96 to 98 percent every time rather than compounding downward. The illustrative week-twelve comparison: 34 percent alignment versus 96 percent, and 11 versus 0 instances of behaviour nobody intended. This is a demonstration of the mechanism, explicitly not a measured statistic.
Appendix D, the CI script
The complete coverage-check script — the highest-return automation in this methodology — ready for direct use in a CI pipeline.
The Tooling Landscape
GitHub Spec Kit, AWS Kiro, cc-sdd, Cursor, OpenSpec, BMAD-METHOD, Tessl, and a selection rubric.
This chapter surveys eight tools that implement the workflow described in Chapter 04, and provides a rubric for selecting among them.
Every tool listed below implements substantially the loop described in Chapter 04. They differ along three dimensions of practical significance: whether specifications are living or static, whether orchestration operates at the workspace or organizational level, and the degree of procedural ceremony required.
| Tool | Shape | Strength | Best for |
|---|---|---|---|
| GitHub Spec Kit | Open-source CLI + slash commands, works with 30+ agents | The reference implementation most commonly used as a benchmark; supports extensions, presets, and role bundles | Teams avoiding vendor lock-in |
| AWS Kiro | Agentic IDE with native specs, steering files and event hooks | requirements.md / design.md / tasks.md as first-class objects; dependency-graphed task waves | AWS-native organizations that want the IDE to enforce it |
| Claude Code + cc-sdd | Terminal-first slash commands / skills | The lowest-ceremony path to the complete loop; plan mode already functions as a review gate | Solo developers and CLI-based workflows |
| Cursor | IDE plan mode + AGENTS.md | Inline diff review; Spec Kit reachable over MCP | Teams optimizing for review UX |
| OpenSpec | Markdown + YAML, proposal-first | Minimal, framework-agnostic, delta-oriented | Independent developers, exploratory brownfield adoption |
| BMAD-METHOD | Community methodology, multi-agent roles | Constitution plus role-based agent personas; a flexible framework rather than a packaged product | Teams wanting method over tool |
| Tessl | Spec-as-source, compliance-oriented | Audit trails, regulated templates | Fintech, healthtech, regulated delivery |
| Google Antigravity | Agent-first, specification-constrained autonomy | Deep autonomy under spec constraints | Teams exploring high agent autonomy |
THE 30-SECOND RUBRIC
Already in Claude Code? ......... Spec Kit + cc-sdd skills
In Cursor? ...................... Plan mode + AGENTS.md + Spec Kit via MCP
AWS-native shop? ................ Kiro
Regulated industry? ............. Tessl
Want minimal ceremony? .......... OpenSpec — or just the templates on this page
Not sure? ....................... Start with the templates. Add a tool when the
templates start feeling like manual labour.GITHUB SPEC KIT
# GitHub Spec Kit — install, init, then drive it from your agent
uv tool install specify-cli
specify init my-project --integration copilot
cd my-project
# then, inside the agent:
/speckit.constitution Principles: code quality, testing standards, UX
consistency, performance budgets.
/speckit.specify Build ... (what and why, no tech choices)
/speckit.clarify (recommended before planning)
/speckit.plan Stack, architecture, data model
/speckit.tasks Actionable, ordered, criterion-citing
/speckit.analyze Cross-artifact consistency before implementing
/speckit.implement Execute the approved planAWS KIRO
# Kiro — spec as a first-class IDE object .kiro/ ├── steering/ # always-on project context (product, tech, structure) ├── specs/<feature>/ │ ├── requirements.md # user stories + WHEN/THEN acceptance criteria │ ├── design.md # architecture, sequence diagrams, considerations │ └── tasks.md # discrete, trackable, dependency-graphed └── hooks/ # event-driven agent actions (on save, on commit)
NO TOOL AT ALL
# No tool at all — this is a complete SDD setup
repo/
├── AGENTS.md # or CLAUDE.md — the operating manual
├── docs/constitution.md # governing principles
└── specs/
└── 004-magic-link/
├── spec.md # what + why + EARS criteria
├── plan.md # how
└── tasks.md # ordered, each citing AC-NNMY AGENT
MY CONTEXT
MY TOLERANCE
▸ Spec Kit is the conservative default: an open ecosystem, compatibility with over thirty agents, and no vendor lock-in.
LAST VERIFIED: 2026-08 — Tooling in this space changes every quarter. Verify before you standardize.
KEYSTab through the pills to filter · hover or focus a mark for its detail
A scatter plot with ceremony on the horizontal axis (low to high) and enforcement on the vertical axis (advisory to executable). Eight tools plus a 'no tool' reference point are plotted: Claude Code plus cc-sdd and a plain no-tool setup sit at low ceremony and moderate enforcement; OpenSpec sits low-ceremony, moderate-enforcement; GitHub Spec Kit sits centrally at moderate ceremony and moderate-to-high enforcement; Cursor and BMAD-METHOD sit around moderate ceremony with moderate enforcement; AWS Kiro and Google Antigravity sit higher on both axes; Tessl sits at the high-ceremony, high-enforcement corner, reflecting its compliance orientation. A dashed region in the low-ceremony, high-enforcement quadrant is labelled the spec-anchored, low-ceremony sweet spot. Filtering by agent, context, or tolerance dims non-matching tools and prints a one-line verdict.
Brownfield
Introducing the methodology into an existing, previously unspecified codebase.
Few teams operate on a greenfield codebase. This chapter presents a five-step procedure for adopting the methodology within an existing, previously unspecified codebase.
Every demonstration of this methodology begins with an empty directory. In practice, adoption more often begins with an existing codebase of several hundred thousand lines, no test coverage on the path requiring modification, and an imminent deployment deadline. The accurate answer to how the methodology should be adopted under these conditions is: progressively, one feature at a time, and never as a full rewrite.
THE FIVE-STEP ON-RAMP
- 01
Step 1 — Write the constitution from the code that exists
The constitution should describe the code that exists, not the code that is aspired to. Direct an agent to examine the repository and infer conventions, commands, module boundaries, and known failure modes, then review and correct its output. This requires approximately one hour and improves every subsequent agent session immediately, before any specification has been written.
- 02
Step 2 — Spec the next change, not the system
Retrospectively specifying the entire application is not recommended. Instead, take the next ticket and write a one-page specification for it. The specification directory grows one feature at a time, and after roughly one quarter, the most frequently modified parts of the system are also the most thoroughly specified — the coverage distribution that is actually desired.
- 03
Step 3 — Characterize before you change
For untested legacy code, direct the agent to write characterization tests that record current behaviour before any change is made. The specification should then be written as a delta describing what remains, what changes, and what must not change. The must-not-change list is the one that prevents regressions.
- 04
Step 4 — Add the CI coverage check on new specs only
The drift check should be scoped to specifications created after adoption began. A build should never be retroactively failed over documents that did not exist prior to adoption.
- 05
Step 5 — Let the map assemble itself
Every specification produced leaves a durable description of one part of the system. After roughly twenty features, documentation exists for the twenty most frequently modified areas of the system — assembled as a by-product of required work, rather than as a separately funded documentation initiative.
REPO TREE
package.jsonsrc/(400,000 lines you did not write)AGENTS.md ← new
EFFORT vs BENEFIT
STEP 1 — CONSTITUTION FROM WHAT EXISTS · effort: 1 hr
Every future agent session, immediately.
KEYS← → or click STEP buttons · MONTH 3 toggles the fast-forwarded state
A five-step on-ramp shown as a repo tree that gains one file or directory per step: AGENTS.md, then a specs/041-export-csv/spec.md directory, then a tests/characterization directory, then a .github/workflows/spec-check.yml file. Each step pairs a small, one-time effort with a benefit that starts immediately. A month-three toggle fast-forwards the tree to show twelve accumulated feature spec directories, captioned to note that no separate documentation project was ever scheduled.
The Honest Case Against
Where the methodology is unwarranted, and when to forgo it.
This chapter presents the strongest available objections to the methodology, not a weakened counterargument, and is offered as the basis for evaluating the claims made in the preceding chapters.
The following objections should be weighed before an organization standardizes on this methodology.
“This methodology is waterfall under a different name.”
“Drift and hallucination are not eliminated.”
“Over-specification defeats the purpose.”
“Precision produces false confidence.”
“Vendor-reported figures are marketing.”
VERDICT BAR — 0/5
JUST BUILD IT
Throwaway prototype, solo, short-lived, exploratory. Ceremony here is pure cost.
KEYSTab through the five toggles · Enter/Space to flip one
A decision widget with five yes/no questions: will agents write a meaningful share of this code, will more than one person maintain it, are the requirements complex or contested, is it integration-heavy or regulated or safety-relevant, and will it outlive this quarter. A verdict bar fills from crimson toward acid as yes answers accumulate, producing one of four verdicts: four or five yes answers recommend full spec-anchored SDD; three recommend a light spec-first approach without the CI check; one or two recommend skipping specs and keeping only a plan-approval gate; zero yes answers recommend skipping the methodology entirely and just building it, because ceremony on a throwaway prototype is pure cost.
Monday Morning
A ninety-minute initial adoption procedure.
This chapter condenses the preceding material into a ninety-minute initial adoption procedure requiring no tooling purchase.
This procedure requires ninety minutes, addresses one feature, and requires no tooling purchase. In the following week, add the CI drift check described in Appendix D, and add the AI-involvement line to the pull request template. This constitutes the complete adoption procedure; no subsequent phase is required.
0:00–0:20 — Constitution
0:00–0:20 · 20 MIN
Constitution
Copy Appendix A into docs/constitution.md. Specify the stack, the three required commands, and the restricted paths, then commit it. This alone improves every future agent session in this repository.
▸ produces: docs/constitution.md
Total: 90 minutes. No subsequent phase is required.
KEYS← → moves between segments · each segment has its own COPY THE PROMPT button
A timeline divided into five weighted segments spanning ninety minutes: twenty minutes to write a constitution, thirty minutes to write one spec, ten minutes to clarify ambiguities with the agent, twenty minutes to review a plan, and ten minutes to decompose tasks and implement the first one. Each segment names the artifact it produces and offers a literal prompt to paste into an agent.
The specification is now where analytical work occurs. Everything downstream of it is execution — and execution is the part of the process a human contributor no longer performs alone.
The Operating Model
The board-to-agent loop in steady state, a skill library versioned like code, and the escalation ladder that decides who is allowed to say yes.
This chapter runs Chapter 01's board-anchored loop in steady state: the concrete cycle between a Jira card and Claude Code, the points in it where the specification gets rewritten rather than merely read, how a team's skills are versioned and distributed like its code, and the tier ladder that decides how much of the cycle an agent may run unattended.
Chapter 01 drew the loop as a dependency graph anchored to a Jira board. This chapter runs it forward, in steady state, naming the two interfaces a ticket actually crosses — a card and an agent — instead of seven abstract phases. Six stations, three of which rewrite the specification rather than merely reading it, plus the two questions steady-state operation actually raises once the tooling is out of the way: where does a team’s accumulated judgment live, and how far is the agent allowed to go before it has to stop and ask.
SIX STATIONS, ONE LOOP
1 · ◉ HUMAN
PERSON
THREE PATHS THAT LEAVE THE MAIN SEQUENCE
KEYS← → moves between stations, wrapping past the last back to the first · Enter or click opens the detail panel below
A responsive grid of six station cards, reflowing from one row to several as the viewport narrows so nothing is ever hidden behind a scrollbar: Person, The Board, Claude Code Reads and Drafts, Commit and Update the Card, Human Reviews on the Board, and Claude Initiates. Person and Human Reviews carry a sodium-orange left edge marking them as human stations; The Board carries a neutral bone edge as an artifact station; the remaining three carry a cyan left edge marking them as agent stations. Each card shows a large low-opacity numeral, a role glyph, its label, and a one-line summary; three cards — Claude Code Reads and Drafts, Commit and Update the Card, and Human Reviews — carry a small SPEC tag, meaning the specification file is written or amended at that station. Selecting a card opens a full-width detail panel below the grid with what that station does, what it produces, and, for the three marked stations, exactly how it touches the spec. Beneath the panel, three always-visible rows state the paths that leave the six-station sequence rather than drawing them as arrows: a cyan row for a review that changes acceptance criteria and reopens the spec at Station 3; a sodium row for the Tier 2 and Tier 3 outcome that holds at Station 2, the board, until a human moves the card; and an acid-green row for the Tier 1 outcome that loops back to Station 3 automatically, with no human trigger.
Three of the six stations carry the ✎ SPEC mark, and each is a failure mode this book has already named under a different heading. Station 3 is Chapter 06’s constitution and Chapter 07’s spec structure, applied before implementation starts rather than reconstructed after. Station 4 is the discipline Chapter 09 asks for: a task’s diff and its spec citation land in the same commit, so no reviewer ever reconciles two histories. Station 5 is the bounce path Chapter 01 already drew from In Review back to Specify — reused here verbatim, because a review that changes acceptance criteria is a new specification event whether or not anyone bothers to call it one.
| Board event | Claude Code does | Repo artifact | The card shows |
|---|---|---|---|
| Card enters Backlog | Nothing — waits its turn | — | A key, a title, a tier label if known |
| Card enters Specify | Reads the card + constitution, drafts spec.md | specs/<slug>/spec.md (draft) | A comment linking the draft |
| Card enters Clarify | Lists ambiguities for a human to answer or close | spec.md — open questions resolved | The Q&A, on the card itself |
| Card enters Plan Review ★ | Proposes plan.md, then halts | plan.md (pending) | Cannot leave the column without an approval |
| Card enters In Progress | Implements tasks.md; amends spec.md if scope moves | tasks.md progress + any spec.md delta | A comment per task closed |
| PR opens | Commits, opens the PR, links it back | The diff | The PR link and its CI status |
| Card enters In Review ★ | Runs the drift / convergence check | Convergence report | Cannot leave without a human diff review |
| Card reaches Done | Checks its tier for what happens next | Provenance chain closed | Moves itself (T1) or waits (T2 / T3) |
WHAT ACTUALLY WIRES STATION 6, READY TO PASTE INTO A JIRA AUTOMATION RULE
# Jira Automation rule — "Tier 1: hand back to Claude Code"Trigger: card moved to Done AND tier = T1Condition: no comment containing "stop" in the last 10 minutesAction: webhook POST to the agent runner { "event": "card.done", "key": "{{issue.key}}", "tier": "{{issue.tier}}", "next": "pull-next-in-queue" } Tier 2, Tier 3, and any card with no tier label fire nothing. Therunner never polls the board — the board tells it when to move.A board that lets an agent close its own ticket without a human ever opening it is not efficient by itself. It is a governance gap wearing a kanban skin — unless the tier that allowed it was decided by a human, in writing, before the ticket started.
The loop above assumes Claude Code already knows how this team writes a spec, where its drift check lives, and which paths the constitution forbids. Chapter 06 put the always-on rules in one file; the same argument extends to narrower, more procedural knowledge — the kind that is really “how we do the release,” not “what we believe.” That belongs in a skill, versioned in git like everything else this chapter has asked you to commit, not in one engineer’s session history.
Stage 1 of 6 — Write
01 / 06 · WRITE
An engineer notices a repeatable procedure this repo needs — how a release gets cut, how an EARS spec gets shaped for this domain, how a migration gets filed — and drafts it locally as a SKILL.md: a short frontmatter description that controls when Claude Code reaches for it, and the instructions themselves.
▸ ~/.claude/skills/<name>/SKILL.md — personal, untracked
Six stages; only stage 5 branches. A skill that never leaves one repo skips packaging entirely.
KEYS← → moves between stages · numbers shown are stage order, not duration
A six-stage horizontal pipeline: Write, Propose, Review, Version, Package, Distribute. Write covers an engineer drafting a SKILL.md locally, describing when the skill should trigger and what it instructs. Propose covers opening a pull request that moves the skill into a shared skills directory or a dedicated skills repository. Review covers a reviewer checking the trigger description for accuracy, the body for encoding a real team decision, and any referenced files for embedded credentials. Version covers merging to the default branch with full history and a CODEOWNERS entry. Package is the one branching stage: a skill scoped to one repository needs no further step, while a skill meant for the whole organisation is bundled into a plugin manifest. Distribute covers an in-repo skill arriving automatically on the next pull, versus a packaged skill installed and updated from an internal marketplace the way a package manager pulls a release. Selecting any stage shows what happens there and what artifact it leaves behind.
A SHARED SKILLS DIRECTORY, IN THE REPO EVERYONE ALREADY CLONES
skills/├── ears-criteria/│ └── SKILL.md├── cut-a-release/│ ├── SKILL.md│ └── scripts/changelog.mjs└── open-a-migration/ ├── SKILL.md └── templates/migration.sql.tmplONE SKILL, WRITTEN THE WAY THIS BOOK ALREADY WRITES ACCEPTANCE CRITERIA
---name: ears-criteriadescription: > Use when drafting or reviewing acceptance criteria for a spec.md in this repo. Applies the team's five EARS sentence patterns and flags criteria that read as implementation detail rather than behaviour.--- # Writing acceptance criteria for this repo Apply the five patterns from Chapter 08 — ubiquitous, event-driven,state-driven, unwanted-behaviour, optional-feature. Prefer theevent-driven form (WHEN … THE system SHALL …) unless the requirementis genuinely always-on. Every criterion cited in a plan or a task must trace to a test name —see Appendix D's drift check. Flag any criterion that names a library,a function, or a file path: that is an implementation decision, andbelongs in plan.md, not spec.md.Every station in Fig.15A eventually asks the same question: is the agent allowed to keep going, or does it stop? Chapter 01’s kanban swimlanes already answer it, by risk tier, drawn there as board configuration. Read the same three tiers as a decision-rights table instead of a board layout, and they say who decides, what the agent may do unasked, who it escalates to when it can’t decide alone, and — the part a swimlane can’t show — what actually stops it if the label on the ticket turns out to be wrong.
TIER 2 · TO-PLAN · SHARED
- WHO DECIDES
- Shared — Claude Code proposes, a named human approves, at two separate points.
- MAY DO
- Draft the spec and the plan; implement only once the plan is approved; open the PR. It does not merge it, and it does not start the next card unasked.
- ESCALATES TO
- The ticket's spec owner — whoever signed its acceptance criteria — by a comment on the card, not a guess at their intent.
- FORCING MECHANISM
- The Plan Review and In Review columns' WIP limits (Ch.01): a card physically cannot clear either without an approval recorded on it.
- OVERRIDE TRIGGER
- A plan rejected twice in a row escalates to the tech lead rather than drawing a third autonomous attempt at the same plan.
KEYS← → moves between tiers · Enter / Space selects the focused tier
Three ascending rungs, coloured green, amber and red to match Chapter 01's swimlane convention. Tier 1, agent-autonomous: Claude Code alone decides; it may draft, implement, commit, merge its own pull request and move its own card to Done; it escalates to nobody by default, though it still comments for the record; nothing on the board stops it, but a failed drift check or a touched no-go path relabels it Tier 3 mid-flight. Tier 2, to-plan, the default for most tickets: decision rights are shared, with Claude Code proposing and a named human approving at two points; it may draft the spec and plan and open a pull request but not merge it or start the next card unasked; it escalates to the ticket's spec owner by a comment on the card; the Plan Review and In Review columns' WIP limits are what actually stop it; a plan rejected twice escalates to the tech lead. Tier 3, proposal-only, covering auth, billing, migrations and public contracts: a named human decides, not a generic reviewer; Claude Code may only draft a spec or RFC and comment, never open a branch; it escalates to the security or platform reviewer the constitution names for that path; CODEOWNERS on the constitution's no-go paths is what actually stops a merge; this tier cannot be relabelled down by anyone but whoever owns the constitution. Selecting a rung shows all five fields in a detail panel below.
The tier is not a courtesy label on a dashboard. It is the only thing standing between “Claude initiates” and an agent that finishes a ticket nobody asked it to start.
What overrides the label
- A diff touches a path the constitution names no-go (Ch.06) → Tier 3, no matter what the ticket was labelled.
- A drift or convergence check fails (Ch.10) → halts at In Review, regardless of tier.
- A plan is rejected twice → escalates to the tech lead instead of a third autonomous attempt.
- Anyone comments “stop” on the card → halts immediately. This is not overridable by tier.
Three figures, three separate lenses on the same six stations: a loop, a pipeline, a ladder. None of them, on its own, is what actually happens to a ticket — what happens is all three firing on the same six stations at once. The figure below walks one concrete ticket through Fig.15A’s loop a final time, this time carrying its tier from Fig.15C and its skill citation from Fig.15B at every station that needs one, with nothing left behind a hover or a click — everything below is on the page.
PERSON
HUMANFiles PROJ-455. Tier isn't obvious from the title, so it's left unset — Station 3 resolves it, not a guess at filing time.
THE BOARD
ARTIFACTCard moves Backlog → Specify. Column and (once set) tier are the only two fields Claude Code trusts.
CLAUDE READS + DRAFTS
AGENTReads the constitution and the ticket. The blast radius reads as ordinary feature work, not auth, billing, or a migration.
GATE — PLAN REVIEW ★
Holds: the ticket's spec owner (15C)
Escalates after — T1: n/a, self-cleared · T2: 24h · T3: 4 business hrs → tech lead (T2) / constitution owner (T3)
COMMIT + UPDATE
AGENTImplements to the approved plan, commits, opens the PR, links it back to the card.
HUMAN REVIEWS
HUMANReviews the PR from the card. This round: approved, with one scope note that doesn't touch acceptance criteria.
GATE — IN REVIEW ★
Holds: same spec owner, or a named delegate (15C)
Escalates after — T1: n/a, self-merges · T2: 48h · T3: 4 business hrs → tech lead (T2) / constitution owner (T3)
CLAUDE INITIATES
AGENTPROJ-455 is Tier 2 — one of these two outcomes fires, never both, and it isn't Claude's call which one.
Tier 1 only — ↻ loops to Station 3 on the next queued card, no human trigger
Tier 2 / Tier 3 (this ticket) — ⏸ holds at the board until the spec owner moves the card
A vertical, six-row path for one ticket, PROJ-455, Tier 2. Row 1, Person: files the ticket, tier not yet set. Row 2, The Board: the card moves from Backlog to Specify. Row 3, Claude Code Reads and Drafts: the tier is assigned here, Tier 2, shared decision rights; the agent cites the skill it drew on, ears-criteria, merged and pinned at Skill pipeline Stage 4, Version, marked released rather than a draft; the spec is drafted, marked spec touch one; a Plan Review gate opens, held by the ticket's spec owner, escalating after 24 hours for Tier 2 or 4 business hours for Tier 3 to the tech lead or the constitution's owner respectively, with Tier 1 self-clearing with no wait. Row 4, Commit and Update: implements to the approved plan and opens the pull request; the spec citation lands in the same commit as the diff, marked spec touch two. Row 5, Human Reviews: approves this round with a scope note; an In Review gate opens, held by the same spec owner or a delegate, escalating after 48 hours for Tier 2 or 4 business hours for Tier 3 to the same targets as the Plan Review gate, Tier 1 again self-clearing; a third, conditional spec touch is named but not triggered this round, since the review did not change acceptance criteria. Row 6, Claude Initiates: two outcomes are shown side by side rather than collapsed into one arrow — a dimmed Tier 1 outcome that loops back to Row 3 automatically with no human trigger, and a highlighted Tier 2 and Tier 3 outcome, the one that actually fires for this ticket, that holds at the board until the spec owner moves the card.
The tier sets how fast the agent may go. A named human and a clock decide whether it actually does.
Appendices
Reference templates: constitution, specification, plan and tasks, CI and pull request.
This appendix provides reference templates for the constitution, specification, plan and tasks, and CI and pull-request files, ready for direct use in a repository.
The following four artifacts constitute the primary reference value of this document. Each is complete and identical, byte-for-byte, to what the COPY control places on the clipboard and the DOWNLOAD control writes to disk; nothing shown here has been retyped for display.
APPENDIX A
# Constitution — <project-name>Version: 1.0 · Ratified: <date> · Owner: <name> > Governing principles for this repository. Every spec, plan and task is> subordinate to this document. Where a client agreement is stricter, the> client agreement wins. ## 1 · Stack (non-negotiable without an ADR)- Language: <e.g. TypeScript 5.x, strict mode>- Runtime: <e.g. Node 22>- Framework: <e.g. Next.js 15 App Router>- Data: <e.g. PostgreSQL 16 via Drizzle>- Package manager: <e.g. pnpm — never mix with npm/yarn> ## 2 · Commands (run these; do not invent variants)- Lint: `<make lint>`- Test: `<make test>` single: `<make test T=path::name>`- Build: `<make build>`- All three must pass before any commit is proposed. ## 3 · Principles (ubiquitous EARS form)- THE system SHALL have unit tests for all domain logic.- THE system SHALL NOT log personally identifying data at any level.- THE system SHALL NOT gain a new runtime dependency without a human decision recorded in the plan.- THE system SHALL keep HTTP handlers free of business logic.- THE system SHALL return structured errors from `<errors module>`; never bare exceptions, never silent fallback values. ## 4 · Specification standard- One feature = one directory: `specs/NNN-slug/{spec.md,plan.md,tasks.md}`.- Acceptance criteria SHALL use EARS syntax and carry `AC-NN` identifiers.- Every task SHALL cite the criteria it satisfies.- Every spec SHALL contain an explicit "Out of scope" section.- A spec SHALL be updated in the same pull request as the behaviour it describes. ## 5 · Autonomy tiers| Tier | Work | Agent may | Gate ||------|------|-----------|------|| 1 | Tests, docs, lint, dependency bumps | Work autonomously | PR review || 2 | Feature work, refactors, bug fixes | Propose a plan, then implement | Approved plan || 3 | Auth, crypto, data models, migrations, IaC, public contracts | Analyse and propose only | Line-by-line acceptance + architect sign-off | **Escalation rule:** when the tier is unclear, treat it as the higher one. ## 6 · No-go paths (propose only, never modify)- `migrations/` · `infra/` · `src/generated/` · `vendor/`- `.env*` except `.env.example`, and anything matching `*secret*` ## 7 · Security posture- Production data SHALL NOT appear in any prompt. Use synthetic fixtures.- Every agent-suggested dependency SHALL pass composition and licence scanning.- Secret scanning SHALL run in pre-commit hooks. ## 8 · Definition of done- Lint, tests and build pass via the commands in §2.- New behaviour has tests a human has read and approved.- The diff touches only files named in the approved plan.- The spec reflects the behaviour that shipped. ## 9 · Sharp edges (append every hard-won surprise here)- <e.g. the ORM session is request-scoped; holding it across awaits deadlocks>- <e.g. `make test` requires Docker for the Postgres fixture>RELATED STANDARDS
⬢ Agentic AI SDLC
The governance framework this discipline operates within: review gates, autonomy tiers, accountability, and DORA metrics.
⎇ Version Control
The underlying mechanics: branching strategy, CI/CD, and release management.
▣ AI Agent Architecture
Applicable when the subject of the specification is itself an autonomous agent.