Dev tools

Spec-Driven Development With AI Coding Agents

Spec-driven development: write a spec, plan and task list before an AI agent codes. How it works, a full example, GitHub Spec Kit, Kiro and Claude Code.

By OmniAI Editorial · Nov 20, 2026 · 16 min read

Spec-driven development is a way of building software with AI coding agents where you write a clear specification first, describing what the feature should do and why, then turn it into a technical plan and a list of small tasks, and only then let the agent write code, checking its work against the spec. The spec becomes the source of truth that keeps the agent on track, instead of a chat history of half-remembered prompts. It works best for features of medium size and up, where vague prompts lead to rework.

This guide explains what spec-driven development is, how it differs from vibe coding, TDD and waterfall, the step-by-step workflow, a complete spec-driven development example, tools such as GitHub Spec Kit and Kiro, spec-driven development with Claude Code, and when it's worth the extra effort.

What Is Spec-Driven Development?

In spec-driven development (SDD), the main thing you write and review is a specification, not a prompt. Birgitta Böckeler, writing on Martin Fowler's site, describes a spec as a structured, behaviour-oriented artefact written in natural language that describes software functionality and guides AI coding agents.

A spec usually covers:

  • The goal: what problem the feature solves and for whom.
  • User stories and requirements: what the system must do, in testable statements.
  • Acceptance criteria: how you'll know each requirement is met.
  • Constraints: performance, security, compatibility, things that must not change.
  • Out of scope: what this feature deliberately doesn't do.

From the spec, the agent (with your review) produces a technical plan, then a task list, then code. Each step is a document you can read, edit and keep in version control.

SDD is not a new idea. Writing requirements before code is decades old. What's new is that AI agents can turn a good spec into a plan and working code quickly, which makes the spec far more valuable, and a bad or missing spec far more costly.

Why Spec-Driven Development Took Off

AI coding agents are fast but literal. Given a one-line prompt, they fill gaps with guesses: an extra database table, a library you don't use, an API shape that doesn't match the rest of the app. In long sessions they also lose track of earlier decisions.

A written spec fixes several of these problems:

  • Fewer guesses: the agent sees the requirements, edge cases and constraints up front.
  • A stable reference: the spec survives across sessions, context resets and different agents.
  • Reviewable intent: a teammate can review a two-page spec far faster than 2,000 lines of generated code.
  • Better verification: acceptance criteria become tests and checklists the agent can run.

GitHub's open-source Spec Kit and Amazon's Kiro IDE, both launched in 2025, made the approach popular by building it into tools.

Spec-Driven Development vs Vibe Coding

Spec-driven development vs vibe coding is the most common comparison, because they sit at opposite ends of how much you plan:

Vibe codingSpec-driven development
Starting pointA prompt and a vibeA written spec with requirements
PlanningLittle or nonePlan and task list before code
Best forPrototypes, experiments, throwaway toolsProduction features, team work, larger changes
ReviewMostly by running the appSpec, plan, then code
RiskDrift, hidden bugs, messy codeMore upfront time; specs can go stale

They're not enemies. Many teams vibe code a quick prototype to learn what they want, then write a spec for the real version. Our guide to vibe coding covers the prototype side.

On the left a grey panel with a tangled ink scribble, then a dotted ink divider, and on the right a light panel with four boxes in a column, the first ticked with an orange check, the next two with ink checks and the last empty, each next to an ink line.
Vibe coding starts from a prompt; spec-driven development starts from a checklist of requirements.

Is Spec-Driven Development Just Waterfall?

No, though it borrows the good part of it. Waterfall wrote big specifications for whole systems, months before coding, and resisted change. Spec-driven development with AI works in small slices: one feature at a time, specs written in hours, and changes made by editing the spec and re-planning. The loop is short enough that you can still iterate.

It also differs from:

  • TDD (test-driven development): TDD writes tests before code. SDD writes requirements before tests and code; good specs produce acceptance criteria that become tests, so the two fit together.
  • BDD (behaviour-driven development): BDD's Given/When/Then scenarios are a natural format for SDD acceptance criteria.
  • Plan mode: many agents, including Claude Code, have a planning mode where the agent proposes a plan before editing. That's a lightweight form of SDD, but the plan usually lives only in the session. SDD keeps the spec and plan as files in the repository.

