All posts

GuideDevfab Team8 min read

Spec-driven development, explained

Spec-driven development explained: what a spec is, the three levels, how Spec Kit and Kiro run it, where critics say it falls short, and a lab tracker example.

Spec-driven development, explained

Short answer: Spec-driven development means writing what the software should do, in plain language, before an AI agent writes code. The spec is the shared reference. The agent turns it into a plan, the plan into tasks and the tasks into code, and the result is checked against the spec. It helps on real features and can feel heavy on small fixes.

A written spec feeding a plan, tasks, code and checks on a software production line

You have heard two stories. One says specs tame AI agents. The other says specs are waterfall in a new coat.

Both have a point. What matters is what a spec is, when it pays for itself, and how to run the loop without drowning in markdown.

In this guide, you'll learn:

The rest of the page covers it in order.

What spec-driven development means

Birgitta Böckeler's October 2025 review on martinfowler.com describes it as writing a spec before generating code with AI, so the spec is the reference for both the human and the AI. She also notes the definition is still unsettled, and that some people now use "spec" to mean "detailed prompt" (martinfowler.com).

A spec is not a general memory file about your project. It is structured, focused on behavior, and written for one feature or change. Think "what and why," not "which library."

GitHub's Spec Kit turns the idea into commands: constitution (project principles), specify, plan, tasks, implement and converge, repeating implement and converge until the result reports "Converged." It is MIT licensed (Spec Kit). Kiro generates three files per spec: requirements.md with user stories and EARS-format acceptance criteria, design.md with architecture and sequence diagrams, and tasks.md with trackable tasks, finishing each phase before the next (Kiro docs).

One status note. Tessl launched a spec registry and framework in September 2025, then repositioned in January 2026 around agent "skills," per a June 2026 review (CodeMySpec; Tessl). The field is still moving.

Three levels of spec-driven development

Böckeler names three levels:

LevelWhat happens to the specWho edits the code
Spec-firstWritten for the task, then left behindPeople and agents
Spec-anchoredKept and updated as the feature changesPeople and agents
Spec-as-sourceThe main long-term artifactNobody by hand; code is regenerated

She found that the tools she reviewed were all spec-first, and few aimed further. Spec-as-source also carries a warning from history: it could combine the rigidity of model-driven development with the unpredictability of language models.

For most teams, spec-first is the honest starting point. Spec-anchored is worth it for features that change often.

Step by step

The example is a lab sample tracker for a small clinical lab. Staff log incoming samples, assign tests, record results and release reports to the ordering clinic.

Illustration: The spec-driven loop: spec, clarify, plan, tasks, implement, check, keep current

Step 1: Write the spec: what and why, not how

Describe users, flows, data and rules. Leave out frameworks and table names.

Lab example: "Receptionists log a sample with patient ID, sample type and ordering clinic. Technicians see samples assigned to them and record results. A supervisor releases the report. A result can't be released until a supervisor signs off."

If you need a layout, use a one-page structure: problem, users and roles, must-have flows, data, rules, done means.

Step 2: Clear up open questions before planning

List what you don't know. "Do clinics see partial results?" "Can a sample be split across two tests?" An agent that sees an open question can ask instead of guessing.

Spec Kit mentions clarification and consistency checks in its workflow. Whatever tool you use, answer the questions in the spec itself.

Step 3: Turn the spec into a technical plan

Now the "how" appears: data model, screens, integrations, the order of work. The plan should point back to the spec. Every flow and rule needs a home in it.

This is where a person reads carefully. In Devfab, research runs first: the Researcher maps key terms, best practices and competitors for that kind of app, then suggests a prototype. The Planner writes the plan, and a person approves it before any ticket exists.

Step 4: Break the plan into small tasks

Each task should produce one checkable outcome. "Sample intake form with required fields" is a task. "Build the lab module" is not.

Kiro's tasks.md and Spec Kit's tasks command both exist for this step. In Devfab, the Coordinator splits the approved plan into tickets and assigns developer agents.

Step 5: Implement one task at a time

Let the agent build a task, then look at it before the next. Small steps keep mistakes small.

