# Spec-Driven Development

> Write what to build first. The AI plans and codes from that written spec.

**Field:** Artificial Intelligence  
**Category:** Working with AI  
**Also known as:** Spec-First AI Coding, Spec-Driven AI Coding

## Think of it like

It is like drawing a plan of a house first. Then the builders follow it.

## Definition

Spec-driven development is a way to code with AI that starts from a written plan. First you write a spec: what to build, for whom and how you will know it works. Then the AI turns the spec into a plan and a list of small tasks. The AI writes code one task at a time. The spec stays in the project, so later changes start from it. It is the opposite of vibe coding.

## Example

GitHub's free Spec Kit runs it as steps. You give the agent the spec, then the plan, then the tasks. Last, it writes the code.

## Example code

```markdown
# Feature: Password reset

## Who
A user who forgot their password.

## Done when
- The user gets a reset link by email.
- The link stops working after one use.
```

A short spec: what the feature is, who it is for, and how you know it is done.

## Why it matters

An agent guesses less when the goal is written down. The spec also tells you what to check at the end.

## Common mistake

Writing a spec once and never updating it. When the plan changes, change the spec first.

## Three principles

- **Spec first.** What, for whom, and when it is done.
- **Then plan and tasks.** Small steps the AI can finish.
- **Spec stays.** Changes start from the written plan.

## Related terms

- [Agentic Coding](https://learn.benibix.com/term/ai/agentic-coding)
- [Vibe Coding](https://learn.benibix.com/term/ai/vibe-coding)
- [GitHub Spec Kit](https://learn.benibix.com/term/ai/github-spec-kit)
- [Kiro](https://learn.benibix.com/term/ai/kiro)
- [BMAD Method](https://learn.benibix.com/term/ai/bmad-method)
- [Agent Instruction File](https://learn.benibix.com/term/ai/agent-instruction-file)
- [Test-Driven Development (TDD)](https://learn.benibix.com/term/development/test-driven-development)

## Taught in

- [Vibe Coding vs Spec-Driven](https://learn.benibix.com/learn/ai-working-with-ai/vibe-coding-vs-spec-driven): Prompt Engineering, 15/16

![A row of four steps: spec, generate code, review, merge. A side path skips the review step and drops into a pile marked debt, which grows under the row.](https://learn.benibix.com/diagrams/ai3-code-flow.svg)

---

Source: https://learn.benibix.com/term/ai/spec-driven-development
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
