Spec driven development with AI: write the plan in Markdown first
Spec driven development with AI means writing what to build, how, and the task list in Markdown files first, then having the coding agent work from them.

Spec driven development with AI means you write down what to build before a coding agent writes any code: the requirements, the technical approach and a task list, as Markdown files in the repository. The agent then works through the tasks with the spec as its reference, and you review the plan, which is short, before you review the code, which is long. The spec stays in the repo, so the next session, the next agent and the next person start from the same document instead of a chat history.
This post covers what goes in a spec, a template you can copy, how GitHub Spec Kit, Kiro, Claude Code and Cursor handle specs and plans, and how to keep the files useful after the feature ships.
How is a spec file different from AGENTS.md?
An instruction file such as AGENTS.md or CLAUDE.md describes the project and applies to every task: how to build, how to test, what not to touch. A spec describes one feature or change and is finished when that change ships. You usually have one instruction file and many specs. AGENTS.md explained covers instruction files; this post is about the per-feature document.
| Instruction file | Spec file | |
|---|---|---|
| Scope | Whole project | One feature or change |
| Lifetime | As long as the project | Until the change ships, then kept as a record |
| Typical name | AGENTS.md, CLAUDE.md |
specs/<feature>/spec.md, requirements.md |
| Read by the agent | Every session, automatically | When you point it at the file |
What goes in a spec for an AI coding agent?
Three parts, whether you keep them in one file or three: what the change must do, how it will be built, and the steps. Kiro's documentation splits these into requirements.md, design.md and tasks.md; GitHub Spec Kit uses spec.md, plan.md and tasks.md. The split is useful for large features. For most changes, one file is enough.
# Spec: CSV export for the reports page
Status: approved 2026-11-27
Owner: Dana
## Problem
Users copy report tables by hand into spreadsheets.
## Requirements
- WHEN a user clicks Export on a report THE SYSTEM SHALL download a .csv
with the same columns and order as the table on screen.
- WHEN the report has more than 10,000 rows THE SYSTEM SHALL stream the
file instead of building it in memory.
- WHEN a value contains a comma or quote THE SYSTEM SHALL quote it per RFC 4180.
## Out of scope
- Excel (.xlsx) export
- Scheduled exports by email
## Design
- New endpoint `GET /reports/:id/export.csv`, reusing `ReportQuery`.
- Stream rows with the existing database cursor helper.
- Button sits next to Print in `ReportToolbar`.
## Tasks
- [ ] 1. Add the endpoint with a test for column order
- [ ] 2. Add streaming for large reports, with a test at 50,000 rows
- [ ] 3. Add quoting tests for commas, quotes and newlines
- [ ] 4. Add the Export button and wire it to the endpoint
- [ ] 5. Update docs/reports.md
## Open questions
- Should dates export in the user's time zone or UTC?
The parts that matter most for an agent:
- Requirements you can test. The
WHEN ... THE SYSTEM SHALL ...lines follow EARS, the pattern Kiro's docs give for requirements: "WHEN [condition/event] THE SYSTEM SHALL [expected behavior]." Each line becomes a test, which gives the agent a way to know it is done. - Out of scope. Agents tend to do more than asked. A short list of what not to build is the cheapest guard against that.
- Numbered tasks as a checklist. Small enough to review one at a time. Ask the agent to tick each box as it finishes, so the file shows progress if the session ends halfway. Task lists covers the syntax.
- Open questions. Anything unresolved stays visible instead of being decided silently in code.
How do Spec Kit, Kiro, Claude Code and Cursor handle specs?
They differ in how much structure they impose. All four produce Markdown. Details below are from each vendor's documentation, checked November 2026.
| Tool | What it creates | Where it lives |
|---|---|---|
| GitHub Spec Kit | Commands such as /speckit-specify, /speckit-plan, /speckit-tasks produce a spec, a plan and a task list |
A folder per feature, such as specs/003-chat-system/ |
| Kiro | requirements.md (or bugfix.md), design.md, tasks.md |
.kiro/specs/<name>/ |
| Claude Code plan mode | A proposed plan you approve before any edit | Shown in the session; Ctrl+G opens it in your editor |
| Cursor Plan Mode | A Markdown plan you can edit | Your home directory by default; Save to workspace moves it into the project |
GitHub Spec Kit is an open source toolkit. You install the specify CLI (uv tool install specify-cli), run specify init in a project, and then use slash commands in your agent: /speckit-constitution for project principles, /speckit-specify for the feature spec, /speckit-plan for the technical plan, /speckit-tasks for the task list and /speckit-implement to build it. Those names follow GitHub Copilot's syntax, and the README links the equivalent invocation for other agents. The project's methodology document shows the files landing in a numbered feature folder, with spec.md, plan.md and tasks.md alongside research and data model notes.
Kiro builds specs into the editor. A feature spec has three core files and moves through phases: Requirements, then Design, then Tasks, or Design first if you prefer. Its CLI docs say artifacts are generated in .kiro/specs/<name>/.
Claude Code has a plan mode rather than a spec format. Start with claude --permission-mode plan, or press Shift+Tab during a session until the status bar shows plan mode. Claude reads files and proposes a plan but makes no edits until you approve, and Ctrl+G opens the proposed plan in your text editor so you can change it first. To keep a plan, ask Claude to write it to a file in the repo, such as specs/csv-export.md.
Cursor has a Plan Mode in Agent, reached with Shift+Tab from the chat input. Its docs say plans are saved in your home directory by default and that Save to workspace moves a plan into the project, where it can be committed with the code.
You do not need any of these to work this way. A specs/ folder, a template like the one above and the sentence "Read specs/csv-export.md and do task 1" work with any agent that can read files.
How does spec driven development with an AI agent work day to day?
Let the agent draft and you decide. A loop that works:
- Write the Problem and Out of scope sections yourself. They are a few lines, and they are the part only you know.
- Ask the agent to read the relevant code and draft Requirements, Design and Tasks into the file. In Claude Code or Cursor, plan mode keeps it from editing code while it does this.
- Read the draft and edit it directly. Delete requirements you did not ask for and split tasks that touch more than a few files.
- Change
Statustoapprovedwith the date. Commit the spec on its own, so the diff shows exactly what was agreed. - Ask the agent to do one task at a time, run the tests, and tick the box.
Step 3 is the point of the whole exercise. Correcting a sentence in a plan takes seconds, while finding the same misunderstanding in a 400-line diff takes much longer.
What happens to the spec after the feature ships?
Keep it, and make it match what was built. During implementation, things change: a task turns out to be unnecessary, a design choice gets reversed. Ask the agent to update the spec in the same change as the code, then set Status: shipped 2026-12-04. A folder of shipped specs becomes a record of why the code looks the way it does, which a future agent can read before touching the feature again. The same idea applies to any file an agent reads; see context engineering with plain files.
Not every change needs a spec. A one-line fix or a rename is faster to do than to describe. A rough rule: if you would explain the change to a colleague before they started, write it down for the agent too.
Writing specs in Noteline
Noteline, which we make, has no AI features, so the agent runs in your terminal or editor as usual. Noteline is a plain Markdown editor for the files around it. Open the repository with File > Open Folder… (Cmd+O on a Mac, Ctrl+O on Windows and Linux) and the specs/ folder appears in the sidebar. Hidden folders are skipped, which includes .git and also Kiro's .kiro/specs/, so Kiro specs do not show in the list. Task checkboxes are clickable, tables show as an editable grid, and Mermaid blocks in a design section render as diagrams. When an agent ticks a box or rewrites a section while the spec is open, a bar offers Use disk version or Keep my version, so your edits and the agent's do not overwrite each other silently. Find in Folder (Cmd+Shift+F, or Ctrl+Shift+F) searches every spec for a requirement or an open question.