On an existing codebase, check what a task touches. Devfab's ChainFlow maps which functions and APIs call each other and what is deployed. In the lab tracker, changing how a result is released could affect clinic notifications, the audit log and billing exports.

Step 6: Check the result against the spec

The spec's rules become tests. Write them as checks a tester can run:

  • UI: the intake form rejects a sample with no ordering clinic.
  • Flow: a sample is logged, tested, signed off and released to the clinic.
  • Logic: release is blocked until a supervisor signs off.

Kiro verifies specs with property-based tests. Spec Kit loops implement and converge. Devfab's QA agent runs UI and flow tests (screens, buttons and user journeys clicked end to end) plus logic tests.

Illustration: The lab tracker's spec rules written as UI, flow and logic checks, not yet run

Step 7: Keep the spec current after release

If the spec is left behind after release, the next change starts from guesses. When a rule changes ("clinics may now see partial results"), change the spec first, then let the plan and tasks follow. That is the step from spec-first to spec-anchored.

Common mistakes

  1. Specs for everything. Böckeler found the workflow felt like overkill for small fixes. Use a spec where a wrong guess would hurt.
  2. Too much markdown. Long generated files are tedious to review, so people skim them. Keep specs to one page per feature.
  3. Trusting the spec blindly. Agents sometimes ignore instructions. Tests, not the spec, prove behavior.
  4. Mixing what and how. Put behavior in the spec and technical choices in the plan.
  5. No owner. If nobody updates the spec, it drifts from the code.

Checklist

  • [ ] The feature is big enough to deserve a spec
  • [ ] Spec covers users, flows, data, rules and done means
  • [ ] Open questions are answered in the spec
  • [ ] The plan maps every flow and rule from the spec
  • [ ] A person approved the plan
  • [ ] Tasks each produce one checkable outcome
  • [ ] Rules are tested as UI, flow and logic checks
  • [ ] Someone owns keeping the spec current

For a deeper look at writing the spec itself, read How to write a software spec that AI agents can build from. To compare tools, see Best spec-driven development tools and Kiro vs Cursor.

FAQ

What is spec-driven development in simple terms?

You write down what the software should do, in plain language, before an AI agent writes code. The spec becomes the reference for both the person and the agent. The agent turns it into a plan, then tasks, then code, and the result is checked against the spec.

Is spec-driven development the same as writing a PRD?

Close, but not the same. A PRD is usually written once for people. In spec-driven development the spec is a working input for an agent, kept in the repo and used at every step. Some teams also keep it current after release, which a PRD rarely is.

What are the downsides of spec-driven development?

A review on martinfowler.com found the workflow heavy for small fixes, the generated markdown tedious to review, and agents that sometimes ignored the spec. Keep specs short, use them for features that deserve them, and verify results with tests.

Do I need a special tool for spec-driven development?

No. A markdown file and a disciplined order of work are enough to start. Tools such as GitHub Spec Kit and Kiro add commands and file formats that enforce the order: spec, plan, tasks, implementation and checks.

Have a spec, or just an idea? Devfab researches the domain, writes a plan you approve and tests the result with UI, flow and logic checks. Try the Devfab Beta

Frequently asked questions

What is spec-driven development in simple terms?

You write down what the software should do, in plain language, before an AI agent writes code. The spec becomes the reference for both the person and the agent. The agent turns it into a plan, then tasks, then code, and the result is checked against the spec.

Is spec-driven development the same as writing a PRD?

Close, but not the same. A PRD is usually written once for people. In spec-driven development the spec is a working input for an agent, kept in the repo and used at every step. Some teams also keep it current after release, which a PRD rarely is.

What are the downsides of spec-driven development?

A review on martinfowler.com found the workflow heavy for small fixes, the generated markdown tedious to review, and agents that sometimes ignored the spec. Keep specs short, use them for features that deserve them, and verify results with tests.

Do I need a special tool for spec-driven development?

No. A markdown file and a disciplined order of work are enough to start. Tools such as GitHub Spec Kit and Kiro add commands and file formats that enforce the order: spec, plan, tasks, implementation and checks.