Crema spec Get the free skill

How to Write a PRD for AI Coding Agents (Free Template)

By Viberr ·
A Victorian workshop bench where a clerk hands a single short sheet of requirements to a small brass automaton, while a tall stack of discarded pages sits on the floor behind them.

A PRD for AI coding agents is a short, testable requirements document. It tells the agent who the change is for, why it matters, what is in and out of scope, which limits apply, and how to prove the work is done.

Your agent is not bad at coding. It is bad at guessing, and a human PRD makes it guess at hundreds of unstated rules every time it opens the file. This guide shows what to cut, what to add, and how long to go, with a free template you can paste into Claude Code, Cursor, or any other agent today.

What is a PRD for AI coding agents?

Definition

A PRD for AI coding agents is a short product requirements document written so a coding agent can build, test, and stop without guessing: it states who the change is for, why it matters, what is in and out of scope, the constraints, and acceptance criteria a test can verify.

A classic PRD is written to align people. It persuades, gives background, and leaves room for a designer or engineer to fill gaps with judgment. An agent-ready PRD does the opposite: it closes gaps, because an agent fills them with assumptions.

This document is the core input of spec-driven development. When GitHub released Spec Kit, its open source toolkit for spec-first work, it described a shift from code as the source of truth to intent as the source of truth. The PRD is where that intent gets written down.

Why does a human PRD fail an AI coding agent?

Most PRDs were never meant to be executed. They were meant to be discussed in a meeting, and the meeting filled in what the page left out. Hand that same page to Claude Code or Cursor, and nobody is in the room.

“they're exceptional at pattern completion, but not at mind reading.”

A human PRD breaks down in four ways.

The same GitHub post makes this diagnosis directly: a vague prompt forces the model to guess at potentially thousands of unstated requirements. The fix is not a smarter model. It is a better page, the main lesson in our comparison of vibe coding vs. spec-driven development.

What does an agent-ready PRD contain?

An agent-ready PRD answers eight questions, in roughly this order. Each one closes a gap the agent would otherwise fill on its own.

Anthropic's guide to effective context engineering for AI agents lands in the same place. It warns against vague, high-level direction that gives the model no concrete signal, and against brittle, hardcoded logic at the other extreme. A good PRD sits in between: firm on outcomes and limits, flexible on how the agent writes the code.

An engraved drafting table holding eight small labeled trays in a row, each tray containing one folded card, with a brass rule and compass laid across the top.

How long should a PRD for AI agents be?

Short enough that every line gets used: one to three pages for most features, and never more than 2,000 words for a single section or change. Length is not a style choice here, because it changes how well the model follows the document.

The best-known evidence is the 2023 paper Lost in the Middle: How Language Models Use Long Contexts by Nelson F. Liu and six coauthors. They found models use information best when it sits at the start or end of the input, and worst when it sits in the middle. In one setup, accuracy with the key document in the middle fell below the score the model got with no documents at all.

Figure 1
Accuracy drops when the key fact sits in the middle
GPT-3.5-Turbo, multi-document question answering with 20 documents, by position of the answer document
Position 1 (start)
75.8%
Position 5
57.2%
Position 10 (middle)
53.8%
Position 15
55.4%
Position 20 (end)
63.2%
No documents (closed book)
56.1%
Source: Liu et al., Lost in the Middle (2023)

Newer models have not escaped the problem. In July 2025, Chroma's Context Rot report tested 18 models, including GPT-4.1, Claude 4, and Gemini 2.5, and found performance grew less reliable as input length grew, even on simple tasks. On one memory benchmark, models did markedly better with a focused prompt of about 300 tokens than with a full prompt of about 113,000 tokens.

Anthropic describes this as an attention budget, where every token you add spends a little of the model's focus. Its advice is to find the smallest set of high-signal tokens that makes the result you want likely. For a PRD, that means cutting background, history, and persuasion, and keeping only what changes the build.