Three Levels of Spec-Driven Development

Böckeler describes three levels:

  1. Spec-first: you write a careful spec before coding a task, and use it to guide the agent. Afterwards, the spec may be discarded.
  2. Spec-anchored: the spec is kept and updated as the feature evolves, so it stays a useful reference for future changes.
  3. Spec-as-source: the spec is the main artefact; humans edit only the spec, and code is regenerated from it.

Most teams today work at the first or second level. Spec-as-source is experimental, partly because regenerating code from the same spec doesn't always give the same result.

The Spec-Driven Development Workflow

The tools differ in names, but the workflow is similar:

  1. Set project principles (once). Coding standards, testing rules, architecture choices and things to avoid. GitHub Spec Kit calls this a "constitution"; it's similar to what you might keep in AGENTS.md or CLAUDE.md.
  2. Specify. Describe what to build and why. Focus on behaviour, not implementation.
  3. Clarify. Have the agent ask questions about gaps and ambiguities, and fold the answers back into the spec.
  4. Plan. Choose the technical approach: stack, data model, APIs, components. The agent drafts; you review.
  5. Break into tasks. A dependency-ordered list of small, testable steps.
  6. Implement. The agent works through the tasks, ideally one at a time, running tests as it goes.
  7. Verify. Check the result against the spec and acceptance criteria; add tasks for gaps.

You review at every step, and the most valuable review is the earliest: fixing a wrong requirement in the spec takes a minute; fixing it in code takes much longer.

Four document cards in a row joined by small ink arrows, three light and the last grey, with a curved ink arrow looping from the last card back to the first through an orange dot.
Spec, plan, tasks, code, then check the result against the spec and loop back.

A Spec-Driven Development Example

Here's a compact spec-driven development example for one feature: letting users export their invoices as a CSV file.

1. Spec (`specs/invoice-export/spec.md`)

# Feature: Export invoices to CSV

## Why
Accountants ask support for invoice data every month. Let users export it themselves.

## User stories
- As an account owner, I want to download my invoices as CSV so I can import them into my accounting tool.

## Requirements
1. WHEN the user clicks "Export CSV" on the Invoices page, THE SYSTEM SHALL download a CSV of the invoices matching the current filters.
2. THE SYSTEM SHALL include: invoice number, date, customer name, net amount, tax, total, currency, status.
3. WHEN there are more than 10,000 matching invoices, THE SYSTEM SHALL email a download link instead of downloading directly.
4. IF the user is not an account owner or admin, THEN THE SYSTEM SHALL hide the export button.

## Acceptance criteria
- Given 3 paid invoices, when I export, then the file has a header row and 3 data rows.
- Amounts use a dot as decimal separator and no thousands separator.
- Dates use ISO format (YYYY-MM-DD).

## Out of scope
- PDF export, scheduled exports, custom columns.

The requirements use EARS ("Easy Approach to Requirements Syntax"), a format of short, testable "WHEN ... THE SYSTEM SHALL ..." sentences that Kiro also uses.

2. Plan (`plan.md`), drafted by the agent and reviewed by you:

  • Add GET /api/invoices/export reusing the existing invoice filter parser.
  • Stream rows with the existing CSV helper to avoid loading everything into memory.
  • For more than 10,000 rows, enqueue a job on the existing background queue and email a signed link that expires after 24 hours.
  • Permission check through the existing role middleware.
  • Tests: unit tests for row formatting, an integration test for the endpoint, and a permissions test.

3. Tasks (`tasks.md`):

  1. Write row-formatting function and unit tests (dates, amounts, currency).
  2. Add the export endpoint with filter reuse and streaming; integration test.
  3. Add the role check; permissions test.
  4. Add the background job and email for large exports; test with a mocked queue.
  5. Add the button to the Invoices page, hidden for other roles.
  6. Update the help-centre article.

4. Implement and verify. The agent completes one task at a time, runs the tests, and you check the result against the acceptance criteria. If you change your mind (say, adding a "paid date" column), you edit the spec first, then update the plan and tasks.

Notice what the spec prevents: the agent won't invent a new CSV library, won't load 50,000 rows into memory, and won't show the button to everyone.

