Extreme AI Programming · Chapter 9

The Spec Is Not a Document

AI-native teams at Level 3 can complete one to three specs a day per person. That is an extraordinary pace, and unsustainable without a harness around the agents. With one, each unit is specified, built, and verified week after week, on a codebase the team can still reason about.

Historically, specifications took the form of static documents, an RFC or a Confluence page, followed by an extensive comment thread. Because developers participated in planning sessions and could rely on memory to fill gaps, few team members examined those documents in detail. That approach worked when human developers built the feature, but an agent has no memory of the room.

So the specification has had to become something other than a document. It has become a database.

This transition carries far greater weight than it seems on the surface. While a traditional document presents unstructured prose organised by headings, forcing an AI agent to ingest the entire text, attempt to interpret it, and react unpredictably, a database operates on clear structural principles. In a database model, records have explicit types, statuses, and relationships. Targeted queries yield the precise slice of data required, whether an engineer reviews the specification or an agent retrieves resolved decisions for an assigned task. As a result, the specification evolves from a passive narrative into a dynamic, structured foundation that directly drives execution.

Six things, not one document

The structure contains six distinct kinds of record, each with its own life.

The narrative is what is being built, and why: ordered prose covering overview, design, architecture, risks. It is the closest thing to a traditional spec, and now it's one part among six rather than the whole.

The decisions are every non-obvious choice the build depends on, each written as its own record with its own handle. Should the cursor encode an offset or an opaque token? Should we soft-delete or hard-delete? Each is a record with options, rationale, the chosen path, and the reasons the others lost. They are addressable: a human or an agent can refer to a specific decision, and both know exactly what is meant. When an agent encounters a decision the spec didn't anticipate, it doesn't invent. It writes a candidate decision for human review.

The acceptance criteria are observable, testable conditions. A returning user with an expired session sees the sign-in page, not an error. That sentence is a test waiting to be linked back to it, and its status is not self-reported. It is derived from CI.

The tasks are a directed graph of the work, not a flat backlog. Each task has a goal, the criteria it satisfies, and explicit dependencies on other tasks and resolved decisions. The agent asks which tasks are ready, and the structure returns only the ones with no open blockers. No manual triage; the graph knows what is unblocked.

The issues are what the agent writes when it hits something it cannot resolve mid-build, instead of burying the problem in a transcript nobody will read. An issue surfaces where a human can see it and promote it into a task with a verification criterion attached.

And the emit tokens, the least familiar of the six. An acceptance criterion does not know whether it is currently true until something tells it. Inside the test file, the agent tags the test with the criterion it proves. When the test runs in CI, the assertion library reads the tag and records that the criterion has just been verified, with a timestamp. The status (verified, failing, stale, or untested) is derived from the most recent run. Nobody updates anything by hand. The board on the spec page is what CI reported, current to the second.

Together, those six become a specification. The artefact is no longer prose. It is a graph the team and the agents read and write together, and it is what makes the cadence at the top of this chapter survivable.

Specify, build, verify

You start with the narrative, your goals and constraints. You run it past the system, and the system surfaces every implicit decision hiding inside it, each with options and trade-offs. The team works through them, choosing each path deliberately, and as decisions resolve, the criteria they imply are spawned, so each resolution comes with its proof attached. Humans comment and prompt; agents do the writing and the laborious linking. The division of labour matches the division of skill: the human carries the judgement, the agent carries the bookkeeping.

When the human is ready to move the spec forward, the system does not let it happen on a vibe. It runs a deterministic readiness check: are all decisions resolved, are the criteria well formed, are open comments cleared. If not, the move is refused, with reasons. The first time you run this on real work, you're surprised by how much of the argument that would have happened in code review has just happened in the spec instead. The hard conversations move three days earlier and cost less than they ever did. That alone is worth the discipline, even if the agent half of the work did not exist.

With proper structure, the build step becomes remarkably inexpensive. An agent simply queries for available tasks, claims one, and receives a tightly scoped payload: only the relevant narrative section, the constraining decisions, and the criteria that must be satisfied. Instead of ingesting the full document, it receives the knowledge graph slice needed for that task. The real innovation occurs when the agent encounters an unexpected obstacle, surfaces a new candidate decision, or logs an unpredicted difficulty as an issue. The agent then proceeds along safe paths while escalating unresolved issues. Consequently, upon completion, the spec is far from exhausted; it has fed it and now holds a contemporaneous record of how the work actually happened, something that every manual architecture-decision process I have managed consistently struggled to achieve.

Verify is where the bookend closes, and the closing is mechanical rather than ceremonial. Every criterion is tagged in code; every tagged test runs in CI and reports its status. Done stops being a judgement call by a tired engineer on a Friday and becomes a fact derived from the last run. Months later, when a change elsewhere breaks a criterion from this spec, the test fails on its own, and the criterion flips from verified to failing without anyone remembering to look. The protection lives in the system, and the system does not get tired.

The rituals from the chapter on ceremonies survive around it: tickets are still the pre-spec layer where ideas live, and the human-coordination ceremonies do not go anywhere. What changes is the artefact at the centre of the work, and the pace a team can hold once that artefact stops being a document. The middle is the easy part now. The work has moved to the brackets, and when they do their job, the brackets become a structure rather than a page. The Memex chapter covers what it takes to build that structure, and why we did.