PRP Generator
Overview
Generates comprehensive Product Requirement Plans (PRPs) that enable AI agents to implement features in a single pass. Combines systematic codebase analysis with external research to create detailed, context-rich implementation blueprints.
When to Use
- User requests a PRP, PRD, or detailed implementation plan
- User asks to "plan out" or "design" a complex feature
- Beginning significant feature development that benefits from structured planning
- User provides a feature description file and asks for implementation guidance
Core Principle
Context is Everything: The implementing agent only receives the PRP content, training data knowledge, codebase access, and WebSearch. Your PRP must be self-contained with all necessary context, specific references, and executable validation gates.
Workflow
Phase 1: Understand the Feature
- Read the feature request - if a file path is given, read it completely; if verbal, clarify requirements
- Clarify ambiguities - use AskUserQuestion for unclear requirements, confirm tech stack, verify integration points
- Identify the core problem being solved and acceptance criteria
Phase 2: Codebase Analysis (Mandatory)
Goal: Understand existing patterns, conventions, and integration points.
Systematically analyse the codebase across five dimensions:
| Area |
What to Capture |
| Similar features |
File paths, line numbers, code snippets, adaptations needed |
| Architecture |
Directory conventions, component organisation, state management, API patterns |
| Coding conventions |
TypeScript usage, component patterns, styling, import ordering, naming |
| Test patterns |
Framework, file naming, mock strategies, coverage expectations |
| Configuration |
Dependencies, build setup, path aliases, TypeScript settings |
For detailed sub-steps, examples, and documentation templates, see references/codebase-analysis-guide.md.
Also refer to references/research_methodology.md for the full research process.
Phase 3: External Research (Mandatory)
Goal: Find best practices, documentation, examples, and gotchas.
Research across four areas:
| Area |
Key Actions |
| Library documentation |
Find official docs for the SPECIFIC version from package.json; note version-specific gotchas |
| Implementation examples |
Search GitHub, StackOverflow, official examples; prefer recent, production-grade code |
| Best practices |
Search "[technology] best practices [current year]"; check OWASP for security |
| Performance and security |
Bundle size implications, runtime patterns, vulnerabilities, accessibility |
Always document exact URLs, versions, and specific sections. See references/research_methodology.md for detailed guidance.
Phase 4: Ultra-Thinking (Critical)
STOP AND THINK DEEPLY BEFORE WRITING THE PRP.
Analyse integration points, implementation ordering, validation strategy, and context completeness. Verify the PRP will enable one-pass implementation without questions.
For the full set of analysis questions and the quality checklist, see references/quality-assessment.md.
Phase 5: Generate the PRP
Use assets/prp_template.md as the base structure. Populate all sections:
- Metadata - feature name, timeline, confidence score (1-10), date
- Executive Summary - 2-3 sentences with core value proposition
- Research Findings - codebase analysis (file:line refs) and external research (URLs, versions)
- Technical Specification - architecture, components, data models, API endpoints
- Implementation Blueprint - prerequisites, step-by-step with pseudocode, file changes, error handling, edge cases
- Testing Strategy - unit, integration, and manual testing approaches
- Validation Gates - must be EXECUTABLE commands (e.g.
npm run test && npm run build)
- Success Criteria - clear, measurable checklist
Phase 6: Quality Scoring
Score the PRP for one-pass implementation success:
| Score |
Meaning |
| 9-10 |
Exceptionally detailed, all context included, clear path, executable gates |
| 7-8 |
Very good, minor gaps, mostly clear implementation path |
| 5-6 |
Adequate, some ambiguity, may require clarification |
| 3-4 |
Incomplete research, missing context, unclear path |
| 1-2 |
Insufficient for implementation |
If score is below 7: Go back and improve the PRP before delivering.
Phase 7: Save and Deliver
- Save the PRP to
PRPs/[feature-name].md (kebab-case, create directory if needed)
- Deliver summary to user with: brief feature summary, file location, confidence score with rationale, and next steps
Common Pitfalls
| Pitfall |
Bad |
Good |
| Vague references |
"There's a similar component somewhere" |
"See UserProfile at src/components/UserProfile.tsx:45-67" |
| Missing versions |
"Use React Query" |
"Use @tanstack/react-query v5.28.0" |
| Non-executable gates |
"Run tests and make sure they pass" |
npm run test && npm run build |
| Generic advice |
"Follow React best practices" |
"Use named exports (see src/components/Button.tsx:1)" |
| Incomplete research |
Skipping codebase analysis |
Thoroughly document existing patterns |
| Missing gotchas |
Assuming smooth implementation |
Document known issues and edge cases |
Example Usage
User: "Create a PRP for adding dark mode support to the application"
- Clarify: "Should dark mode preference persist across sessions? Should it respect system preferences?"
- Research codebase for theme-related code
- Research external resources (dark mode best practices, library options)
- Ultra-think about implementation approach
- Generate comprehensive PRP using template
- Score the PRP
- Save to
PRPs/dark-mode-support.md
- Deliver summary with confidence score
Resources
| Resource |
Description |
| assets/prp_template.md |
Base template for all PRPs |
| references/research_methodology.md |
Detailed research guidance and best practices |
| references/codebase-analysis-guide.md |
Detailed codebase analysis sub-steps and examples |
| references/quality-assessment.md |
Ultra-thinking analysis questions and quality checklist |
Key Reminders
- Research is mandatory - never skip codebase or external research
- Be specific - always include file paths, line numbers, URLs, versions
- Think deeply - Phase 4 (Ultra-Thinking) is critical for success
- Validate everything - all validation gates must be executable
- Score honestly - if confidence is below 7, improve the PRP
- Context is king - the implementer only has what you put in the PRP
1---2name: prp-generator3description: Generate comprehensive Product Requirement Plans (PRPs) for feature implementation with thorough codebase analysis and external research. Use when the user requests a PRP, PRD, or detailed implementation plan for a new feature. Conducts systematic research, identifies patterns, and creates executable validation gates for one-pass implementation success. Do NOT use for client discovery, requirements gathering, or scope definition - use scope-clarifier for those.4---5
6# PRP Generator
7
8## Overview
9
10Generates comprehensive Product Requirement Plans (PRPs) that enable AI agents to implement features in a single pass. Combines systematic codebase analysis with external research to create detailed, context-rich implementation blueprints.
11
12## When to Use
13
14- User requests a PRP, PRD, or detailed implementation plan
15- User asks to "plan out" or "design" a complex feature
16- Beginning significant feature development that benefits from structured planning
17- User provides a feature description file and asks for implementation guidance
18
19## Core Principle
20
21**Context is Everything**: The implementing agent only receives the PRP content, training data knowledge, codebase access, and WebSearch. Your PRP must be self-contained with all necessary context, specific references, and executable validation gates.
22
23## Workflow
24
25### Phase 1: Understand the Feature
26
271. **Read the feature request** - if a file path is given, read it completely; if verbal, clarify requirements
282. **Clarify ambiguities** - use AskUserQuestion for unclear requirements, confirm tech stack, verify integration points
293. **Identify the core problem** being solved and acceptance criteria
30
31### Phase 2: Codebase Analysis (Mandatory)
32
33**Goal**: Understand existing patterns, conventions, and integration points.
34
35Systematically analyse the codebase across five dimensions:
36
37| Area | What to Capture |
38|------|----------------|
39| Similar features | File paths, line numbers, code snippets, adaptations needed |
40| Architecture | Directory conventions, component organisation, state management, API patterns |
41| Coding conventions | TypeScript usage, component patterns, styling, import ordering, naming |
42| Test patterns | Framework, file naming, mock strategies, coverage expectations |
43| Configuration | Dependencies, build setup, path aliases, TypeScript settings |
44
45For detailed sub-steps, examples, and documentation templates, see [references/codebase-analysis-guide.md](references/codebase-analysis-guide.md).
46
47Also refer to [references/research_methodology.md](references/research_methodology.md) for the full research process.
48
49### Phase 3: External Research (Mandatory)
50
51**Goal**: Find best practices, documentation, examples, and gotchas.
52
53Research across four areas:
54
55| Area | Key Actions |
56|------|------------|
57| Library documentation | Find official docs for the SPECIFIC version from package.json; note version-specific gotchas |
58| Implementation examples | Search GitHub, StackOverflow, official examples; prefer recent, production-grade code |
59| Best practices | Search "[technology] best practices [current year]"; check OWASP for security |
60| Performance and security | Bundle size implications, runtime patterns, vulnerabilities, accessibility |
61
62Always document exact URLs, versions, and specific sections. See [references/research_methodology.md](references/research_methodology.md) for detailed guidance.
63
64### Phase 4: Ultra-Thinking (Critical)
65
66**STOP AND THINK DEEPLY BEFORE WRITING THE PRP.**
67
68Analyse integration points, implementation ordering, validation strategy, and context completeness. Verify the PRP will enable one-pass implementation without questions.
69
70For the full set of analysis questions and the quality checklist, see [references/quality-assessment.md](references/quality-assessment.md).
71
72### Phase 5: Generate the PRP
73
74Use [assets/prp_template.md](assets/prp_template.md) as the base structure. Populate all sections:
75
761. **Metadata** - feature name, timeline, confidence score (1-10), date
772. **Executive Summary** - 2-3 sentences with core value proposition
783. **Research Findings** - codebase analysis (file:line refs) and external research (URLs, versions)
794. **Technical Specification** - architecture, components, data models, API endpoints
805. **Implementation Blueprint** - prerequisites, step-by-step with pseudocode, file changes, error handling, edge cases
816. **Testing Strategy** - unit, integration, and manual testing approaches
827. **Validation Gates** - must be EXECUTABLE commands (e.g. `npm run test && npm run build`)
838. **Success Criteria** - clear, measurable checklist
84
85### Phase 6: Quality Scoring
86
87Score the PRP for one-pass implementation success:
88
89| Score | Meaning |
90|-------|---------|
91| 9-10 | Exceptionally detailed, all context included, clear path, executable gates |
92| 7-8 | Very good, minor gaps, mostly clear implementation path |
93| 5-6 | Adequate, some ambiguity, may require clarification |
94| 3-4 | Incomplete research, missing context, unclear path |
95| 1-2 | Insufficient for implementation |
96
97**If score is below 7**: Go back and improve the PRP before delivering.
98
99### Phase 7: Save and Deliver
100
1011. **Save** the PRP to `PRPs/[feature-name].md` (kebab-case, create directory if needed)
1022. **Deliver summary** to user with: brief feature summary, file location, confidence score with rationale, and next steps
103
104## Common Pitfalls
105
106| Pitfall | Bad | Good |
107|---------|-----|------|
108| Vague references | "There's a similar component somewhere" | "See UserProfile at src/components/UserProfile.tsx:45-67" |
109| Missing versions | "Use React Query" | "Use @tanstack/react-query v5.28.0" |
110| Non-executable gates | "Run tests and make sure they pass" | `npm run test && npm run build` |
111| Generic advice | "Follow React best practices" | "Use named exports (see src/components/Button.tsx:1)" |
112| Incomplete research | Skipping codebase analysis | Thoroughly document existing patterns |
113| Missing gotchas | Assuming smooth implementation | Document known issues and edge cases |
114
115## Example Usage
116
117**User**: "Create a PRP for adding dark mode support to the application"
118
1191. Clarify: "Should dark mode preference persist across sessions? Should it respect system preferences?"
1202. Research codebase for theme-related code
1213. Research external resources (dark mode best practices, library options)
1224. Ultra-think about implementation approach
1235. Generate comprehensive PRP using template
1246. Score the PRP
1257. Save to `PRPs/dark-mode-support.md`
1268. Deliver summary with confidence score
127
128## Resources
129
130| Resource | Description |
131|----------|------------|
132| [assets/prp_template.md](assets/prp_template.md) | Base template for all PRPs |
133| [references/research_methodology.md](references/research_methodology.md) | Detailed research guidance and best practices |
134| [references/codebase-analysis-guide.md](references/codebase-analysis-guide.md) | Detailed codebase analysis sub-steps and examples |
135| [references/quality-assessment.md](references/quality-assessment.md) | Ultra-thinking analysis questions and quality checklist |
136
137## Key Reminders
138
139- **Research is mandatory** - never skip codebase or external research
140- **Be specific** - always include file paths, line numbers, URLs, versions
141- **Think deeply** - Phase 4 (Ultra-Thinking) is critical for success
142- **Validate everything** - all validation gates must be executable
143- **Score honestly** - if confidence is below 7, improve the PRP
144- **Context is king** - the implementer only has what you put in the PRP