Sebastian Mattar Blog Feed

Spec-Driven Development: What It Is, What It Gives You, What It Costs

The problem

A coding agent builds only as well as it understands what it is supposed to build. In a chat, that understanding forms along the way, through follow-up questions, corrections and unspoken assumptions. When the chat history goes, so does the understanding.

Then the next session, another agent or a colleague starts from scratch. Nobody can check later whether the result matches what was meant, because what was meant is not written down anywhere.

The process also depends on the person at the keyboard. For every task they have to remember to let the agent plan first, to resolve open questions, to ask for tests and to check the result against the requirement. If they forget a step, nobody notices, and everyone on the team works differently.

Spec-Driven Development reverses the order: first the intent is written down and reviewed, then the agent implements it.

What Spec-Driven Development is

A versioned specification in the repository steers what the agent builds. It describes behaviour and verifiable acceptance criteria; what the code looks like is left to the implementation. The process is almost always the same:

  1. Specify: What should the system do, for whom, and how do you know it is finished?
  2. Plan: How will it be implemented? Architecture, affected components, risks.
  3. Break down: Tasks of a size an agent can complete cleanly in one step.
  4. Implement: The agent works through the tasks.
  5. Verify: Tests and review against the acceptance criteria.

What matters is what happens to the spec after implementation. That gives three levels:

Level What happens to the spec Consequence
spec-first It starts the work and is no longer maintained afterwards. Useful mainly for planning; after that it goes stale.
spec-anchored It is maintained along with the code. Permanently describes what the system does.
spec-as-source The code is generated from it and no longer edited by hand. Barely practical so far.

How it differs from process frameworks. Some tools also work with plans, but their focus is on workflow, test discipline or context management. The plan there serves the implementation and is not carried forward afterwards.

How it differs from tickets. A ticket with acceptance criteria is already a small spec, but it does not replace the spec in the repository. It lives outside the code, is written in business terms and is rarely precise enough for an agent. A division of labour has proved itself: the ticket holds the what and the why, the spec holds the how and the verifiable details, and the two link to each other.

What it gives you

All the benefits trace back to the same point: the intent sits in the repository, permanently and verifiably.

  1. Review intent before code. Misunderstandings surface while a changed sentence can still fix them. People review intent and scope instead of generated code.
  2. "Done" is defined. Verifiable acceptance criteria give the agent, the tests and the reviewers the same target.
  3. Context that lasts. A spec in the repository outlives sessions, aborted runs and changes of agent, model or person.
  4. Tasks sized for agents. Agents deliver better results on small, clearly bounded steps.
  5. A fixed process instead of self-discipline. Specifying, planning, reviewing and testing are prescribed steps. Nobody has to prompt the agent to do them every time, and the team works the same way.
  6. Uniform templates. Specs, plans and task lists follow the same templates for every change. Reviewers find their way around faster, missing information stands out at once, and agents process every document the same way.
  7. Visibility of what is being built. Specs and changes show what is planned, in progress and done, without anyone having to read the code. This matters more the more code agents write.
  8. Shared understanding. The spec is the contract between the business side, development and the agent, versioned and reviewable like code.
  9. Connection to the existing process. Tickets with acceptance criteria become the input for the agent; epics, features and stories from SAFe or Scrum remain the frame around it.
  10. Traceability. Why something was built the way it was stays in the repository and survives every chat.

What it costs

It gets expensive where the spec creates more work than the errors it prevents.

  1. Ceremony. Specifying, planning and breaking down take time, even for changes an agent would get right straight away.
  2. Review load. Agents produce specs, plans and task lists faster than people can read them. Anyone who only nods them through gains nothing except a feeling of control.
  3. Drift. A spec nobody maintains after implementation goes stale, and is then worse than none, because it misleads both agent and human.
  4. Tokens and runtime. More artefacts and more steps mean more context and more model calls per change.
  5. Dependence on tools. Most frameworks are less than a year old and change weekly. Specs in proprietary formats or tools make leaving expensive.
  6. Duplicate maintenance. If requirements also live in the ticket system, the same content risks sitting in two places that drift apart.
  7. Agents are catching up. Much of what frameworks enforce today (planning, tracking tasks, launching subagents), current agents increasingly do on their own. A framework's lead can shrink with every model release.

When it pays off and when it doesn't

Spec-Driven Development pays off when a misunderstanding costs more than writing things down.

Situation Worth a spec? Why
Feature across several files or components yes Otherwise misunderstandings only show up in review
Change to existing code with external dependencies yes The spec records what must not change
Several people or teams on the same code yes A shared state instead of scattered chats
Work that spans several sessions yes The context survives interruptions and handovers
Regulated environment with evidence requirements yes Requirement, implementation and test are linked
Bugfix with a clear cause, typo, rename no One sentence to the agent is enough
Exploratory prototyping no The intent isn't settled yet; it emerges while building
Specs nobody reads or maintains no Cost without benefit, and drift later

The line is rarely set by the tool, and usually by the size of the change. A workable process therefore scales down: small changes without ceremony, larger ones with a spec.

Practice before tooling

The benefits come from the practice, not the tool. Getting started without a framework takes only a few rules:

  1. Project rules in AGENTS.md: architecture, conventions, how testing works.
  2. One spec per feature as Markdown in the repository, with verifiable acceptance criteria and a link to the ticket.
  3. The agent's plan mode for planning and breaking down; the task list sits in a file next to the spec.
  4. One commit per task. Git is then the state of the work, and a new session resuming it checks git status, the log and the tests instead of trusting the checkboxes.
  5. After implementation, align the spec with the code, in the same pull request.

A framework pays off when it enforces this practice more cheaply than the team's discipline alone: fixed templates, commands, checkpoints, a spec that is updated automatically. In return it costs onboarding and dependence on a fast-changing project. Whether it delivers more than these rules can only be shown by comparing the same tasks with and without the framework.

Conclusion

Spec-Driven Development pays off because it makes intent permanent and verifiable. It costs ceremony and maintenance, and a spec nobody maintains does more harm than good. Being pragmatic means: start with a few rules and no framework, write specs only for changes where a misunderstanding would be expensive, and adopt a framework only once it measurably delivers more.