The spec comes first.And you read it before the code.
Spec-driven development turns a request into documents before it becomes code. This page shows the loop, a short spec template, and where your review fits with Claude Code, Codex and Cursor.
macOS 14 or later. Reading is free; editing and reviews are one payment.
Quick answer
In spec-driven development the agent writes a spec (what and why), then a plan (how), then tasks, and builds only after each one is reviewed. The review is where it succeeds or fails: a wrong requirement in the spec becomes wrong code. DotMD is where you read each document, comment on the exact passage and check the agent's fixes before it moves on.
The loop: spec, review, plan, review, tasks, build
Instead of one big prompt and a pile of code, the work goes through documents, each one checked by you before the next is written.
-
Spec: what and why
What the feature must do, for whom, and what it must not do. No file names, no technology choices yet.
-
Plan: how
The approach: which parts change, in what order, with what risks. The plan answers to the spec.
-
Tasks: small steps
A checklist the agent can work through and tick off, each task small enough to check.
-
Build
Only now the agent writes code, against documents you have already read.
A short spec template
A spec does not need to be long. Six headings are enough to catch most misunderstandings:
# Feature name
## Goal
## Non-goals
## Users
## Requirements
## Edge cases
## Open questions
Non-goals and Open questions are the ones people skip and agents need most. An agent that is told what not to build, and what is still undecided, asks instead of guessing.
Doing it in Claude Code, Codex and Cursor
All three can write the documents, and each has a plan mode for the planning step: Claude Code plan mode, Codex plan mode and Cursor plan mode.
To make the review step automatic, put one rule in CLAUDE.md or AGENTS.md: after writing a spec or plan, send it to you with request_review in DotMD and wait. The agent then stops after every document and waits for your comments or your approval, using no tokens while it waits. DotMD can add the rule for you: see CLAUDE.md and AGENTS.md.
Review that scales
Chat is a poor place to review a document. You read the spec rendered in DotMD instead, select the passage that is wrong and press ⌥⌘M. The comment is tied to its lines, so the agent knows exactly what you mean. You can write all the comments first and send them once.
When the agent has fixed them, every change is shown in the file: old text red, new text green, next to the comment it answers. Accept or Reopen each one. DotMD also lists the changes nobody asked for. See Reviewing changes.
For a second opinion, let another agent review first. A spec written by Claude Code and commented by Codex reaches you with the obvious gaps already marked, and you decide which remarks the writer gets: Agent reviews agent.
Tools for spec-driven development
- Plain Markdown in the repo. A
docs/specsfolder and the template above is a complete setup. - Plan modes. Each agent's own way of planning before it builds.
- GitHub Spec Kit. An open-source toolkit that gives your agent commands for each step and writes
spec.md,plan.mdandtasks.mdfor you: GitHub Spec Kit.
Whatever you pick, the documents are Markdown files, and DotMD reads any of them.
Questions about spec-driven development
Is spec-driven development the same as plan mode?
Plan mode is one step of it: a plan before the code. Spec-driven development adds a spec before the plan and a review at each step.
Do I need a special tool?
No. Specs are Markdown files in the repo, and any agent can write them. GitHub Spec Kit adds ready-made commands.
Where do specs live?
In the repository, next to the code, so they are versioned and the agent can reread them.
Does DotMD cost anything for this?
Reading specs is free. Comments and reviews with agents need DotMD Reviewer; see pricing.