This is why Crema Spec's admission check caps every new section or revision at 2,000 words and turns it away if it does not say who it is for and why. The free Crema PRD skill writes to the same shape, so a draft starts inside the limit instead of being trimmed later. Short pieces also fit a 25-minute review cycle, so a person can actually read each one before approving it.

How do you turn a vague requirement into a testable one?

Rewrite every requirement until a test could fail it. A useful pattern is EARS, the Easy Approach to Requirements Syntax, which Kiro uses for the acceptance criteria in its requirements files. Each line takes the form WHEN a condition happens, THE SYSTEM SHALL do a specific thing.

Vague requirementAgent-ready rewriteWhy it works
Make login secure.WHEN a user enters a wrong password 5 times within 15 minutes, THE SYSTEM SHALL lock the account for 15 minutes and show the lockout message.A test can count attempts, check the lock, and check the timer.
The dashboard should load fast.THE SYSTEM SHALL render the first dashboard chart in under 2 seconds using the seeded test dataset of 10,000 rows.It gives a number, a measure, and a fixture to test against.
Support CSV export.WHEN a user clicks Export, THE SYSTEM SHALL download a UTF-8 CSV with one header row and the same columns shown in the table. Use the existing CSV helper and add no new library.It defines the format, the columns, and a dependency limit.
Handle payment errors gracefully.IF the payment API returns a 5xx error, THE SYSTEM SHALL retry once after 2 seconds, then show the Try Again state and log the error ID.It names the trigger, the retry rule, and the visible result.

Each rewrite has a trigger, a measurable result, and often a limit. Anthropic gives the same advice for standing rules: write instructions concrete enough to verify, such as a specific indentation width instead of a request to format code properly.

CLAUDE.md vs. PRD: what goes where?

CLAUDE.md, AGENTS.md, and Cursor rules hold standing rules for the whole repo. A PRD holds intent for one change. Mixing them is the fastest way to bloat both.

Per Anthropic's Claude Code memory docs, CLAUDE.md loads at the start of every session, works as context rather than enforced configuration, and should stay under 200 lines per file. Claude Code can also read AGENTS.md when a repo has no CLAUDE.md. AGENTS.md is an open format now stewarded by the Agentic AI Foundation under the Linux Foundation, and its site says over 60,000 open-source projects use it.

Cursor's rules docs describe project rules as files in a .cursor/rules folder that live in version control, and they suggest keeping each rule under 500 lines. Cursor also reads AGENTS.md. None of these files is meant to describe a single feature.

FileWhat it holdsHow long it livesLength guidance
CLAUDE.mdStanding project instructions for Claude Code: commands, conventions, and architecture.The life of the repoAnthropic targets under 200 lines per file.
AGENTS.mdOpen-format instructions for many agents: build steps, tests, and code style.The life of the repoNo required fields; keep it focused on what agents need.
Cursor project rulesScoped rule files in .cursor/rules, applied always or by file pattern.The life of the repoCursor suggests under 500 lines per rule.
PRDIntent for one feature or change: who, why, scope, non-goals, limits, and tests.One feature or releaseUnder 2,000 words per section.

Here is a simple test. If an instruction will still be true in six months, it belongs in CLAUDE.md or AGENTS.md. If it is true only until this feature ships, it belongs in the PRD.

When a PRD rule keeps coming back feature after feature, promote it to the standing file and delete it from the template. Keeping the two apart also prevents spec drift, where old feature specs pile up inside a core doc no one can read.

A brass cabinet with a large permanent ledger on its top shelf and a single sealed decision card resting on a small stand in front of it.

Free AI PRD template: which sections should you include?

Copy this table into a new markdown file next to your code. Fill each row with one to five lines, and delete any row that truly does not apply. If you want an agent to draft it with you, the MIT-licensed Crema PRD skill is built for exactly this job.

