Spec-driven development means writing down what you want before an AI agent writes any code. Tools such as GitHub's spec-kit and Kiro turn that into a workflow: requirements, then a design or plan, then a task list, each in its own Markdown file, and only then code.
The idea is sound. An agent given a vague request fills every gap with a guess, and you only find the guesses when you read the code. A written spec moves those decisions to the cheapest moment, before anything exists.
Is it just waterfall?
That is the most common objection, and it is fair when the spec is treated the waterfall way: written in full, approved, frozen and handed over. Waterfall failed because people learned the most only after the documents were finished.
Two things keep a spec from going the same way:
- It is small. It describes one change you could check in an afternoon, not a whole product.
- It changes. When building shows the spec was wrong, you fix the spec first, then the code.
The opposite risk is real too. Reviewing Kiro, spec-kit and Tessl on martinfowler.com, Birgitta Böckeler watched one small bug fix turn into four user stories with sixteen acceptance criteria. If reviewing the spec takes longer than reviewing the code would have, the spec is too big.
A spec that fits on one page
You do not need a tool. A short note with six parts covers most changes:
Request: What should change, in one or two sentences.
Examples: Three to five inputs, each with the exact output you expect.
Always: Rules that hold for every input.
Edges: Empty, zero, negative, very large, missing, duplicated.
Leave alone: Files and behaviour that must not change.
Open: Questions you have not decided yet.The examples do most of the work. "Format a duration" is vague. "59.6 seconds shows as 1:00, never 0:60" is a decision, and it is already a test.
The open questions matter as much. An agent answers every question you leave open, silently. Listing them means you decide them, or at least know which ones it decided for you.
Where it pays off
The note pays for itself after the agent has finished:
- Turn the examples into tests before the code exists. Written first, they test what you asked for, not what the agent happened to build.
- Check the diff against "Leave alone". Any file outside the request is a question for the agent, not a bonus.
- Find each edge in the code. For every edge you listed, find the line that handles it, or the test that proves it.
That is the difference between a spec and a prompt. A prompt is used up once the agent starts. A spec is still there when you review the result, and it tells you what to check.
Chapter 2 of the free book Checked, Not Trusted builds this request note step by step, with a lab. For turning the examples into tests, see AI test case generation.