# Spec-Driven Development

> The Spec-Driven Development is an approach where a detailed specification is written first and then implemented with AI agents.

## What is spec-driven development with AI?

The approach where requirements, design and a task list are written down first, often together with AI, and agents implement them step by step. The spec becomes the source of truth and makes results more predictable than ad hoc prompts.

- Topic: Agentic Coding
- Type: approach

## Example

Wrong:

```markdown
## Feature
Add password reset.
```

Right:

```markdown
## Feature
Add password reset by email.

## Acceptance criteria
- Reset link expires after 30 minutes.
- Used links cannot be reused.

## Out of scope
- SMS reset, account recovery questions.
```

Checkable acceptance criteria and an explicit out-of-scope list give the agent a clear target and limits.

## Common mistakes

- Writing the spec once and letting it drift away from the real code.

## Key points

- The spec lists acceptance criteria that can be checked, not only a feature description.
- The spec names what is out of scope, so the agent does not add extra features.
- The spec is stored in the repository and updated when requirements change.

## Interview questions

### Spec-driven development vs vibe coding?

Spec-driven development writes requirements and acceptance criteria first and checks work against them. Vibe coding iterates on prompts without a written plan.

### What should a spec for an AI agent include?

The goal, acceptance criteria, constraints, design notes, out-of-scope items and a task list small enough to verify step by step.

### Where should I keep the spec?

In the repository next to the code, so agents can read it and changes to requirements are reviewed like code.

## Related cards

- [Plan Mode](https://wonderium.dev/ai/plan-mode.md)
- [Agentic Coding](https://wonderium.dev/ai/agentic-coding.md)
- [Test Driven Development](https://wonderium.dev/engineering/test-driven-development.md)
- [Behaviour Driven Development](https://wonderium.dev/engineering/behaviour-driven-development.md)
- [Coding Agent](https://wonderium.dev/ai/coding-agent.md)

---

- Level: [Artificial Intelligence](https://wonderium.dev/ai.md)
- HTML version: https://wonderium.dev/ai/spec-driven-development
- Last updated: 2026-11-25
