A free PRD template your AI coding agent can actually build from
Most PRD templates are written for a human reader. That was fine when a human was the only reader. Now the reader is often Cursor, Claude Code, or Windsurf — and a prose-only PRD leaves that reader guessing at exactly the things that break a build: table names, payload shapes, and who may see which rows.
I kept hitting the same wall: hand a chatbot-written PRD to Cursor, and spend days fixing a database that did not match the document. The fix was not a better prompt. It was writing the schema and the contracts before the code, so there was nothing left for the agent to guess.
So I made the template I wished I had — four parts that must agree with each other — and put it on GitHub for free: https://github.com/web-dev-mehedi/ai-prd-template
You can also read it on the site with a worked example: https://webdevmehedi.com/prd-template
Part 1 — The core PRD (what and why)
The part everyone recognises: product summary, problem and evidence, one primary goal with a way to measure it, non-goals, users and roles (including what each role must never do), 2–4 user journeys end to end, and numbered functional requirements (FR-1, FR-2…) each with a priority and an acceptance check you can actually test.
Two rules from experience:
- Mark guesses as guesses. A PRD that presents an assumption as a fact sends the agent building the wrong thing confidently.
- Write the failure state of every journey. Software breaks in the edge cases — empty states, failed payments, timeouts — and if you answer them now, the agent does not invent an answer mid-build.
Part 2 — The database schema (fix the data first)
Real table names, real columns, real relationships — before any code exists. If you leave this vague, Cursor invents its own tables, and then your PRD and your database disagree for the rest of the project.
The template includes a Row Level Security block for Supabase/PostgreSQL, because multi-tenancy is a day-one decision, not a patch: one sentence that says who can see which rows, and a policy that enforces it. In the template's worked mini-example, a shop owner can only ever see their own shop's stock — products references shops, and the RLS policy enforces that boundary.
Part 3 — API contracts (fix the shapes next)
One block per endpoint or server action: method and path, who may call it, the request shape, the success shape, and the error cases. The template shows a Zod validation block, because typed contracts are what stop the frontend and backend from drifting apart halfway through the build.
Agree the payload shape before code exists, and the agent cannot change it silently later.
Part 4 — Rules for your agent (pin it to parts 1–3)
This is the part most templates skip, and it does more than any amount of prompt engineering. Paste it into your agent's rules file (.cursor/rules, CLAUDE.md) and it says, in short:
- Build only what Part 1 requires. If a requirement is unclear, stop and ask — do not invent behaviour.
- Use the table and column names in Part 2 exactly. Never invent a column, table, or relationship.
- Use the request/response shapes in Part 3 exactly. Never change a payload without updating Part 3 first.
- Never bypass Row Level Security in application code.
- After building each requirement, run its acceptance check and report the result.
- If Parts 1–3 disagree, report the conflict instead of choosing silently.
That last rule is the important one. An agent that flags a conflict is useful; an agent that picks silently is a bug factory.
The worked mini-example
The template ends with a small fictional example — ShopStock, a stock list app for small shops — so you can see all four parts filled in for one real feature: FR-1 (record a product with a stock count), the products table with its RLS policy, and the POST /api/products contract with its Zod schema. Copy the structure, replace the brackets, delete the guidance notes as you go.
If you would rather generate than fill in
The template is free and stays free — no signup, no card. If you want the same four-part structure generated from one paragraph instead of filled in by hand, the generator that uses it produces all four files in under 60 seconds: https://webdevmehedi.com/ai-prd-generator — 50 free credits on signup, plans from ৳99/mo with bKash and Nagad.
Either way, the principle is the same: a PRD is not enough anymore. The agent needs the schema, the contracts, and the rules — all four agreeing — before it writes a single line of code.
Top comments (0)