How to Write a Product Requirements Document (PRD)
CRITICAL: MUST save the final PRD to a file (e.g., documents/prd-<slug>.md). Do NOT only output in chat — always persist to disk.
When generating or refining a Product Requirements Document (PRD), follow these
guidelines to ensure clarity, completeness, and alignment. This rule is designed
to apply "Prompt Engineering" principles—clarity, constraints, and structure—to
documentation.
0. Question Format (FR-UNIVERSAL.QA-FORMAT)
When asking the user a choice (audience, constraints, timeline):
- Each question MUST be a numbered list item (
1., 2., …) — not a heading, bold-only line, or paragraph.
- For multi-select questions, when the user delegates with
agent's choice (or equivalent), pick the subset yourself, emit a one-line justification of the pick, and proceed without re-asking for confirmation.
1. Core Principles
- Outcome-Oriented: Focus on the value delivered to the user, not just the
technical implementation.
- Measurable: Requirements must be testable. Avoid vague terms like "fast"
or "reliable" without metrics.
- Unambiguous: Remove ambiguity. If a requirement can be interpreted in
multiple ways, it is a bug in the PRD.
- Living Document: Acknowledge that the PRD evolves. Mark unknowns clearly.
2. Writing Strategy (AI Instructions)
When asked to write a PRD:
- Analyze the Request: Identify the core problem, target audience, and
business goal.
- Ask Clarifying Questions: If key context is missing (e.g., "Who is this
for?", "What are the constraints?"), ask the user before generating the full
doc. Follow the Question Format section above (FR-UNIVERSAL.QA-FORMAT).
- Drafting: Use the template below.
- Review: Check against the "Bad vs Good" examples in Section 4.
- Persist: MUST write the final PRD to a file (e.g.,
documents/prd-<slug>.md
or a path specified by the user). Do NOT only output the PRD in chat — always
save it to disk using the file write tool (Write, write_to_file, etc.).
3. PRD Template
[PRD] {Title} {Status: Draft/Review/Approved}
1. Executive Summary
- Problem Statement: Clear, concise description of the user pain point or
business opportunity.
- Proposed Solution: High-level overview of the feature/product.
- Value Proposition: Why is this important? What is the expected impact?
2. Success Metrics (KPIs)
- Primary Metric: The one number that defines success (e.g., Conversion Rate
+5%).
- Guardrail Metrics: What specific negative outcomes must we avoid? (e.g.,
Latency < 200ms, Error rate < 1%).
3. Scope & User Stories
Target Audience: [Persona Name] - [Short Description]
| ID |
User Story |
Acceptance Criteria |
Priority |
| US-1 |
As a [User], I want to [Action] so that [Benefit] |
1. Criterion A2. Criterion B |
P0 |
Out of Scope:
- List specific features or use cases that are explicitly excluded to prevent
scope creep.
4. Functional Requirements
- Core Logic: Detailed business rules (e.g., "If user is unverified,
restrict access to X").
- Edge Cases: Empty states, error states, offline behavior.
- Data Requirements: Fields, validation rules, sources.
5. Non-Functional Requirements
- Performance: Latency, throughput, load expectations.
- Security: Authentication, authorization, data privacy (GDPR/PII).
- Compatibility: Browsers, devices, OS versions.
6. User Experience (UX)
- Flow: Describe the user journey (or insert Mermaid diagram).
- UI Elements: Key inputs, outputs, and feedback mechanisms.
7. Dependencies & Risks
- Dependencies: APIs, other teams, third-party services.
- Risks: Technical challenges, compliance issues, adoption risks.
- Mitigation: How will we handle these risks?
8. Open Questions
- List of unresolved questions that need input from stakeholders or technical
research.
4. Examples: "Bad" vs "Good" Requirements
Ambiguity vs. Specificity
- 🔴 Bad: "The system should be fast."
- 🟢 Good: "API response time must be under 200ms for 95% of requests at a
load of 100 QPS."
Implementation vs. Intent
- 🔴 Bad: "Add a blue button that says Save."
- 🟢 Good: "The user must be able to persist their changes. The action
should be prominent and follow the primary action style guide."
Error Handling
- 🔴 Bad: "Handle errors gracefully."
- 🟢 Good: "If the backend is unreachable, display a toast notification with
the message 'Connection failed, retrying...' and automatically retry 3 times
with exponential backoff."
5. Visuals
Use Mermaid diagrams where possible to illustrate flows:
graph TD
A[User Starts] --> B{Logged In?}
B -- Yes --> C[Dashboard]
B -- No --> D[Login Page]
1---2name: write-prd3description: Produce a comprehensive Product Requirements Document (PRD) for a product feature. Use when the user asks to write a PRD or formalize a product feature's scope, goals, user value, and success metrics. Not for internal technical/engineering change proposals (those argue for a code/architecture change, not a product feature).4---56# How to Write a Product Requirements Document (PRD)78> **CRITICAL**: MUST save the final PRD to a file (e.g., `documents/prd-<slug>.md`). Do NOT only output in chat — always persist to disk.910When generating or refining a Product Requirements Document (PRD), follow these11guidelines to ensure clarity, completeness, and alignment. This rule is designed12to apply "Prompt Engineering" principles—clarity, constraints, and structure—to13documentation.1415## 0. Question Format (FR-UNIVERSAL.QA-FORMAT)1617When asking the user a choice (audience, constraints, timeline):1819- Each question MUST be a numbered list item (`1.`, `2.`, …) — not a heading, bold-only line, or paragraph.20- For multi-select questions, when the user delegates with `agent's choice` (or equivalent), pick the subset yourself, emit a one-line justification of the pick, and proceed without re-asking for confirmation.2122## 1. Core Principles2324- **Outcome-Oriented**: Focus on the _value_ delivered to the user, not just the25 technical implementation.26- **Measurable**: Requirements must be testable. Avoid vague terms like "fast"27 or "reliable" without metrics.28- **Unambiguous**: Remove ambiguity. If a requirement can be interpreted in29 multiple ways, it is a bug in the PRD.30- **Living Document**: Acknowledge that the PRD evolves. Mark unknowns clearly.3132## 2. Writing Strategy (AI Instructions)3334When asked to write a PRD:35361. **Analyze the Request**: Identify the core problem, target audience, and37 business goal.382. **Ask Clarifying Questions**: If key context is missing (e.g., "Who is this39 for?", "What are the constraints?"), ask the user before generating the full40 doc. Follow the **Question Format** section above (FR-UNIVERSAL.QA-FORMAT).413. **Drafting**: Use the template below.424. **Review**: Check against the "Bad vs Good" examples in Section 4.435. **Persist**: MUST write the final PRD to a file (e.g., `documents/prd-<slug>.md`44 or a path specified by the user). Do NOT only output the PRD in chat — always45 save it to disk using the file write tool (Write, write_to_file, etc.).4647## 3. PRD Template4849### [PRD] {Title} {Status: Draft/Review/Approved}5051#### 1. Executive Summary5253- **Problem Statement**: Clear, concise description of the user pain point or54 business opportunity.55- **Proposed Solution**: High-level overview of the feature/product.56- **Value Proposition**: Why is this important? What is the expected impact?5758#### 2. Success Metrics (KPIs)5960- **Primary Metric**: The one number that defines success (e.g., Conversion Rate61 +5%).62- **Guardrail Metrics**: What specific negative outcomes must we avoid? (e.g.,63 Latency < 200ms, Error rate < 1%).6465#### 3. Scope & User Stories6667**Target Audience**: [Persona Name] - [Short Description]6869| ID | User Story | Acceptance Criteria | Priority |70| ---- | ------------------------------------------------- | -------------------------------- | -------- |71| US-1 | As a [User], I want to [Action] so that [Benefit] | 1. Criterion A<br>2. Criterion B | P0 |7273**Out of Scope**:7475- List specific features or use cases that are explicitly excluded to prevent76 scope creep.7778#### 4. Functional Requirements7980- **Core Logic**: Detailed business rules (e.g., "If user is unverified,81 restrict access to X").82- **Edge Cases**: Empty states, error states, offline behavior.83- **Data Requirements**: Fields, validation rules, sources.8485#### 5. Non-Functional Requirements8687- **Performance**: Latency, throughput, load expectations.88- **Security**: Authentication, authorization, data privacy (GDPR/PII).89- **Compatibility**: Browsers, devices, OS versions.9091#### 6. User Experience (UX)9293- **Flow**: Describe the user journey (or insert Mermaid diagram).94- **UI Elements**: Key inputs, outputs, and feedback mechanisms.9596#### 7. Dependencies & Risks9798- **Dependencies**: APIs, other teams, third-party services.99- **Risks**: Technical challenges, compliance issues, adoption risks.100- **Mitigation**: How will we handle these risks?101102#### 8. Open Questions103104- List of unresolved questions that need input from stakeholders or technical105 research.106107## 4. Examples: "Bad" vs "Good" Requirements108109**Ambiguity vs. Specificity**110111- 🔴 **Bad**: "The system should be fast."112- 🟢 **Good**: "API response time must be under 200ms for 95% of requests at a113 load of 100 QPS."114115**Implementation vs. Intent**116117- 🔴 **Bad**: "Add a blue button that says Save."118- 🟢 **Good**: "The user must be able to persist their changes. The action119 should be prominent and follow the primary action style guide."120121**Error Handling**122123- 🔴 **Bad**: "Handle errors gracefully."124- 🟢 **Good**: "If the backend is unreachable, display a toast notification with125 the message 'Connection failed, retrying...' and automatically retry 3 times126 with exponential backoff."127128## 5. Visuals129130Use Mermaid diagrams where possible to illustrate flows:131132```mermaid133graph TD134 A[User Starts] --> B{Logged In?}135 B -- Yes --> C[Dashboard]136 B -- No --> D[Login Page]137```