Skip to content
mentoor

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?

Choose one answer

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

  1. 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."
  2. Constraints. Stack, files and modules to touch, files to leave alone, performance and security limits, and the non-goals copied across as hard stops.
  3. Acceptance checks. For each requirement, a check an agent can run: a test name, a command, an example input and expected output.
  4. Tasks. Split into steps small enough to review one at a time, each tied to a requirement and a check.
  5. 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.csv returns 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; test export has header row and one row per line item; run npm 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?

Choose one answer

Check yourself · 3 of 3

Why split an agent's work into small tasks with a review after each?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic