Prompt file imported from JacobCoffee/debug-toolbar (
.claude/commands/prd.md). Fill in{{arguments}}before use. Copyright stays with the author.
Intelligent PRD Creation Workflow
You are creating a Product Requirements Document for: {{arguments}}
Intelligence Layer (ACTIVATE FIRST)
Before starting checkpoints:
- Read MCP Strategy: Load
.claude/mcp-strategy.mdfor tool selection - Learn from Codebase: Read 3-5 similar implementations
- Assess Complexity: Determine simple/medium/complex
- Adapt Workflow: Adjust checkpoint depth
Critical Rules
- CONTEXT FIRST - Read existing patterns before planning
- NO CODE MODIFICATION - Planning only
- PATTERN LEARNING - Identify 3-5 similar features
- ADAPTIVE DEPTH - Simple=6, Medium=8, Complex=10+ checkpoints
- RESEARCH GROUNDED - Minimum 2000+ words research
- COMPREHENSIVE PRD - Minimum 3200+ words
Checkpoint 0: Intelligence Bootstrap
Load project intelligence:
- Read
CLAUDE.md - Read
specs/guides/patterns/README.md - Read
.claude/mcp-strategy.md
Learn from existing implementations:
For panels: Read files in src/debug_toolbar/core/panels/
For integrations: Read files in src/debug_toolbar/litestar/
For extras: Read files in src/debug_toolbar/extras/
Assess complexity:
- Simple: Config change, bug fix, single file → 6 checkpoints
- Medium: New panel, API endpoint, 2-3 files → 8 checkpoints
- Complex: New integration, architecture change, 5+ files → 10+ checkpoints
Output: "✓ Checkpoint 0 complete - Complexity: [level], Checkpoints: [count]"
Checkpoint 1: Pattern Recognition
Identify similar implementations:
- Search for related patterns in
src/debug_toolbar/ - Read at least 3 similar files
- Extract naming patterns
- Note testing patterns from
tests/
Document:
## Similar Implementations
1. `src/path/to/similar1.py` - Description
2. `src/path/to/similar2.py` - Description
3. `src/path/to/similar3.py` - Description
## Patterns Observed
- Class structure: ...
- Naming conventions: ...
- Error handling: ...
Output: "✓ Checkpoint 1 complete - Patterns identified"
Checkpoint 2: Workspace Creation
mkdir -p specs/active/{slug}/research
mkdir -p specs/active/{slug}/tmp
mkdir -p specs/active/{slug}/patterns
Create initial files:
specs/active/{slug}/research/plan.mdspecs/active/{slug}/tmp/new-patterns.md
Output: "✓ Checkpoint 2 complete - Workspace at specs/active/{slug}/"
Checkpoint 3: Intelligent Analysis
Use appropriate tool based on complexity:
- Simple: 10 structured thoughts
- Medium: Sequential thinking (15 thoughts)
- Complex: zen_planner or thinkdeep
For panels: Analyze Panel ABC interface, existing panels, template patterns For integrations: Analyze plugin protocol, middleware patterns, config inheritance
Document in workspace.
Output: "✓ Checkpoint 3 complete - Analysis using [tool]"
Checkpoint 4: Research (2000+ words)
Priority order:
- Pattern Library:
specs/guides/patterns/ - Internal Guides:
specs/guides/ - Context7: Litestar/SQLAlchemy documentation
- WebSearch: Best practices
For panel development:
mcp__context7__get-library-docs(
context7CompatibleLibraryID="/litestar-org/litestar",
topic="middleware",
mode="code"
)
Verify: wc -w specs/active/{slug}/research/plan.md
Output: "✓ Checkpoint 4 complete - Research (2000+ words)"
Checkpoint 5: Write PRD (3200+ words)
Include:
- Intelligence context (complexity, similar features, patterns)
- Problem statement
- Acceptance criteria (specific, measurable)
- Technical approach with pattern references
- Testing strategy (90%+ coverage target)
- Files to create/modify
Template:
# PRD: {Feature Name}
## Metadata
- Slug: {slug}
- Complexity: {simple|medium|complex}
- Checkpoints: {6|8|10+}
## Intelligence Context
### Similar Implementations
- ...
### Patterns to Follow
- ...
## Problem Statement
...
## Acceptance Criteria
1. [ ] ...
2. [ ] ...
## Technical Approach
...
## Files to Create/Modify
- `src/debug_toolbar/...`
- `tests/unit/...`
## Testing Strategy
- Coverage target: 90%+
- Key test cases: ...
## Out of Scope
- ...
Verify: wc -w specs/active/{slug}/prd.md
Output: "✓ Checkpoint 5 complete - PRD (3200+ words)"
Checkpoint 6: Task Breakdown
Adapt to complexity level.
Simple (6 checkpoints):
- Implement core functionality
- Add tests
- Update config if needed
Medium (8 checkpoints):
- Create base class/module
- Implement core logic
- Add lifecycle hooks
- Write unit tests
- Write integration tests
- Update documentation
Complex (10+ checkpoints):
- Full breakdown with dependencies
Output: "✓ Checkpoint 6 complete - Tasks adapted to complexity"
Checkpoint 7: Recovery Guide
Create specs/active/{slug}/RECOVERY.md with:
- Intelligence context for session resumption
- Current progress state
- How to continue from any checkpoint
Output: "✓ Checkpoint 7 complete - Recovery guide with intelligence context"
Checkpoint 8: Git Verification
git status --porcelain src/ | grep -v "^??"
Verify no source code was modified during PRD phase.
Output: "✓ Checkpoint 8 complete - No source code modified"
Final Summary
PRD Phase Complete ✓
Workspace: specs/active/{slug}/
Complexity: [simple|medium|complex]
Checkpoints: [6|8|10+] completed
Intelligence:
- ✓ Pattern library consulted
- ✓ Similar features analyzed
- ✓ Tool selection optimized
Next: Run `/implement {slug}`
