This command creates a comprehensive Product Requirement Document OR refines an existing PRD with thoughtful analysis.
Creates or refines comprehensive Product Requirement Documents with detailed analysis and stakeholder-ready specifications.
/plugin marketplace add dionridley/claude-plugins/plugin install project-management@dion-toolsThis command creates a comprehensive Product Requirement Document OR refines an existing PRD with thoughtful analysis.
You are executing the /dr-prd command in dual-mode: CREATE or REFINE.
CRITICAL: The command arguments are provided in the <command-args> tag at the top of this message.
<command-args> value:
@ → REFINE mode (jump to "REFINE Mode" section below)@ → CREATE mode (continue with steps below)Check the <command-args> tag for arguments:
<command-args> contains text (not empty): Use it as the feature description<command-args> is empty: Ask user interactively for detailed feature descriptionInteractive prompt (if needed):
CRITICAL: Check current date/time
Use extended thinking to deeply analyze the feature request:
Extract feature name:
Read PRD template:
${CLAUDE_PLUGIN_ROOT}/templates/prd-template.mdCreate PRD file:
_claude/prd/[feature-slug].mdThoughtfully populate ALL sections based on your analysis:
Metadata:
Problem Statement:
Goals and Objectives:
User Stories:
Functional Requirements:
Non-Functional Requirements:
Technical Considerations:
Dependencies:
Timeline and Milestones:
Risks and Mitigation:
Open Questions:
References:
Refinement History:
If critical information is missing:
✅ PRD created: _claude/prd/[feature-slug].md
Comprehensive PRD includes:
- Problem statement and goals (filled in based on your prompt)
- User stories with acceptance criteria
- Functional and non-functional requirements
- Technical considerations and architecture notes
- Dependencies and risks
- Success metrics and timeline
Key Considerations Identified:
- [3-5 important points you identified while analyzing]
Next steps:
1. Review and refine the PRD
2. Discuss with stakeholders
3. Refine if needed: /dr-prd @_claude/prd/[feature-slug].md [changes]
4. Create implementation plan: /dr-plan [implementation context]
Extract components from the <command-args> tag value:
@ until next space or flag
@_claude/prd/auth-system.md--no-confirm (if present, skip confirmation step)Parse the file path:
@ prefixCheck if file exists:
Verify it's a PRD file:
If validation fails, show helpful error:
❌ PRD file not found: [path]
Available PRDs in _claude/prd/:
- authentication-system.md
- realtime-collaboration.md
- notification-service.md
Usage: /dr-prd @_claude/prd/[filename].md [refinement request]
Tip: Use tab completion for file paths
Read the PRD file completely
Parse metadata:
Parse all sections:
Check PRD status:
If Superseded:
❌ Cannot refine Superseded PRD
PRD: [Feature Name] (v[version])
Status: Superseded
Superseded by: [new-file-name] (if mentioned)
This is a historical version and should not be modified.
Instead:
1. Refine the current version: /dr-prd @_claude/prd/[current-version].md [changes]
2. Create a new major version if needed: /dr-prd [new requirements based on current]
If Approved:
If Under Review:
If Draft:
Search for linked plans:
CRITICAL: You MUST execute BOTH methods below. Do not skip Method 1!
METHOD 1: Find plan references IN the PRD content (PRD → Plan links)
STEP 1a: Search the PRD file content for plan references using Grep tool:
Use Grep tool with:
- pattern: "@_claude/plans/"
- path: [the PRD file path you're refining]
- output_mode: "content"
STEP 1b: Parse the grep results to extract plan file paths:
@_claude/plans/draft/[filename].md@_claude/plans/in_progress/[filename].md@_claude/plans/completed/[filename].md_claude/plans/draft/fake-plan.md)@ prefix to get actual file pathsprd_to_plan_linksExample:
If grep finds: **Plan:** '@_claude/plans/draft/fake-plan.md'
Then extract: _claude/plans/draft/fake-plan.md
METHOD 2: Find PRD references IN plan files (Plan → PRD links)
STEP 2a: Search plan files for references to this PRD using Grep tool:
Use Grep tool with:
- pattern: "@_claude/prd/[actual-prd-filename].md"
- path: "_claude/plans/"
- output_mode: "files_with_matches"
STEP 2b: Extract plan filenames from results:
plan_to_prd_linksCOMBINE RESULTS:
STEP 3: Merge both lists:
prd_to_plan_links + plan_to_prd_linkslinked_planslinked_plans list in Phase 9 (confirmation) and Phase 11 (success message)Example output to track:
METHOD 1 found: _claude/plans/draft/fake-plan.md
METHOD 2 found: (none)
Total linked plans: 1
.{filename}.backup in same directory_claude/prd/auth-system.md → _claude/prd/.auth-system.md.backupcp _claude/prd/[filename].md _claude/prd/.[filename].backupUse extended thinking to deeply analyze:
Understand existing PRD:
Understand refinement request:
Plan integration:
Determine version increment:
Apply requested changes thoughtfully:
Update metadata:
Add to Refinement History section:
**Version [new-version]** - [current-date]
- [Brief description of what was refined]
Compare original vs. refined PRD and categorize changes:
Additions (+):
Modifications (~):
Deletions (-):
Preserved:
Create clear, terminal-friendly summary:
Changes preview:
+ Added: [Section/Content name]
- [Key point 1]
- [Key point 2]
~ Modified: [Section name]
- [What changed]
- Deleted: [Content name] (if any)
Preserved:
- [Major sections unchanged]
Version: [old] → [new]
If --no-confirm flag is present:
Otherwise, show confirmation prompt:
IMPORTANT: Check the list of linked plans you found in Phase 4. If any plans were found, include the linked plans warning in your confirmation message.
If PRD status is Approved:
Show this message:
⚠️ WARNING: This PRD is Approved
PRD: [Feature Name]
Current Version: [version]
Status: Approved
Your requested change: "[refinement request]"
This PRD has been approved by stakeholders. Changes may require:
- Stakeholder re-approval
- Updates to linked implementation plans
Then, IF you found linked plans in Phase 4, add this section:
Referenced by [N] plans:
- [plan-file-1]
- [plan-file-2]
Then continue with:
Consider:
1. Moving status back to "Under Review" for significant changes
2. Creating a new major version (v[N].0) for major scope changes
3. Continuing with minor refinements only
Continue with changes to Approved PRD? [y/n]:
If PRD status is Under Review:
Show this message:
ℹ️ Note: This PRD is Under Review
PRD: [Feature Name]
Status: Under Review
Stakeholders may be reviewing this PRD. Consider coordinating changes.
[Show diff summary from Phase 8]
Then, IF you found linked plans in Phase 4, add this warning:
⚠️ This PRD is referenced by [N] plans:
- [plan-file-1]
- [plan-file-2]
Then finish with:
Apply these changes? [y/n/diff]:
If PRD status is Draft (normal case):
Show diff summary:
[Show diff summary from Phase 8]
Then, IF you found linked plans in Phase 4, add this warning:
⚠️ This PRD is referenced by [N] plans:
- [plan-file-1]
- [plan-file-2]
Then finish with:
Apply these changes? [y/n/diff]:
Wait for user response:
If user cancels (n):
❌ Refinement cancelled - no changes made
Your PRD remains unchanged. The backup was not needed and has been removed.
To try again with different changes:
/dr-prd @_claude/prd/[filename].md [different refinement request]
Show success message:
IMPORTANT: Check the list of linked plans from Phase 4. Show appropriate success message based on whether linked plans exist.
If NO linked plans were found in Phase 4:
Show basic success message:
✅ PRD refined successfully
PRD: [Feature Name] (v[old-version] → v[new-version])
Location: _claude/prd/[filename].md
Status: [current-status]
Changes applied:
[Concise summary of changes - same as diff summary]
Backup saved: _claude/prd/.[filename].backup
Next steps:
1. Review the refined PRD
2. Update status if stakeholder re-approval needed
3. Refine again if needed: /dr-prd @_claude/prd/[filename].md [more changes]
4. Create or update implementation plans
If linked plans WERE found in Phase 4:
Show success with linked plans warning:
✅ PRD refined successfully
PRD: [Feature Name] (v[old-version] → v[new-version])
Location: _claude/prd/[filename].md
Status: [current-status] [⚠️ May need stakeholder re-approval if Approved]
Changes applied:
[Concise summary of changes]
Backup saved: _claude/prd/.[filename].backup
⚠️ This PRD is referenced by [N] plans:
- [plan-file-1]
- [plan-file-2]
Recommended actions:
1. Review PRD changes and update status if needed
2. Review each linked plan for alignment with updated requirements
3. Consider refining plans that may be affected:
/dr-plan @[plan-path] Align with PRD v[new-version] [change description]
Follow the instructions above based on the detected mode (CREATE or REFINE).