Topic 6 of 6 · 5 min read
From PRD to an agent-ready spec
Goal: Convert a PRD section into a spec with requirements, constraints and acceptance checks that a coding agent can execute.
An agent-ready spec turns "what and why" from the PRD into "exactly what, where and how we will know" in a form a coding agent can follow without guessing. The PRD persuades people. The spec instructs the builder.
Check yourself · 1 of 3
What makes a requirement usable by a coding agent?
Why it matters
Agents such as Claude Code, Codex, Copilot and Cursor do best with a small, clear task and a way to check it. Handed a PRD paragraph, they fill the gaps with guesses and report success. Spec-driven tools like GitHub's Spec Kit and Kiro formalise this: requirements, then design, then a task list, each reviewed by a human before code is written. Critics, including Martin Fowler's write-up, warn that specs can become heavy ceremony, so keep them as short as the change allows.
How to convert
- Requirements. Rewrite each in-scope item as a statement that can be true or false: "The export endpoint returns a CSV with the same columns as the invoice table."
- Constraints. Stack, files and modules to touch, files to leave alone, performance and security limits, and the non-goals copied across as hard stops.
- Acceptance checks. For each requirement, a check an agent can run: a test name, a command, an example input and expected output.
- Tasks. Split into steps small enough to review one at a time, each tied to a requirement and a check.
- Open questions. Anything unresolved stays visible; an agent must stop and ask, not choose.
Before and after
PRD: "Finance contacts can download invoices as CSV."
Spec:
- Requirement R1:
GET /invoices/:id/export.csvreturns the invoice lines as CSV, columns in the order of the invoice table. - Constraint: touch only
api/invoices/; no new dependencies; no permission changes. - Check for R1: test
export returns 404 for another account's invoice; testexport has header row and one row per line item; runnpm test -- invoices. - Task 1: add the route and a failing test. Task 2: make it pass. Stop after each for review.
What goes wrong
- Spec is a copy of the PRD. Nothing is more executable than before.
- No checks. The agent cannot know it is done and says so anyway.
- Giant tasks. A diff nobody can review.
- Spec drift. Code changes, the spec does not, and the next agent trusts it.
Examples
One requirement with its check
R2: when the invoice belongs to another account, the endpoint returns 404 with no body. Check: test export hides other accounts' invoices sends a request with account B's token for account A's invoice and expects 404. The agent can tell when R2 is done because the test is green, and so can the reviewer.
Task list with review gates
T1: add the failing test for R1. T2: implement the route until T1 passes. T3: add the 404 test for R2. After each task the agent stops and shows the diff. The human reads a 20-line change three times instead of a 300-line change once.
Key points
- A spec states requirements as true-or-false statements, with constraints, acceptance checks and open questions.
- Copy non-goals into the spec as hard stops, and name the files and modules the agent may touch.
- Every requirement needs a check the agent can run, such as a named test or a command with expected output.
- Split work into small tasks, each reviewed by a person before the next starts.
- Keep the spec as short as the change allows and update it when behaviour changes.
Common mistakes
- Pasting the PRD into the agent and calling it a spec.
- Writing requirements with no way to run a check.
- Making tasks so large that review becomes skimming.
- Letting the spec go stale after the code changes.
Check yourself · 2 of 3
Why copy non-goals from the PRD into the spec?
Check yourself · 3 of 3
Why split an agent's work into small tasks with a review after each?
Practice items, not counted towards your mastery.
Start here
- What is a Product Requirements Document (Atlassian) (opens in a new tab)ArticleFree
What a PRD contains, who writes it and how it stays a living document.
- Articles (Silicon Valley Product Group) (opens in a new tab)ArticleFree
Marty Cagan's essays on product problems, outcomes and discovery before delivery.
- GitHub Spec Kit (opens in a new tab)ToolFree
An open-source toolkit for spec-driven development with coding agents, with its own workflow and templates.
More for this topic
- Specs (Kiro docs) (opens in a new tab)DocsFree
How Kiro turns a prompt into requirements, design and tasks that an agent works through.
- Understanding Spec-Driven Development: Kiro, spec-kit and Tessl (martinfowler.com) (opens in a new tab)ArticleFree
A critical comparison of three spec-driven tools and where specs help or add overhead.