How to Use Spec-Driven Development With AI Coding Agents
TL;DR
- Write a full spec for multi-file features and for changes that cross a module or API boundary. Give small fixes a clear ticket with acceptance criteria.
- Keep the spec short and testable: goal, scope and non-goals, edge cases, acceptance tests, constraints and a list of what must not change.
- Load your rules files and standards into the agent’s session next to the spec, because a spec describes the feature and your standards describe how your team builds.
- OpenSpec moved to Trial on the November 2026 Thoughtworks Technology Radar after teams reported more predictable agent output, and practitioners in a Carnegie Mellon and Google study on arXiv, revised on 16 November 2026, used specs mainly for new features.
- Check every pull request (PR) against its spec with a reviewer that did not write the code. Qodo, the AI Code Review and Code Governance Platform, reads the spec linked in a pull request through its Spec Agent and reports each missing requirement with the spec section as evidence.
Coding agents changed which part of software work is scarce. Typing code is cheap now, and knowing what the code should do has become the expensive part.
Most tickets still carry only a sliver of that knowledge: the edge case the product manager mentioned in a meeting, the endpoint that must not change, the permission check everyone assumes. An agent fills each gap with a confident guess and opens a clean pull request that misses the point.
Spec-driven development answers that problem in two moves. Teams write the intent down before the agent starts, and they hold every pull request to that intent before it merges. The second move gets less attention, and the second move decides whether specs pay off.
Qodo reviews pull requests against linked specs for engineering teams every day. This guide draws on that work, on Qodo customer case studies, and on research and practitioner reports published in 2026. The guide covers five steps:
- Decide whether the change needs a spec.
- Write a short spec that an agent can follow and a reviewer can check.
- Give the agent the team’s standards along with the spec.
- Keep one home for each spec.
- Check every pull request against the spec with a reviewer that did not write the code.
Why AI Coding Agents Turned Specs Into a Daily Practice
Specs became a daily practice because agents moved the hard part of the work from writing code to deciding what the code should do. Writing behavior down first is an old idea, from specification by example to Given/When/Then scenarios, but writing a spec used to compete with the cost of writing the code itself. Agents removed that cost.
With agents writing the code, planning and technical design now take most of the time. Some engineering leaders have also moved peer review earlier, to the design and the spec handed to the agent, and let automation take the toil out of code review.
HiBob, the HR platform, saw the shift early. HiBob’s teams used Cursor, Claude and Notion to turn product requirements documents (PRDs) into working code, and output rose until pull requests piled up and “the bottleneck had moved from writing code to reviewing it”, according to the HiBob case study. The PRD had become the agent’s input, and review had become the place where the PRD was either honored or lost.
Itamar Friedman, Qodo’s co-founder and CEO, agrees that engineers should spend more of their time on what the software should do, and argues that how the software is built still needs an owner. In a post on X, Itamar Friedman wrote:
“Humans should increasingly own intent, architecture, standards, values, tradeoffs and goals. But the ‘how’ doesn’t disappear. It moves into the system.”
Itamar Friedman lists what that system holds: “skills, policies, architectural constraints, organizational memory, evaluations, tools, and the rules by which agents are allowed to act”. A spec carries the what for one feature, and standards, rules and codebase context carry the how. Spec-driven development works when both reach the agent before it writes and both are checked after it writes.
Where Spec-Driven Development Stands at the End of 2026
Spec-driven development is now common practice with established tools, and the evidence on what works has become more specific. Four developments from the second half of 2026 show where the practice stands:
- Adoption. Public GitHub repositories held 470,795 spec files across 73,030 projects, and in a sample of active, popular repositories OpenSpec and GitHub Spec Kit accounted for 85% of the tool adoptions, according to a Carnegie Mellon and Google study published on arXiv in August 2026 and revised on 16 November 2026.
- Tools. Kiro brought its requirements, design and task specs to VS Code as a native extension on 20 November 2026, according to the Kiro blog.
- Enterprise rollout. TUI has 1,800 developers using Kiro and runs hands-on Builder Days where teams learn its spec-driven workflow, according to an AWS press release published on 30 November 2026.
- Practitioner verdicts. OpenSpec moved from Assess to Trial on the November 2026 Thoughtworks Technology Radar, after several Thoughtworks teams reported “more predictable agent output and fewer unintended changes compared to bare prompting”, according to the Radar entry.
The same Radar edition put AI-driven documentation sprawl on Caution, warning that agents and spec tools generate Markdown at a pace teams cannot maintain, according to the Thoughtworks Technology Radar. Spec-driven development itself first appeared in Assess on the Radar a year earlier, in November 2025.
Teams now plan agent work in one of four ways, and the table compares them by how the spec is written and where an independent review fits:
| Approach | How the spec is written | Best for | Where independent review fits |
| Vibe coding (prompt only) | No spec. Intent lives in the prompt and the chat | Prototypes and throwaway scripts | Review can catch bugs but has no written intent to check requirements against |
| Plan mode | A plan written in the agent session before edits | Single-session changes in one area | The plan usually stays in the session, so the reviewer rarely sees it |
| Spec-first | A spec written before coding, often left behind once the feature ships | New features with clear requirements | Review checks the PR against the spec once, before merge |
| Spec-anchored | A persistent spec, with each change written as a delta against it | Long-lived features and services | Review checks each PR against the current spec, and the spec is updated after merge |
When a Spec Is Worth Writing
A spec is worth writing when a change is big enough that an agent can miss part of it. Practitioners in the Carnegie Mellon and Google study used spec-driven development selectively, mainly for new features, and commonly skipped it for small tasks, bugs and one-off scripts. One practitioner told the researchers, according to the arXiv paper:
“If you’re using [an SDD framework] for smaller changes, you’re going to have a bad time. It’s too verbose and produces too much overhead.”
The same practitioners reported more reliable agent behavior alongside higher planning and review costs. Four levels of planning cover most tickets:
- A plain prompt plus acceptance criteria, for one- or two-file fixes with an obvious path.
- Plan mode in the agent, such as Claude Code’s plan mode, for single-session work where a written plan before edits is enough. The plan usually stays in the session, so the plan rarely reaches the reviewer.
- A rules file (AGENTS.md, CLAUDE.md or Cursor rules), for standing standards that apply to every change.
- A full spec, for multi-file features, changes that cross a module, service or repository boundary, schema or public API changes, and work shared by more than one engineer or agent.
The decision graphic below turns the four levels into three questions a developer can answer from the ticket, so the choice takes seconds rather than a meeting.

