Spec-driven development (also called specification-driven development) is a software workflow in which a structured, written specification is created and reviewed first, and AI coding agents then generate the design, task plan and code from it. Within AI for coding, it is a deliberate response to the weaknesses of unstructured prompting, where intent lives only in a chat history and is easily lost.
The specification becomes the primary, versioned artifact. When requirements change, the team edits the spec and regenerates or updates the affected code, instead of patching code directly and letting the documentation drift. The approach draws on older ideas such as requirements engineering and behavior-driven development, but its tooling is built around large language model agents.
How spec-driven development structures the work
Spec-driven development splits a feature into explicit phases with human review gates. Each phase produces a document that the next phase consumes, so the agent always works from a reviewed, stable input rather than from a single long prompt.
The typical sequence moves from intent to implementation in four steps, summarized in the table below.
| Phase | Artifact produced | Human role |
|---|---|---|
| Specify | Requirements with user stories and acceptance criteria | Confirms scope and edge cases |
| Design | Technical plan: architecture, data model, interfaces | Approves technology and constraints |
| Plan tasks | Ordered, small tasks linked to requirements | Checks size and sequence |
| Implement | Code, tests and updated documentation | Reviews diffs and test results |
Acceptance criteria are often written in a structured notation such as EARS (Easy Approach to Requirements Syntax) or Given-When-Then scenarios. A clause like “When the user submits an expired token, the system shall return status 401” is testable and unambiguous, which helps the agent generate matching tests.
What a good specification contains
A useful spec is precise about behavior and silent about implementation details that do not matter to the requirement. It states what must be true when the feature is done, which constraints apply, and what is explicitly out of scope.
| Part | Purpose | Common mistake |
|---|---|---|
| Problem statement | Explains why the feature exists | Describing a solution instead of a need |
| User stories | Name actors and goals | Stories too large to test |
| Acceptance criteria | Define verifiable outcomes | Vague words such as fast or simple |
| Non-functional requirements | Performance, security, accessibility | Omitted entirely |
| Out of scope | Prevents feature creep by the agent | Left implicit |
Teams usually keep project-wide conventions in a separate project rules file or AGENTS.md, sometimes called a constitution or steering file. The feature spec then references these rules instead of repeating them, which keeps each specification short and focused.
Spec-driven development compared with other AI coding styles
The main contrast is with vibe coding, where a developer iterates through conversational prompts and accepts code by feel. Both use the same agents, but they differ in where intent is recorded and how correctness is judged.
| Style | Source of truth | Best fit |
|---|---|---|
| Vibe coding | Chat history and running code | Prototypes and throwaway experiments |
| AI pair programming | Code edited together in the IDE | Incremental changes to known code |
| Agentic coding without specs | Task description in a prompt | Small, well-bounded tickets |
| Spec-driven development | Reviewed specification documents | Features with many requirements or several contributors |
Spec-driven development is not a return to waterfall. Specs are written per feature, kept small, and revised continuously; the cycle from spec to working code often takes hours rather than months.
Tools and adoption in practice
Several tools now support the workflow directly. Kiro, an agentic IDE, generates requirements, design and task files and tracks task completion. Open-source toolkits such as GitHub Spec Kit provide templates and commands that work with multiple coding agents, and many teams achieve the same effect with plain Markdown files and an agent like Aider, Cline or Claude Code.
Adoption works best when specs live in the repository next to the code, are reviewed in pull requests like any other change, and are linked to tests. A spec that is not versioned and reviewed quickly becomes another stale document.
Granularity also matters. Tasks derived from a spec should be small enough for one agent session, typically a change that touches a few files and can be verified by its own tests. Each task should cite the requirement identifiers it satisfies, so reviewers can trace any line of code back to a stated need. This traceability between requirements, tasks and tests is what lets a team regenerate or refactor code later without losing intent, and it gives new contributors a reliable map of why the system behaves as it does.
Benefits, limits and common pitfalls
The main benefit is reduced ambiguity for the agent, which lowers the rate of plausible but wrong code and makes reviews faster because reviewers check against written criteria. Specs also preserve design rationale for future maintainers and for later agent sessions that lack earlier context.
| Pitfall | Consequence | Remedy |
|---|---|---|
| Over-specification | Slow start, agent copies irrelevant detail | Specify behavior, not code structure |
| Spec drift | Code and spec disagree after hotfixes | Update the spec in the same pull request |
| Untestable criteria | No objective way to accept work | Rewrite criteria as checkable statements |
| Skipped review gates | Errors propagate into design and code | Require approval before each phase |
The approach adds upfront overhead that is not justified for a one-line fix or a quick experiment. Agents can also still misread a correct spec, so automated tests and human code review remain necessary.
In everyday language
Imagine hiring a builder. You could describe the house while they work, changing your mind each day. Or you could agree on a drawing first. Spec-driven development is the drawing-first approach for software built with AI.
You write down what the program must do and how you will check it. A person reviews that plan. Then the AI writes the code from it. If something changes, you change the plan first. This keeps everyone, including the AI, working toward the same result.
Seen in the real world
A five-person team at a logistics company needs a refund feature for its customer portal. Earlier attempts with free-form prompts produced code that handled full refunds but ignored partial refunds and currency rounding. This time the product owner writes a two-page specification with twelve acceptance criteria, including the rule that refunds above 500 euros require a second approval.
An engineer reviews the spec, asks the agent to produce a design and a list of nine tasks, and approves both. The agent implements the tasks one by one, generating tests for each criterion. Review takes about an hour because reviewers check the diff against the written criteria. The feature ships in three days, and when finance later changes the approval limit, the team edits one line of the spec and lets the agent update the code and tests.