EARS Notation: Requirements Agents Can Follow

EARS (Easy Approach to Requirements Syntax) was developed at Rolls-Royce to make requirements clearer, and it suits AI agents because each sentence is short, specific and testable. Its main patterns:

PatternTemplateExample
Ubiquitous (always true)THE SYSTEM SHALL ...THE SYSTEM SHALL store amounts in the invoice's currency.
Event-drivenWHEN [trigger], THE SYSTEM SHALL ...WHEN a user clicks Export, THE SYSTEM SHALL download a CSV.
State-drivenWHILE [state], THE SYSTEM SHALL ...WHILE an export is running, THE SYSTEM SHALL disable the Export button.
Unwanted behaviourIF [condition], THEN THE SYSTEM SHALL ...IF the export fails, THEN THE SYSTEM SHALL show an error and log it.
Optional featureWHERE [feature is included], THE SYSTEM SHALL ...WHERE multi-currency is enabled, THE SYSTEM SHALL add a currency column.

You don't have to use EARS, but writing requirements this way makes gaps obvious: if you can't fill in the trigger or the response, the requirement isn't ready.

Spec-Driven Development Tools

GitHub Spec Kit

GitHub Spec Kit is an open-source, MIT-licensed toolkit that adds a spec-driven workflow to existing AI coding agents. You install its specify command-line tool with uv tool install specify-cli, run specify init in a project, and choose which agent to set it up for. It then gives the agent commands for each step. In GitHub Copilot's default mode they are:

  • /speckit-constitution for project principles
  • /speckit-specify to write the spec
  • /speckit-clarify to resolve open questions
  • /speckit-plan for the technical plan
  • /speckit-checklist to review requirement quality
  • /speckit-tasks for the task list
  • /speckit-analyze to check spec, plan and tasks for consistency
  • /speckit-implement to carry out the tasks
  • /speckit-converge to check the code against the spec and add tasks for gaps

How you invoke them varies slightly between agents, so check the Spec Kit docs for yours. The output is a set of Markdown files (spec, plan, tasks and checklists) that you commit with the code.

Kiro

Kiro is an AI IDE from Amazon built around specs. For each feature it creates three files: requirements.md with user stories and acceptance criteria in EARS notation, design.md with the architecture and approach, and tasks.md with an implementation checklist you can run task by task. It also keeps "steering" files with project-wide context.

Other approaches

  • Tessl explores the spec-as-source end of the spectrum, where code is generated from specs and marked as not to be edited by hand.
  • Plain Markdown: you don't need a special tool. A specs/ folder with spec, plan and task files works with any agent.

Spec-Driven Development With Claude Code

Spec-driven development with Claude Code works well with or without extra tools. A simple setup:

  1. Keep project rules in `CLAUDE.md`: stack, conventions, test commands, things to avoid.
  2. Write the spec in specs/<feature>/spec.md, or ask Claude to draft it from your description and interview you about gaps: "Ask me questions until the requirements are unambiguous, then write spec.md."
  3. Use plan mode to have Claude propose a plan without editing files, then save the agreed plan as plan.md.
  4. Generate `tasks.md` as a numbered checklist of small, testable tasks.
  5. Implement one task at a time: "Do task 2 only, run the tests, then stop." Review the diff before moving on.
  6. Verify against the spec: ask Claude to compare the code with each acceptance criterion and list gaps.

You can also run Spec Kit's commands inside Claude Code by choosing it as the agent when you run specify init. For more on day-to-day use, see our guide on how to use Claude Code.

Spec-Driven Development With GitHub Copilot and Cursor

The same workflow works in other agents:

  • GitHub Copilot: Spec Kit's default setup targets Copilot, so specify init with the Copilot integration gives you the full set of commands in its agent mode. Specs, plans and tasks live as Markdown files in the repository, where Copilot's coding agent can pick them up.
  • Cursor: keep project rules in Cursor's rules files or AGENTS.md, write the spec and plan as Markdown, and ask the agent to work through tasks.md one item at a time. Spec Kit can also be set up for Cursor.
  • Any agent: the core of spec-driven development is plain files and discipline. If your agent can read files and run tests, it can follow a spec.