A full spec has two readers: the agent that builds from it and the reviewer who checks the pull request against it.
How to Write a Spec an AI Coding Agent Follows and a Reviewer Can Check
A good spec is short, and every line in it can be marked met or not met, because the same lines become the reviewer’s checklist at the pull request. Seven parts are enough:
- A goal in one sentence.
- Scope and non-goals.
- Inputs and outputs.
- Data and contract changes.
- Edge cases and error behavior.
- Acceptance tests.
- Constraints (security, performance, compatibility), plus a short list of files and interfaces that must not change.
The graphic below pairs each of the seven parts with the question a reviewer asks about it at the pull request. A part with no matching review question is a part the reviewer cannot check.

Longer specs are not better specs. Agent instruction bloat sits under Caution on the November 2026 Thoughtworks Radar, which notes that agent instructions “become long, contradictory and stale” as rules accumulate, and recommends converting what you can into deterministic hooks or checks, according to the Radar entry. Keep one short spec per feature and prune the spec when the feature ships.
Wei-Wei Wu, co-founder and CEO of Momentic, argues that tests are turning into executable product specs written in plain English, in his episode of The Agentic Review podcast from October 2026. Acceptance tests written that way can be read by a product manager and checked by a machine, the standard every line of a spec should meet.
Give the Agent the Team’s Standards Along With the Spec
A spec describes the feature, and the team’s standards and existing codebase decide whether the implementation fits. An agent that reads only the spec rebuilds helpers that already exist or breaks a convention nobody wrote into the spec.
Models that write tech plans and specs do not know company standards, so teams want a warning when, for example, an architecture doc leaves out retry logic. Writing standards down does not guarantee the agent follows them: only 34.6% of surveyed developers say coding agents always follow organizational standards, according to the Qodo State of AI Code Quality 2026.
A practical split is to keep a short list of expensive-to-fix rules (architecture, security, forbidden patterns) in the implementing agent and let a separate review agent enforce the full standards before the PR opens.
Qodo’s Get Rules skill gives the coding agent the team’s rules before it writes, and Rule enforcement checks the same rules in PR review. Codebase context comes from Qodo’s context engine, described in the context engine guide. Teams want the same codebase context while writing specs and planning, and again at review.
Keep One Home for Each Spec
A spec needs one home, because a spec the agent reads in one place and the reviewer reads in another soon becomes two different specs. Teams use two common homes:
- Files in the repo, versioned with the code. Spec Kit, Kiro and OpenSpec all store specs this way.
- Confluence, Notion and the ticket, where product and engineering already agree requirements, with the PR or ticket linking to the page.
Many teams now keep tech plans as Markdown in source control while requirements stay in the wiki, and ticket detail varies widely between teams. OpenSpec’s spec-anchored workflow treats each change as a delta against a persistent spec, though keeping that spec current “still requires discipline”, according to the Thoughtworks Technology Radar.
Pick one home per feature, link the spec from the ticket and the PR, and update the spec when the code changes the plan.
What Breaks When Nobody Independent Checks the Spec
Without an independent check, the merged code drifts from the spec and nobody notices until users do. Practitioners in the Carnegie Mellon and Google study described checking specs against code mainly when a change was completed rather than over time, and the researchers found that implementation detail may help agents while making specs prone to decay, according to the arXiv paper.
13.2% of surveyed developers picked understanding whether code matches its intent as their greatest AI code review challenge, according to the Qodo State of AI Code Quality 2026. Only 6.6% of developers trust AI output for important work decisions, according to the Stack Overflow Developer Survey 2026 published in October 2026.
The check inside most spec workflows runs in the same agent session that wrote the code. Itamar Friedman explains why that check falls short in an article on X:
When the same context or agent setup that built a change asks “what might break?”, that is “useful reflection. But it is not true independence. The implementation and the critique are downstream of many of the same assumptions.”
Wei-Wei Wu makes the same point about tests: “I wouldn’t trust that same AI to write its own tests,” he said on The Agentic Review podcast.
A missed review finding can stay in production for days. At HiBob, a shipped change broke one of the app’s most-used flows, and because a mobile fix waits on app store approval, the bug stayed live for ten days. The team later found that Qodo had flagged the error before shipping and the human reviewers had missed the feedback.
“This was a turning point. We realized we needed to do things differently,” said Ofer Morag Brin, Head of Mobile at HiBob, in the HiBob case study.
HiBob then required PR authors to tick a box confirming they had addressed Qodo’s comments before a second human reviewer was assigned.
Specs also span more than one pull request. “A coding agent takes a task and returns a work-package: pull requests spanning multiple components and even across several repositories,” Itamar Friedman wrote in What Every Software Factory Needs That No Model Will Provide. When those pull requests are reviewed one at a time, an acceptance criterion can fall between them while each one passes review alone.
How Qodo Enforces the Spec at Review Stage
Qodo checks the pull request against the spec with a reviewer that did not write the code. At the pull request, Qodo reads the spec, the diff and the team’s rules together, and the launch post on how Qodo uses linked specs to catch missing requirements covers the details.
“The system that generates code should not be the system that decides whether it ships,” Itamar Friedman wrote in the same software factory post.
The Spec Agent reads the Confluence or Notion spec linked in the PR description, or a Confluence page one hop through the linked Jira or Linear ticket, and runs whenever the PR is opened or updated. Each 📎 requirement gap appears in the same review comment as bugs and rule violations, with four parts:
- What is missing.
- The lines in the diff.
- The spec section used as evidence.
- A prompt the coding agent can run to fix the gap.
Gaps appear only when the Spec Agent finds documentation relevant to the change. Ticket context analysis (on by default) judges whether the change does what the ticket asked for, and unrelated-change detection, off by default, compares the PR with the ticket. Rule violations from the team’s rules arrive in the same review, so requirement fit, code quality and standards are judged in one pass.
Before the pull request, the Reviewer skill in Qodo’s Agentic Toolbox runs the same review engine on local changes inside Claude Code, Codex or Kiro, and accepts the ticket, spec or design links behind the change as session context. For work an agent splits across pull requests, Agent Session Review reviews the related pull requests as one work package in a browser-based view, with a narrative of requirements, behavior changes and risks.
How to Write a Spec for a Multi-File API Change, Step by Step
The walkthrough below shows how to write a spec for a change that touches several parts of a codebase, hand the spec to a coding agent, and have every requirement checked before the pull request merges. By the end, you will have a spec linked to the ticket and the PR, and a review that reports any requirement the code missed.
The flow diagram below shows the full loop the walkthrough follows, from the written spec to the merged PR and back to an updated spec. The review step sits outside the agent, which is the step most spec workflows skip.

