Free playbook: A practical operating model for AI across the SDLC
Blog/Living Specifications: Keeping the Plan True After Code Ships

Living Specifications: Keeping the Plan True After Code Ships

A living specification tracks what the system actually does, not what the original plan said. When agents ship code faster than anyone reads it, keeping that spec current is how intent survives contact with production.

Living specification diagram: a static spec drifts from code while a living spec stays true through a write-back loop

A living specification is a spec that keeps describing what the system actually does, not what someone planned for it to do six months ago. The idea is old, but it has a new urgency: when AI coding agents ship code faster than any human reads it, the gap between the approved plan and the running system opens in days instead of quarters. A spec written once and never touched again is a snapshot of an intention. A living specification is a record of reality, and that difference decides whether the document is worth trusting the next time someone has to change the code.

Most teams already know the failure. The spec that justified a feature is accurate the week it ships and quietly wrong a month later, after three follow-up changes nobody updated it for. The README says one thing, the code does another, and the new engineer learns to trust neither. This is not a discipline problem you can scold your way out of. It is a structural one: a static document and a changing system drift apart by default, and the force pulling them apart gets stronger the faster the system changes.

What is a living specification?

A living specification is a spec maintained as a continuous record of a system's current behavior, updated as the code changes rather than frozen at approval. Instead of capturing intent once and decaying, it absorbs each implementation decision back into the document, so the spec and the code describe the same system. It stays true because keeping it current is part of shipping, not an afterthought.

Key Takeaways

  • A living specification tracks reality, not the original plan. Its value is that it stays accurate after the code changes. A spec that is only correct on the day it ships is a historical artifact, not a working document.
  • Drift is the default, not the exception. A static document and a changing system move apart unless something actively pulls them back together. Faster change, including AI-generated change, widens the gap faster.
  • The write-back loop is the mechanism. A spec stays living only if implementation decisions are written back into it as part of merging. No loop, no life.
  • Executable specs resist drift best. When the specification runs against the code, as with behavior tests, divergence shows up as a failure instead of hiding in stale prose.
  • AI agents make this non-optional. Agents generate large diffs from a point-in-time context and move on. Without a living spec to ground them, every agent re-derives intent from a system that has already drifted.

Why specs drift the moment the code ships

The reason specs go stale is mechanical, not moral. A specification is a description written at a point in time. The code it describes keeps moving. Every bug fix, every follow-up ticket, every performance tweak changes the system a little, and almost none of those changes route back through the original document. After enough small edits, the spec describes a system that no longer exists.

Three forces accelerate the drift, and all three are stronger in an agent-assisted codebase:

  • Change is cheaper than documentation. It has always been faster to edit code than to update the doc that explains it, so the doc loses. AI coding agents widen that gap enormously: a prompt can rewrite four files in a minute, and the specification that justified the original design is not in the agent's output at all.
  • Intent lives somewhere the spec cannot see. The reason behind a change often lives in a pull request comment, a Slack thread, or a prompt typed into an agent and never saved. The what lands in the repo; the why evaporates. A spec that is not fed that reasoning cannot stay current with it.
  • Nothing fails when the spec is wrong. Tests go green whether or not the specification matches the code, because tests check the code against itself. A stale spec produces no error, no alert, no broken build. It just silently misleads the next person who reads it. This is the same dynamic behind spec drift across multiple agents, where the running system diverges from approved intent without anything visibly breaking.
flowchart LR A["Approved\nspec"]:::accent --> B["Code\nships"]:::accent B --> S{"Static or\nliving?"}:::gate S -->|Static: no loop| D["Spec frozen,\ncode changes"]:::metric D --> X["Drift:\nspec is wrong"]:::metric S -->|Living: write-back| L["Decision written\nback to spec"]:::accent L --> T["Spec and code\nstay aligned"]:::accent T --> B classDef accent fill:#fdf6f8,stroke:#853953,color:#853953 classDef gate fill:#ffffff,stroke:#1A1A1A,color:#1A1A1A classDef metric fill:#f4f4f5,stroke:#717171,color:#555555

Workflow summary: An approved spec leads to shipped code. From there the path forks. On the static path there is no loop back to the document, so as the code keeps changing the spec stays frozen and drift sets in until the spec is simply wrong. On the living path, each implementation decision is written back into the spec as part of shipping, keeping the spec and the code aligned, and that updated spec feeds the next change instead of a stale one.


Living documentation is the older name for the same idea

This is not a new invention, and the earlier framing is worth borrowing. In the behavior-driven development world (BDD, an approach that describes system behavior in plain-language examples before writing code), the term is living documentation: specifications written as concrete examples that run against the system. Gojko Adzic's Specification by Example popularized the term, arguing that a complete set of examples, kept executable, becomes documentation that cannot silently rot because it is checked against the code on every run.

Tools like Cucumber put this into practice with Gherkin (a Given/When/Then syntax for writing those executable examples). As Cucumber's own writing on living documentation puts it, the alternative to living documentation is confusion: each scenario runs against the code and shows green or red, so a specification that no longer matches behavior announces itself as a failing test rather than hiding as stale prose.