#SectionWhat to write (one line)
1Title and ownerThe feature name, the person who decides, and today's date.
2Who it is forThe specific user or role, in one sentence.
3Why we are doing thisThe problem and the outcome you expect, with one metric if you have it.
4ScopeThe three to seven behaviors this change must deliver, as a numbered list.
5Non-goalsWhat the agent must not build, touch, or refactor in this change.
6ConstraintsStack, versions, folders in bounds, and performance and security limits.
7DependenciesApproved libraries by name, plus a rule to stop and ask before adding any other.
8Acceptance criteriaTestable WHEN and THE SYSTEM SHALL statements, each mapped to a test.
9ExamplesOne input and expected output per key behavior, or a link to a fixture file.
10Edge casesEmpty states, errors, limits, and permissions the agent must handle.
11Open questionsAnything undecided, with an instruction to stop and ask instead of guessing.
12Definition of doneTests pass, lint passes, and the pull request links back to this PRD.

Put who, why, scope, and non-goals at the top, and acceptance criteria and the definition of done near the end. That keeps the most important rules at the start and end of the document, where models use them best.

What are the steps to write an agent-ready PRD?

  1. Write one sentence on who the change is for and one on why. If you cannot, the feature is not ready for an agent.
  2. List three to seven behaviors in scope, then list at least three non-goals.
  3. Add constraints: stack, versions, folders in bounds, and any security or performance limits.
  4. Name the allowed dependencies and tell the agent to stop and ask before adding new ones.
  5. Rewrite each behavior as a WHEN and THE SYSTEM SHALL statement that a test can pass or fail.
  6. Add one input and output example for each key behavior.
  7. Cut background, history, and persuasion until the document is under 2,000 words.
  8. Move any rule that applies to every feature into CLAUDE.md or AGENTS.md.
  9. Have a person read and approve the PRD before the agent starts, and link it in the pull request.

Teams running many agents at once should also record who approved each PRD and why. Our guide to decision records for AI teams covers that step. For the bigger picture, what is a software factory shows where the PRD sits in a full AI coding pipeline.

Writing agent-ready PRDs is the core skill of the product builder role. That makes this template a strong take-home exercise when you hire for it.

Keep reading

What Is Spec-Driven Development? A Guide for AI Coding Teams

Vibe Coding vs. Spec-Driven Development: When Each One Breaks

What Is Spec Drift? Why AI-Built Software Stops Matching the Plan

How to Hire (or Become) a Product Builder: Skills, Interview Questions, and Team Design

Frequently asked questions

What is the difference between a PRD and a spec for AI agents?

A PRD states the user, the problem, the scope, and how success is tested. A spec often adds technical design and tasks. For agents, both must be short, specific, and testable, so many teams keep them in one document.

Should I put my PRD in CLAUDE.md?

No. CLAUDE.md loads every session, and Anthropic suggests keeping it under 200 lines. Keep standing rules there and put feature intent in a separate PRD file that you point the agent to.

How long should a PRD for Cursor or Claude Code be?

Aim for one to three pages and keep any single section under 2,000 words. Research on long contexts shows models use facts in the middle of long inputs less reliably than facts at the start or end.

What makes an acceptance criterion testable?

It names a trigger, an expected result, and a measurable threshold. If a test cannot pass or fail on the statement, rewrite it. The EARS pattern of WHEN and THE SYSTEM SHALL is a simple way to get there.

Is there a free PRD template for AI coding agents?

Yes. The template in this post is free to copy. Crema PRD at cremaprd.ai is also a free, MIT-licensed skill for writing specs and spec changes for AI coding agents.

Sources and further reading

  1. arXiv (Liu et al.) (2023). Lost in the Middle: How Language Models Use Long Contexts
  2. Chroma (2025). Context Rot: How Increasing Input Tokens Impacts LLM Performance
  3. Anthropic (2025). Effective context engineering for AI agents
  4. Anthropic (2026). How Claude remembers your project (Claude Code docs)
  5. AGENTS.md (2026). AGENTS.md: a simple, open format for guiding coding agents
  6. Cursor (2026). Rules (Cursor docs)
  7. GitHub (2025). Spec-driven development with AI: Get started with a new open source toolkit
  8. Kiro (2026). Specs: concepts (Kiro docs)
  9. Crema (2026). Research and bibliography