The example is a hypothetical one that many teams will recognise. A team wants customers to update many records in one request instead of one at a time, so the team adds a bulk update endpoint to its customer API. The change touches four parts of the code: the API handler, the input validation, the check that the user belongs to the account that owns each record, and the service that writes the updates.
If the agent skips the validation, one malformed record can fail the whole request or write bad data. If the agent skips the account check, a user could update another company’s customer records. Neither mistake shows up when the agent tests the happy path, so the spec has to state both before any code is written.
Write the Spec Before the Agent Starts
Write the spec in Confluence or Notion using the seven parts above, and link the spec from the Jira or Linear ticket. For the bulk update example, the spec fits on one screen:
Goal: Support updating up to 500 customer records in one request. Non-goals: No change to single-record updates. No new permissions model. Acceptance: - A request with 1 to 500 valid records updates all of them and returns a count. - A request with more than 500 records returns a 400 error and changes nothing. - A record that fails validation is reported by id, and the other records still update. Constraint: Every request verifies that the user belongs to the owning account. Must not change: the public single-record endpoint and the audit log format.
Each line maps to a check at review. The table shows what the reviewer checks for each line of the bulk update spec, and what the review reports when the code misses it:
| Spec line | What the reviewer checks | What the review reports if the code misses it |
| Goal: up to 500 records in one request | The new endpoint accepts a list and updates every valid record | A requirement gap against the goal |
| Non-goals: single-record updates and permissions model unchanged | The diff leaves the single-record path and permission code alone | An unrelated change outside the spec’s scope |
| Acceptance: 1 to 500 valid records return a count | A test or code path covers the success case and returns the count | A requirement gap for the missing acceptance test |
| Acceptance: more than 500 records return a 400 and change nothing | The size check runs before any write | A requirement gap, because a partial write breaks the acceptance line |
| Acceptance: invalid records reported by id while others update | Validation runs per record and collects errors by id | A requirement gap, since one bad record must not fail the whole request |
| Constraint: user belongs to the owning account | Every record is checked against the user’s account | A broken constraint, the bug that would let one customer edit another’s data |
| Must not change: single-record endpoint and audit log format | Neither file changes in the diff | A violation of the must-not-change list |
Build, Review and Merge Against the Spec
With the spec written, five steps take the change from the agent’s first edit to a merged pull request:
- Connect Confluence or Notion to Qodo once (a Confluence administrator can do this). In the Qodo portal, go to Integrations > Documentation & Design, click + Add connection under Confluence (or Notion) and sign in. A Git provider must already be connected to Qodo.
- Point the agent at the spec, and load the team’s rules with Get Rules in Claude Code, Codex or Kiro before the agent writes any code.
- Ask the agent to run Qodo’s Reviewer skill on the diff with the ticket and spec links as session context, then fix the findings. Setup is in the Reviewer skill guide.
- Open the PR with the spec link in the description, and turn on Spec gaps under Configurations > Finding types in the Qodo portal. Each missed requirement then appears in the review, as described in requirement gaps in findings.
- If the agent split the feature across several PRs, run Agent Session Review to check the whole package against the spec, and after the merge, update the spec wherever the code changed the plan.
Teams that configure Qodo through .pr_agent.toml can use enable_spec_agent under [review_agent], which defaults to true, and the portal toggle can read as off until you touch it. One spec and one design document apply per PR. Qodo reports findings on the PR, and your branch rules and continuous integration (CI) checks decide what merges.
Conclusion: Make the Spec the Contract Every Pull Request Is Checked Against
Spec-driven development pays off only when the pull request is checked against the spec, and Qodo is the reviewer to run that check. Qodo reads the spec linked to the PR, reviews the change with an engine that did not write it, applies the team’s rules in the same pass and reports every missed requirement with the spec section as evidence.
Start with the next ticket that touches three or more files or a public API. Write a seven-part spec, give the agent your rules along with the spec, run Qodo’s local review before the PR, then link the spec in the PR description and turn on spec gap findings.
Wei-Wei Wu’s advice for engineering leaders fits here too: give every PR “a definition of done section”, stating how the change was verified, as he said on The Agentic Review podcast. Teams that adopt in that order, starting with a local review, then bringing standards and codebase context into planning and specs, then running the same checks across the pipeline, build the habit before they scale it.
Engineering teams are building toward the software factory, where AI agents plan, build and ship code. Qodo is the quality and governance layer under every station of the factory.
In 2027, we expect spec-driven development to stop being a framework choice and become the default way agent work is planned and reviewed. Agents will draft more of their own plans and specs, which raises the stakes on whether those specs match what the business asked for.
Specs will live in the tickets, wikis and repos teams already use, and review will judge requirement fit alongside bugs and standards on every pull request, with multi-PR agent sessions reviewed as one unit of work. Teams that link specs to pull requests and check them with Qodo now will have the rules, the history and the habits in place when that becomes the norm.
FAQ: Spec-Driven Development With AI Coding Agents
The questions below cover what readers most often ask about spec-driven development with AI coding agents.
What is spec-driven development?
Spec-driven development is a way of working where a team writes a structured spec, with requirements, constraints and acceptance criteria, before an AI coding agent generates code. Qodo closes the loop by checking each pull request against the linked spec and reporting every requirement the code missed.
Does every ticket need a spec?
Not every ticket needs a spec: tickets that touch three or more files, cross a module or API boundary, or are shared across engineers or agents are worth one, and small fixes work with a clear ticket and acceptance criteria. Qodo’s ticket context analysis checks both kinds of change against what the ticket asked for.
What goes in a spec for an AI coding agent?
A spec for an AI coding agent holds a goal, scope and non-goals, inputs and outputs, contract changes, edge cases, acceptance tests, and a list of constraints and files that must not change. Each line should be checkable as met or not met, so Qodo can report the lines a pull request misses.
How do you check that the code matches the spec?
You check that the code matches the spec with a reviewer that did not write the code. Qodo’s Spec Agent compares a PR with the Confluence or Notion spec linked in its description, or reached through the linked ticket, and reports each missing requirement as a finding with the spec section as evidence.
Which spec sources does Qodo read?
Qodo reads specs from Confluence and Notion pages and requirements from the linked Jira or Linear ticket, and one spec and one design document apply per PR. A spec that starts as a repo file works the same way once you publish it to Confluence or Notion, and Qodo’s Reviewer skill also accepts a spec link as session context in local review.
What is the difference between a plan, a rules file and a spec?
A plan guides one agent session, a rules file holds standing standards for every change, and a spec describes one feature in checkable terms. Qodo brings the rules and the spec together at review, so each pull request is checked against both.