Skip to content

Chapter 102

Spec-driven development: the plan before the code

From an idea to a spec and small phases Claude Code carries out one task at a time

Talqeen wrote this chapter and no editor has reviewed it yet. Search engines are not shown this page until it is reviewed.

When you ask a language model to "build me an appointment booking app" it will build something, but it will fill every gap in your request with a guess: who are the users? Are payments in scope? What happens when an appointment is cancelled? Every guess is a decision made for you, and many will turn out wrong after hundreds of lines are written. Spec-driven development flips the order: we agree on what we are building first, then we write code.

From the idea to the destination

A good spec starts with the destination: where the project must arrive, and how we know it has. The destination is one sentence, with three to seven measurable success criteria, what we will not build (non-goals), and constraints such as budget and time.

A criterion you cannot measure

Booking is easy and fast.

A criterion you can measure

A user books an appointment in three steps or fewer and receives a confirmation within a minute.

Requirements in EARS form

EARS writes every requirement in a fixed template that removes ambiguity, such as: "When a customer cancels an appointment, the system shall notify the business owner." Each requirement has a type: ubiquitous, event, state, unwanted behaviour, or optional. Each carries a number (REQ-1, REQ-2) that tasks link to later, so no task is without a reason and no requirement is without a task.

Trigger
When a customer cancels an appointment
Actor
the system shall send
Response
a notification to the business owner within a minute

Small phases you can run

The plan is cut into phases, and each phase is a complete slice you can run: interface, server and data for one feature, not "the whole database first". A phase is at most five workdays or eight tasks, and each has a definition of done. Phase zero is setup: the repository, the environment, and CLAUDE.md.

Before you start a phase

  • Every task in it links to a numbered requirement
  • The definition of done is written and can be checked
  • The previous phase is done and its tests pass
  • You know what you will not do in this phase

With Claude Code

Once the spec and phases are ready, Claude Code's role is clear: it takes one task from the current phase, carries it out, runs the tests, then updates its status. That is what the /talqeen-next command in the kit Talqeen prepares does: it reads the next task from your project's MCP server and marks it done when it is finished.

Ask for a spec before code

Only the prompt in the box is sent to that site, nothing from your projects.

Test yourself

1. What makes a success criterion good?
2. How big should a phase be in spec-driven development?