How to write a PRD for AI coding tools that actually ship the right code
A PRD written for a human reader and a PRD written for an AI coding agent look different. The human version assumes context, infers missing pieces, and tolerates ambiguity. The AI version has to spell out the file tree, the schema, the API contract, the success criteria with numbers, and the out-of-scope list. Get the shape right and Lovable, Cursor, Bolt, v0, Claude Code, Codex, Replit, or Windsurf will ship something close to what you meant on the first try. Get it wrong and you burn an afternoon of clarifying-question round-trips.
The minimum shape that works across every tool
A PRD that runs cleanly through any 2026 AI builder has eight sections. None of them can be skipped. The order matters.
- TL;DR. Two to four sentences. What is being built, for whom, by when, and what counts as success. This is the section the agent reads first and references when it has to make a choice.
- Goals. Business goals and user goals, separately. Each goal must include a number. "Increase retention" is not a goal; "reduce 30-day churn from 12% to 8%" is.
- Personas. Two to three primary users. Each with a name, a context (role, company size), and the friction they're feeling today.
- Functional requirements with priority. P0 (must ship), P1 (should ship), P2 (nice to have). Number them. Reference them in test scenarios.
- UX flow. A list of screens or states. For each, what data is shown, what actions exist, what happens on success and failure.
- Success metrics. User-centric (engagement, conversion), business (revenue, retention), technical (latency, error rate). Each with a target number.
- Technical considerations. Stack hints, integrations, constraints. This is where you tell the AI tool what defaults to assume.
- Out of scope. Explicit non-goals. The agent will otherwise build the thing you didn't ask for, eat tokens, and surprise you.
Tool-specific sections that change everything
The eight sections above are the universal shell. Each AI tool wants a different appendix.
| Tool | Required appendix | What to include |
|---|---|---|
| Lovable | Supabase schema | Tables, columns, RLS policies, storage buckets |
| v0 | Component list | Hero, Pricing, Dashboard with state and props |
| Bolt | Stack declaration | Framework, database, deploy target |
| Cursor | File tree + task list | Every file the agent should create, ordered tasks |
| Claude Code | Plan file | Phases with file paths and acceptance per phase |
| Codex | GitHub issue body | Title, acceptance, branch name, PR count |
| Windsurf | Goal + acceptance | High-level goal, then numbered acceptance criteria |
| Replit | Language + runtime | Python/Go/Node, deploy target, secrets list |
Writing the wrong appendix doesn't break the build, but it wastes one full agent run as the tool re-asks for the right shape. Plan for the tool you're using before drafting.
Length: long enough to be specific, short enough to be read
The sweet spot is 800 to 2000 words. Under 800 and you're leaving too much to the agent's imagination. Over 2000 and you're burning context window on prose the agent will skim. The eight-section structure above usually lands in this range without padding.
A common failure is over-writing the personas section. A persona doesn't need a backstory; it needs a name, a role, and one friction point. Three sentences each, three personas, 9 sentences total. Stop there.
Avoid these anti-patterns
These wreck the agent run more often than not.
- Vague success criteria. "Users find it intuitive" is unmeasurable. "80% of new users complete onboarding within 5 minutes" is.
- Implementation details disguised as requirements. "Use a Postgres database with a
userstable" mixes the what with the how. Put implementation in the technical section, not the requirements list. - Open-ended scope. "And anything else that improves the experience." The agent will obediently invent things. List the out-of-scope items explicitly.
- Hidden assumptions. "It should work like Linear's keyboard shortcuts" assumes the agent has internalized Linear. Spell out the actual behavior.
- Missing acceptance per requirement. Every P0 item should have a paired acceptance line. "P0-1: Users can export their data as CSV. Acceptance: a 1,000-row export downloads in under 3 seconds."
- Single-paragraph prose dumps. AI tools parse structure. Use bullets, numbered lists, tables, and headers. Prose paragraphs are read; structured content is followed.
A real PRD that ships
Title: ChirpDigest — daily email digest of a Twitter list
TL;DR: A web app where users connect their Twitter account, pick a list, and receive a daily 7am email summarizing the top 10 tweets from that list. Target: solo developers and analysts who want to skim a curated feed without opening Twitter. Success: 100 paying users at $5/mo within 90 days of launch.
Goals (business):
- 100 paying users at $5/mo within 90 days
- $500 MRR by day 90
- Under 30% monthly churn
Goals (user):
- Skim 10 best tweets per day in under 90 seconds
- Skip opening Twitter on a non-Twitter day at least 4 days per week
- Configure list selection in under 60 seconds during onboarding
Personas:
- Anika, indie founder: runs a 3-person SaaS, follows 400 accounts but only cares about 30. Wants the signal without the algorithm.
- Tom, analyst: tracks 50 fintech VCs in a list. Doesn't open Twitter daily but doesn't want to miss a quote.
Functional requirements (P0):
- P0-1. OAuth into Twitter. Acceptance: user authorizes and lands on the list-picker in under 30 seconds.
- P0-2. Pick one Twitter list from the user's existing lists. Acceptance: list options load in under 2 seconds; user can change selection anytime.
- P0-3. Daily email job at 7am user-local time. Acceptance: 99% delivery rate across a 30-day window.
- P0-4. Top-10 tweet selection algorithm. Acceptance: ranked by engagement (likes + retweets) over the prior 24 hours.
- P0-5. Stripe checkout for $5/mo subscription with 7-day free trial. Acceptance: 80% of trial-starters complete card entry.
Functional requirements (P1):
- P1-1. "Why this tweet?" tooltip on hover showing engagement numbers.
- P1-2. Web archive of the last 30 digests, viewable in the app.
UX flow: 4 screens.
- Marketing landing → CTA "Start free trial"
- OAuth + list picker
- Digest archive (web)
- Settings (email time, pause, cancel)
Success metrics:
- Open rate on daily emails: 50%+
- Click-through rate to a tweet: 15%+
- Trial-to-paid conversion: 25%+
- Weekly active users: 70% of subscribers
Technical considerations:
- Stack: Next.js + Drizzle + Neon, deploy to Vercel
- Email: Resend with daily cron via Vercel Cron Jobs
- Twitter API tier: Basic ($100/mo, 10k reads/month — sufficient for first 200 users)
- Stripe for billing, with webhook for cancellation handling
Cursor appendix — file tree:
app/
page.tsx // marketing landing
api/auth/twitter/route.ts // OAuth callback
api/cron/daily-digest/route.ts // 7am job
app/dashboard/page.tsx // digest archive
app/settings/page.tsx // user settings
db/schema.ts // users, subscriptions, digests
lib/twitter/list.ts // fetch list members
lib/twitter/rank.ts // engagement ranking
lib/email/digest.tsx // Resend email template
Cursor appendix — ordered tasks:
- Scaffold Next.js + Drizzle + Neon, wire auth
- Twitter OAuth flow
- List picker UI
- Top-10 ranking logic + tests
- Resend email template + cron job
- Stripe checkout + webhook
- Digest archive UI
- Polish, error states, deploy
Out of scope (explicitly):
- Multi-list support (only one list per user in v1)
- Twitter posting (read-only)
- Mobile app (web only in v1)
- Custom delivery times beyond hourly granularity
How long this PRD took to write
Twenty-five minutes from blank doc to the version above. The structure is the lever. Once you've internalized the eight sections and the per-tool appendix, you stop staring at a blank page and start filling slots. Most PRDs that ship cleanly with AI tools follow this exact shape.
The fastest way to get good at this
- Write your next PRD using MakeMyPRD as the starting point. It produces the eight-section structure from a one-paragraph idea in under a minute.
- Add the tool-specific appendix yourself. The generator can't know which tool you're using; you do.
- Run the PRD through the agent and see what it asks back. Every clarifying question is a section you should have written better. Add it to your template.
- Save your favorite PRDs as references. After 3 to 5, you'll have a personal style that's faster to apply than starting from scratch.
- Date them. A PRD written in February 2026 may not reflect the tools you use in November 2026. Versioning matters.
FAQ
Should I include code in the PRD?
Almost never. Include the file tree, the schema definitions, and the API contracts. Don't include actual implementation code — the agent should write that. The exception is a single short example showing the expected shape (e.g., a 5-line type signature for a custom hook).
How do I handle a feature that needs back-and-forth design exploration?
Don't put it in the PRD as a single feature. Break it into a small v1 you can fully spec, then plan iteration cycles after seeing the v1 work. PRDs are not the place for "we'll figure it out as we go" — the agent will figure something out, and it probably won't be what you wanted.
What if my PRD is for an existing codebase, not a green-field project?
Add a "Current state" section between TL;DR and Goals. Describe the existing files, schema, and patterns the agent should respect. Most AI tools (especially Cursor and Claude Code) can read the repo, but a written summary still helps focus the agent on the relevant slice.
How do I write a PRD for an AI agent product?
Same structure, with an extra section on the agent's capabilities, the tool's it has access to, and the success criteria for autonomous behavior. The PRD template for AI Agent linked below has the full shape.
Do I need to write a new PRD for every feature?
No. For small features (under 1 day of work), a one-page brief is fine. For features that touch 3+ files or 2+ team members, a full PRD pays for itself. The signal is whether you'd want a written record if someone asked "what was supposed to happen here" in six months.