mirror of
https://github.com/coleam00/Archon.git
synced 2026-01-03 05:10:27 -05:00
Add PRP story task template and reorganize PRP commands (#508)
* Reorganize PRP commands and add story task template - Move PRP commands to dedicated subdirectories - Add new agent definitions for codebase analysis and library research - Create story task PRP template for user story implementation - Rename prp-base.md to prp_base.md for consistency * Update .claude/agents/library-researcher.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update .claude/commands/prp-claude-code/prp-story-task-create.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update .claude/commands/prp-claude-code/prp-story-task-create.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update PRPs/templates/prp_story_task.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update PRPs/templates/prp_story_task.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
107
.claude/commands/prp-claude-code/prp-claude-code-create.md
Normal file
107
.claude/commands/prp-claude-code/prp-claude-code-create.md
Normal file
@@ -0,0 +1,107 @@
|
||||
# Create BASE PRP
|
||||
|
||||
## Feature: $ARGUMENTS
|
||||
|
||||
## PRP Creation Mission
|
||||
|
||||
Create a comprehensive PRP that enables **one-pass implementation success** through systematic research and context curation.
|
||||
|
||||
**Critical Understanding**: The executing AI agent only receives:
|
||||
|
||||
- The PRP content you create
|
||||
- Its training data knowledge
|
||||
- Access to codebase files (but needs guidance on which ones)
|
||||
|
||||
**Therefore**: Your research and context curation directly determines implementation success. Incomplete context = implementation failure.
|
||||
|
||||
## Research Process
|
||||
|
||||
> During the research process, create clear tasks and spawn as many agents and subagents as needed using the batch tools. The deeper research we do here the better the PRP will be. we optminize for chance of success and not for speed.
|
||||
|
||||
1. **Codebase Analysis in depth**
|
||||
- Create clear todos and spawn subagents to search the codebase for similar features/patterns Think hard and plan your approach
|
||||
- Identify all the necessary files to reference in the PRP
|
||||
- Note all existing conventions to follow
|
||||
- Check existing test patterns for validation approach
|
||||
- Use the batch tools to spawn subagents to search the codebase for similar features/patterns
|
||||
|
||||
2. **External Research at scale**
|
||||
- Create clear todos and spawn with instructions subagents to do deep research for similar features/patterns online and include urls to documentation and examples
|
||||
- Library documentation (include specific URLs)
|
||||
- For critical pieces of documentation add a .md file to PRPs/ai_docs and reference it in the PRP with clear reasoning and instructions
|
||||
- Implementation examples (GitHub/StackOverflow/blogs)
|
||||
- Best practices and common pitfalls found during research
|
||||
- Use the batch tools to spawn subagents to search for similar features/patterns online and include urls to documentation and examples
|
||||
|
||||
3. **User Clarification**
|
||||
- Ask for clarification if you need it
|
||||
|
||||
## PRP Generation Process
|
||||
|
||||
### Step 1: Choose Template
|
||||
|
||||
Use `PRPs/templates/prp_base.md` as your template structure - it contains all necessary sections and formatting.
|
||||
|
||||
### Step 2: Context Completeness Validation
|
||||
|
||||
Before writing, apply the **"No Prior Knowledge" test** from the template:
|
||||
_"If someone knew nothing about this codebase, would they have everything needed to implement this successfully?"_
|
||||
|
||||
### Step 3: Research Integration
|
||||
|
||||
Transform your research findings into the template sections:
|
||||
|
||||
**Goal Section**: Use research to define specific, measurable Feature Goal and concrete Deliverable
|
||||
**Context Section**: Populate YAML structure with your research findings - specific URLs, file patterns, gotchas
|
||||
**Implementation Tasks**: Create dependency-ordered tasks using information-dense keywords from codebase analysis
|
||||
**Validation Gates**: Use project-specific validation commands that you've verified work in this codebase
|
||||
|
||||
### Step 4: Information Density Standards
|
||||
|
||||
Ensure every reference is **specific and actionable**:
|
||||
|
||||
- URLs include section anchors, not just domain names
|
||||
- File references include specific patterns to follow, not generic mentions
|
||||
- Task specifications include exact naming conventions and placement
|
||||
- Validation commands are project-specific and executable
|
||||
|
||||
### Step 5: ULTRATHINK Before Writing
|
||||
|
||||
After research completion, create comprehensive PRP writing plan using TodoWrite tool:
|
||||
|
||||
- Plan how to structure each template section with your research findings
|
||||
- Identify gaps that need additional research
|
||||
- Create systematic approach to filling template with actionable context
|
||||
|
||||
## Output
|
||||
|
||||
Save as: `PRPs/{feature-name}.md`
|
||||
|
||||
## PRP Quality Gates
|
||||
|
||||
### Context Completeness Check
|
||||
|
||||
- [ ] Passes "No Prior Knowledge" test from template
|
||||
- [ ] All YAML references are specific and accessible
|
||||
- [ ] Implementation tasks include exact naming and placement guidance
|
||||
- [ ] Validation commands are project-specific and verified working
|
||||
|
||||
### Template Structure Compliance
|
||||
|
||||
- [ ] All required template sections completed
|
||||
- [ ] Goal section has specific Feature Goal, Deliverable, Success Definition
|
||||
- [ ] Implementation Tasks follow dependency ordering
|
||||
- [ ] Final Validation Checklist is comprehensive
|
||||
|
||||
### Information Density Standards
|
||||
|
||||
- [ ] No generic references - all are specific and actionable
|
||||
- [ ] File patterns point at specific examples to follow
|
||||
- [ ] URLs include section anchors for exact guidance
|
||||
- [ ] Task specifications use information-dense keywords from codebase
|
||||
|
||||
## Success Metrics
|
||||
|
||||
**Confidence Score**: Rate 1-10 for one-pass implementation success likelihood
|
||||
|
||||
**Validation**: The completed PRP should enable an AI agent unfamiliar with the codebase to implement the feature successfully using only the PRP content and codebase access.
|
||||
54
.claude/commands/prp-claude-code/prp-claude-code-execute.md
Normal file
54
.claude/commands/prp-claude-code/prp-claude-code-execute.md
Normal file
@@ -0,0 +1,54 @@
|
||||
# Execute BASE PRP
|
||||
|
||||
## PRP File: $ARGUMENTS
|
||||
|
||||
## Mission: One-Pass Implementation Success
|
||||
|
||||
PRPs enable working code on the first attempt through:
|
||||
|
||||
- **Context Completeness**: Everything needed, nothing guessed
|
||||
- **Progressive Validation**: 4-level gates catch errors early
|
||||
- **Pattern Consistency**: Follow existing codebase approaches
|
||||
|
||||
**Your Goal**: Transform the PRP into working code that passes all validation gates.
|
||||
|
||||
## Execution Process
|
||||
|
||||
1. **Load PRP**
|
||||
- Read the specified PRP file completely
|
||||
- Absorb all context, patterns, requirements and gather codebase intelligence
|
||||
- Use the provided documentation references and file patterns, consume the right documentation before the appropriate todo/task
|
||||
- Trust the PRP's context and guidance - it's designed for one-pass success
|
||||
- If needed do additional codebase exploration and research as needed
|
||||
|
||||
2. **ULTRATHINK & Plan**
|
||||
- Create comprehensive implementation plan following the PRP's task order
|
||||
- Break down into clear todos using TodoWrite tool
|
||||
- Use subagents for parallel work when beneficial (always create prp inspired prompts for subagents when used)
|
||||
- Follow the patterns referenced in the PRP
|
||||
- Use specific file paths, class names, and method signatures from PRP context
|
||||
- Never guess - always verify the codebase patterns and examples referenced in the PRP yourself
|
||||
|
||||
3. **Execute Implementation**
|
||||
- Follow the PRP's Implementation Tasks sequence, add more detail as needed, especially when using subagents
|
||||
- Use the patterns and examples referenced in the PRP
|
||||
- Create files in locations specified by the desired codebase tree
|
||||
- Apply naming conventions from the task specifications and CLAUDE.md
|
||||
|
||||
4. **Progressive Validation**
|
||||
|
||||
**Execute the level validation system from the PRP:**
|
||||
- **Level 1**: Run syntax & style validation commands from PRP
|
||||
- **Level 2**: Execute unit test validation from PRP
|
||||
- **Level 3**: Run integration testing commands from PRP
|
||||
- **Level 4**: Execute specified validation from PRP
|
||||
|
||||
**Each level must pass before proceeding to the next.**
|
||||
|
||||
5. **Completion Verification**
|
||||
- Work through the Final Validation Checklist in the PRP
|
||||
- Verify all Success Criteria from the "What" section are met
|
||||
- Confirm all Anti-Patterns were avoided
|
||||
- Implementation is ready and working
|
||||
|
||||
**Failure Protocol**: When validation fails, use the patterns and gotchas from the PRP to fix issues, then re-run validation until passing.
|
||||
142
.claude/commands/prp-claude-code/prp-story-task-create.md
Normal file
142
.claude/commands/prp-claude-code/prp-story-task-create.md
Normal file
@@ -0,0 +1,142 @@
|
||||
---
|
||||
description: "Convert user story/task into executable PRP with deep codebase analysis"
|
||||
---
|
||||
|
||||
# Create Story PRP from User Story/Task
|
||||
|
||||
## Story/Task: $ARGUMENTS
|
||||
|
||||
## Mission
|
||||
|
||||
Transform a user story or task into a **tactical implementation PRP** through systematic codebase analysis and task decomposition.
|
||||
|
||||
We do not write any code in this step, the goal is to create a detailed context engineered implementation plan for the implementation agent.
|
||||
|
||||
**Key Principle**: We must first gather the context about the story/task before proceeding with the analysis.
|
||||
|
||||
When we understand the story/task, we can proceed with the codebase analysis. We systematically dig deep into the codebase to gather intelligence and identify patterns and implementation points. We then use this information to create a PRP that can be executed by a coding agent.
|
||||
|
||||
The contents of the created PRP should encapsulate all the information the agent needs to complete the story/task in one pass.
|
||||
|
||||
Remember that subagents will only receive details from you; the user cannot interact with them directly. Therefore, include all relevant context in the subagent prompt and TODO.
|
||||
|
||||
Create detailed TODOs and spawn parallel subagents to analyze (use specialized subagents when appropriate).
|
||||
|
||||
## Analysis Process
|
||||
|
||||
### Phase 1: Story Decomposition
|
||||
|
||||
Analyze the story to determine:
|
||||
|
||||
- **Story/Task Type**: Feature/Bug/Enhancement/Refactor
|
||||
- **Complexity**: Low, Medium, High
|
||||
- **Affected Systems**: Which components/services need changes
|
||||
|
||||
Get a deep understanding about the story/task before proceeding so that you can effectively guide the rest of the process.
|
||||
|
||||
### Phase 2: Codebase Intelligence Gathering
|
||||
|
||||
**1. Project Structure Analysis**
|
||||
|
||||
- Detect primary language(s) and frameworks
|
||||
- Map directory structure and conventions to identify integration points for the story/task
|
||||
- Identify service/component boundaries
|
||||
- Find configuration files and environment setup
|
||||
|
||||
**2. Pattern Recognition**
|
||||
|
||||
- Search for similar implementations in codebase
|
||||
- Identify coding conventions (naming, structure, error handling) start in CLAUDE.md AGENTS.md or relevant rules files such as .cursorrules
|
||||
- Extract common patterns for the story's domain that should be added to the PRP as context for the implementation agent.
|
||||
- Note anti-patterns to avoid
|
||||
|
||||
**3. Dependency Analysis**
|
||||
|
||||
- Catalog external libraries used if relevant to the story/task (check package.json, pyproject.toml, go.mod, etc.)
|
||||
- Understand how libraries are integrated
|
||||
- Find relevant documentation in PRPs/ai_docs/ if shared, ai_docs directory is used by the user to paste in relevant additional context that may be relevant to our story/task
|
||||
|
||||
**4. Testing Patterns**
|
||||
|
||||
- Identify test framework and structure
|
||||
- Find similar test examples and test setup
|
||||
- Suggest test cases and scenarios
|
||||
|
||||
**5. Integration Points**
|
||||
|
||||
- Identify files that will need updates
|
||||
- Identify if new files needs to be created and where to create them
|
||||
- Find router/API registration patterns
|
||||
- Understand database/model patterns if relevant
|
||||
|
||||
### Phase 3: Think harder about the story and its components.
|
||||
|
||||
Really think hard about everything you just learned during the research phases.
|
||||
|
||||
### Phase 4: PRP Task Generation
|
||||
|
||||
Transform analysis into concrete tasks:
|
||||
|
||||
Read and understand the template @PRPs/templates/prp_story_task.md
|
||||
|
||||
**Task Rules**:
|
||||
|
||||
1. Each task is atomic and independently testable
|
||||
2. Tasks are ordered by dependency
|
||||
3. Use action verbs that are information dense: CREATE, UPDATE, ADD, REMOVE, REFACTOR, MIRROR
|
||||
4. Include specific implementation details from codebase analysis
|
||||
5. Every task has an executable validation command
|
||||
|
||||
**Task Action Types**:
|
||||
|
||||
We use the concept of information dense keywords to describe the action to be taken, below is a guidance.
|
||||
But you can use your own words to describe the action to be taken as long as you follow this same principle.
|
||||
|
||||
Examples:
|
||||
|
||||
- **CREATE**: New files/components
|
||||
- **UPDATE**: Modify existing files
|
||||
- **ADD**: Insert new functionality into existing code
|
||||
- **REMOVE**: Delete deprecated code
|
||||
- **REFACTOR**: Restructure without changing behavior
|
||||
- **MIRROR**: Mirror existing pattern or functionality that exists elsewhere in the codebase
|
||||
|
||||
### Phase 5: Validation Design
|
||||
|
||||
For each task, design validation that:
|
||||
|
||||
- Can run immediately after task completion
|
||||
- Provides clear pass/fail feedback
|
||||
- Uses project-specific commands discovered in analysis
|
||||
|
||||
## Quality Criteria
|
||||
|
||||
### Task Clarity
|
||||
|
||||
- [ ] The PRP is clear and concise and follows KISS principle
|
||||
- [ ] Each task has clear action and target
|
||||
- [ ] Implementation details reference specific patterns
|
||||
- [ ] Validation commands are executable
|
||||
|
||||
### Context Completeness
|
||||
|
||||
- [ ] All necessary patterns identified
|
||||
- [ ] External library usage documented
|
||||
- [ ] Integration points mapped
|
||||
- [ ] External context references populated
|
||||
|
||||
### Story Coverage
|
||||
|
||||
- [ ] All acceptance criteria addressed
|
||||
- [ ] Edge cases considered
|
||||
- [ ] Error handling included where needed
|
||||
|
||||
## Output
|
||||
|
||||
Save as: `PRPs/story_{kebab-case-summary}.md`
|
||||
|
||||
## Success Metrics
|
||||
|
||||
**Implementation Ready**: Another developer could execute these tasks without additional context
|
||||
**Validation Complete**: Every task has at least one working validation command
|
||||
**Pattern Consistent**: Tasks follow existing codebase conventions
|
||||
95
.claude/commands/prp-claude-code/prp-story-task-execute.md
Normal file
95
.claude/commands/prp-claude-code/prp-story-task-execute.md
Normal file
@@ -0,0 +1,95 @@
|
||||
---
|
||||
description: "Execute a Story PRP with focused task implementation"
|
||||
---
|
||||
|
||||
# Execute Story PRP
|
||||
|
||||
## PRP File: $ARGUMENTS
|
||||
|
||||
## Mission
|
||||
|
||||
Execute a story/task PRP through **sequential task completion** with immediate validation.
|
||||
|
||||
**Execution Philosophy**: Complete one task, validate it, then move to the next. No task left behind.
|
||||
|
||||
## Execution Process
|
||||
|
||||
### 1. Load Story PRP
|
||||
|
||||
- Read the specified story PRP file
|
||||
- Understand the original story intent
|
||||
- Review all context references
|
||||
- Note validation commands for each task
|
||||
|
||||
### 2. Pre-Implementation Check
|
||||
|
||||
- Ultrathink about the story intent and task requirements
|
||||
- Verify all referenced files exist
|
||||
- Check that patterns mentioned are accessible
|
||||
- Ensure development environment is ready
|
||||
- Run any pre-requisite setup commands
|
||||
|
||||
### 3. Task-by-Task Implementation
|
||||
|
||||
For each task in the PRP:
|
||||
|
||||
**a) Understand Task**
|
||||
|
||||
- Read task requirements completely
|
||||
- Review referenced patterns
|
||||
- Check gotchas and constraints
|
||||
|
||||
**b) Implement Task**
|
||||
|
||||
- Follow the specified pattern
|
||||
- Use the indicated naming conventions
|
||||
- Apply the documented approach
|
||||
- Handle edge cases mentioned
|
||||
|
||||
**c) Validate Immediately**
|
||||
|
||||
- Run the task's validation command
|
||||
- If validation fails, fix and re-validate
|
||||
- Don't proceed until current task passes
|
||||
|
||||
**d) Mark Complete**
|
||||
|
||||
- Update todo list to track progress
|
||||
- Document any deviations if necessary
|
||||
|
||||
### 4. Full Validation
|
||||
|
||||
After all tasks complete:
|
||||
|
||||
- Run the validation gates from PRP
|
||||
- Execute comprehensive test suite
|
||||
- Verify all acceptance criteria met
|
||||
|
||||
### 5. Completion
|
||||
|
||||
- Work through completion checklist
|
||||
- Ensure story requirements satisfied
|
||||
- Move completed PRP to PRPs/completed/ create the folder if it does not exist
|
||||
|
||||
## Execution Rules
|
||||
|
||||
**Validation Gates**: Each task must pass validation, iterate until passed
|
||||
**Pattern Adherence**: Follow existing patterns, don't create new ones
|
||||
**No Shortcuts**: Complete all validation steps
|
||||
|
||||
## Failure Handling
|
||||
|
||||
When a task fails validation:
|
||||
|
||||
1. Read the error message carefully
|
||||
2. Check the pattern reference again
|
||||
3. Validate it by investigating the codebase
|
||||
4. Fix and re-validate
|
||||
5. If stuck, check similar implementations
|
||||
|
||||
## Success Criteria
|
||||
|
||||
- Every validation command passes
|
||||
- Full test suite green
|
||||
- Story acceptance criteria met
|
||||
- Code follows project conventions
|
||||
Reference in New Issue
Block a user