Spec-Driven Development for Teams

For a team, specs become a shared contract between product, design and engineering:

  • Keep specs in the repository, in a predictable folder such as specs/<feature>/, so they're versioned with the code.
  • Review specs in pull requests before any code is written. A spec review is often the most valuable review of the whole feature.
  • Let product managers draft the "why" and requirements, and engineers add constraints and the technical plan.
  • Use a template so every spec has the same sections: goal, user stories, requirements, acceptance criteria, constraints, out of scope.
  • Update the spec with the code. When behaviour changes, change the spec in the same pull request, or it quickly becomes misleading.

How Much Process Do You Need?

Match the process to the change:

ChangeSuggested approach
Typo, small bug, one-line fixJust ask the agent; review the diff
Small feature (under an hour of agent work)Plan mode or a short written plan
Medium feature, several filesSpec + plan + task list in Markdown
Large feature, team project or risky areaFull workflow with clarify, analysis and spec review, using a tool like Spec Kit or Kiro

How to Write a Good Spec for an AI Agent

  • Describe behaviour, not code. "Users can export invoices as CSV" beats "add an ExportService class".
  • Make requirements testable. Each should have a clear pass or fail.
  • Include edge cases and limits: empty states, large inputs, permissions, errors.
  • State constraints: existing libraries to reuse, performance targets, security rules.
  • List what's out of scope, so the agent doesn't build extras.
  • Keep it short. One to three pages per feature. If it's longer, split the feature.
  • Version it in Git next to the code, and update it when requirements change.

When Spec-Driven Development Is Worth It

Spec-driven development pays off for:

  • Features that take more than an hour or two of agent work.
  • Changes that touch several parts of a system.
  • Team projects where others need to review intent.
  • Regulated or high-risk code where you need a record of requirements.
  • Long-running agent sessions that would otherwise drift.

It's usually not worth it for small bug fixes, one-line changes, quick experiments or throwaway scripts. Böckeler found that heavy spec workflows can be overkill for small problems, generating more Markdown to review than code, and that agents sometimes ignore parts of the spec anyway. Match the amount of process to the size and risk of the change.

Common Spec-Driven Development Mistakes

  • Specs that are really code designs, which leave no room for the plan step and go stale quickly.
  • Specs too vague to test, such as "export should be fast".
  • Skipping review of the generated plan and tasks.
  • Letting the spec and code drift apart after changes.
  • Huge tasks that the agent can't finish or you can't review in one sitting.
  • Using a heavy workflow for tiny changes.
  • Trusting the agent's own "done" without running tests and checking the acceptance criteria.

FAQ

What is spec-driven development in simple terms?

It's writing down exactly what a feature should do, including requirements and acceptance criteria, before asking an AI agent to build it. The agent turns the spec into a plan, tasks and code, and you check the result against the spec.

Is spec-driven development the same as waterfall?

No. Waterfall specified whole systems far in advance. Spec-driven development works one feature at a time, with short specs that you change and re-plan as you learn, so it stays iterative.

Do I need GitHub Spec Kit or Kiro?

No. They add structure and commands, but you can do spec-driven development with Markdown files and any coding agent: write the spec, plan and tasks in your repository and have the agent work through them.

Does spec-driven development replace tests?

No. Good specs make better tests, because acceptance criteria become test cases. You still need automated tests to check that the agent's code really meets the spec.

Is spec-driven development worth it?

For medium and large features, team work and code that matters, usually yes: it reduces rework and makes AI output easier to review. For small fixes and quick prototypes, a short prompt or plan mode is often enough.

All articles

Read next

Language

EnglishEnglish · en TürkçeTurkish · tr DeutschGerman · de العربيةArabic · ar

Account

Enter your email. We’ll send you a sign-in link and a 6-digit code. No password needed.

Sign in

Theme

Language

Show our email address

To keep spam out of our inbox, please confirm your own email first. We will send you a 6-digit code.

We send codes only to these providers: gmail.com, googlemail.com, outlook.com, hotmail.com, live.com, msn.com, proton.me, protonmail.com, pm.me, icloud.com, me.com, mac.com, yahoo.com, aol.com, gmx.de, gmx.net, web.de, t-online.de, yandex.com, omniai.blog