The lesson carries directly into agentic development. The reason executable specs stay alive is that drift has a consequence. When the spec is just a document, nothing forces it back into agreement with the code. When the spec runs, divergence breaks a build. A living spec does not have to be fully executable to work, but it has to borrow that principle: there must be a moment, built into the workflow, where the spec and the reality are forced to meet.


How to keep a specification living: the write-back loop

Keeping specs current comes down to one habit, enforced structurally: every change that alters behavior writes its decision back into the spec before it merges. That is the whole mechanism. Everything else is making that loop cheap enough that people actually run it.

1. Treat the spec as the contract, and track changes against it

Separate the stable description of what must be true from the in-flight work changing it. The specification is the current contract; a change record captures the diff and the reason. This keeps the spec readable as a single source of truth while preserving the history of how it got there, rather than letting every edit muddy the document.

2. Make the "why" a required field, not a nicety

Spec maintenance fails most often because the reasoning behind a change never gets captured. Borrow the discipline of architecture decision records (ADRs, short notes that record a decision, its context, and its consequences, popularized by Martin Fowler and Michael Nygard). When a change contradicts the existing spec, the contradiction is the trigger to record why, and that note becomes part of the living document.

3. Tie the update to the merge, not to good intentions

A loop that depends on someone remembering to update the doc later will not hold. The update has to sit on the critical path of shipping: the pull request that changes behavior is not complete until the specification reflects the new behavior. If updating the spec is optional, it is already dead. The difference between a spec and a PRD here matters: a PRD is written once to justify building something, while a living spec is maintained for the life of the system.

4. Ground the spec in the real codebase, not a parallel document

A spec that lives in a wiki disconnected from the code drifts fastest, because nothing links the two. The closer the specification sits to the system it describes, the smaller the gap it has to cross to stay current. This is exactly where a planning layer earns its keep: Enact grounds the approved plan in the live codebase and keeps execution reporting back into it, so the plan stays true as agents work instead of freezing at the moment of approval.

5. Let agents read the current spec, not a stale one

When a coding agent is handed the same spec across repos or sessions, the spec it reads is the ground it builds on. If that document is stale, every agent compounds the drift. A living spec, served to agents through something like an MCP server (Model Context Protocol, a standard way to feed tools and context to AI agents), means each agent starts from reality rather than from a six-month-old plan.


Living specification failure modes

The ways a living spec dies are predictable. Most of them are the loop quietly breaking, not a dramatic collapse.

Failure mode What it looks like What keeps the spec living
The optional update Spec updates are "nice to have," so under deadline they are skipped. Put the spec update on the critical path of the merge, not after it.
The parallel doc The spec lives in a wiki with no link to the code; the two drift freely. Ground the spec next to the code it describes, so the gap is small.
The missing why The spec records what changed but never why, so the next change repeats old mistakes. Make the reasoning a required field, captured as a decision record.
The agent snapshot An agent reads the plan once, ships a large diff, and never writes anything back. Close the loop: execution reports back into the plan as work completes.
The silent pass The spec is wrong but nothing breaks, because tests check code against code. Add a point where spec and behavior are forced to meet, ideally executable.
The frozen approval The spec is locked at sign-off and treated as done, while the system moves on. Treat approval as a baseline to maintain, not a finish line.

For a regulated team, the bottom two rows are not just hygiene. A specification that stays true is also the evidence of what was approved versus what shipped, which is why keeping specs current pairs naturally with an audit trail for AI-generated code.


The living specification checklist

Run this against any spec you want to stay true after the code ships:

  1. There is a write-back loop: behavior changes update the specification as part of merging, not as a later chore.
  2. The spec is the contract, changes are tracked separately: the current state is readable on its own, with history preserved.
  3. The why is captured: every change that contradicts the spec records its reasoning as a decision record.
  4. The update is on the critical path: a pull request is not done until the spec reflects the new behavior.
  5. The spec is grounded in the code: it sits close to the system, not in a disconnected wiki.
  6. Agents read the live spec: every agent starts from the current plan, and execution reports back into it.

Before committing to the discipline, it helps to quantify what drift actually costs when it ships. The rework cost calculator turns "the spec was wrong and we built the wrong thing twice" into the number that justifies maintaining the loop.


A spec is a verb, not a noun

The quiet mistake is treating a specification as a thing you produce, approve, and file. In a system that changes every day, and changes faster now that agents are writing much of the diff, a filed spec is a decaying asset from the moment it is signed. A living specification is not a better document. It is a different relationship with the document: one where keeping it true is part of the work, every change feeds it, and its accuracy is something the team maintains rather than hopes for.

The teams that stay fast without losing the plot are not the ones with the most detailed specs. They are the ones whose specs are still true after the hundredth change, because the loop that keeps them current was built into how work ships. Keeping that approved plan true from product intent through to what agents actually build, as the code moves, is what Enact was built to do.

Keep the plan true after the code ships

Watch how Enact grounds the approved plan in your live codebase and keeps execution reporting back into it, so the specification stays accurate as agents build instead of drifting from day one.

Watch the demo →

Frequently Asked Questions