Claude Code Research-Plan-Implement Framework Playbook
1. [Overview](#overview)
Claude Code Research-Plan-Implement Framework Playbook
Table of Contents
- Overview
- Quick Start
- Framework Architecture
- Workflow Phases
- Command Reference
- Session Management
- Agent Reference
- Best Practices
- Customization Guide
- Troubleshooting
Overview
The Research-Plan-Implement Framework is a structured approach to AI-assisted software development that emphasizes:
- Thorough research before coding
- Detailed planning with clear phases
- Systematic implementation with verification
- Persistent context through markdown documentation
Core Benefits
- π Deep Understanding: Research phase ensures complete context
- π Clear Planning: Detailed plans prevent scope creep
- β Quality Assurance: Built-in validation at each step
- π Knowledge Building: Documentation accumulates over time
- β‘ Parallel Processing: Multiple AI agents work simultaneously
- π§ͺ Test-Driven Development: Design test cases following existing patterns before implementation
Quick Start
Installation
- Copy framework files to your repository:
# From the .claude-framework-adoption directory
cp -r .claude your-repo/
# Create docs directory structure
mkdir -p your-repo/docs/tickets
mkdir -p your-repo/docs/notes
- Customize for your project:
- Edit
.claude/commands/*.mdto match your tooling - Update agent descriptions if needed
- Add project-specific CLAUDE.md
- Test the workflow:
Standard Approach:
/1_research_codebase
> How does user authentication work in this codebase?
/2_create_plan
> I need to add two-factor authentication
/3_implement_plan
> docs/tickets/TICKET-NAME/plan.md
Test-Driven Approach:
/8_define_test_cases
> Two-factor authentication for user login
# Design tests, then implement feature
/3_implement_plan
> Implement 2FA to make tests pass
Framework Architecture
your-repo/
βββ .claude/ # AI Assistant Configuration
β βββ agents/ # Specialized AI agents
β β βββ codebase-locator.md # Finds relevant files
β β βββ codebase-analyzer.md # Analyzes implementation
β β βββ codebase-pattern-finder.md # Finds patterns to follow
β β βββ codebase-research-locator.md # Finds docs/ files
β β βββ codebase-research-analyzer.md # Extracts insights from docs
β β βββ codebase-online-researcher.md # Web research
β βββ commands/ # Numbered workflow commands
β βββ 1_research_codebase.md
β βββ 2_create_plan.md
β βββ 3_define_test_cases.md # Generate executable tests
β βββ 4_implement_plan.md
β βββ 5_validate_implementation.md
β βββ 6_iterate_implementation.md
β βββ 7_save_progress.md # Save work session
β βββ 8_resume_work.md # Resume saved work
β βββ 9_research_cloud.md # Cloud infrastructure analysis
βββ docs/ # Persistent Context Storage
β βββ tickets/ # Ticket-associated documentation
β β βββ TICKET-NAME/ # Feature/ticket folders
β β βββ plan.md
β β βββ research.md
β β βββ test-cases.md # Lightweight test index
β β βββ notes-YYYY-MM-DD.md # Implementation notes
β β βββ sessions/ # Work session summaries
β β βββ NNN_feature.md
β βββ notes/ # General notes and meetings
β βββ YYYY-MM-DD-meeting.md
βββ test/ # Test files
β βββ [feature]/
β βββ [feature].test.ts # Actual runnable tests
βββ CLAUDE.md # Project-specific instructions
Workflow Phases
Phase 1: Research (/1_research_codebase)
Purpose: Comprehensive exploration and understanding
Process:
- Invoke command with research question
- Optimize question using prompt-engineer skill
- Read mentioned files FULLY before spawning sub-tasks
- AI spawns parallel agents to investigate
- Findings compiled into structured document
- Saved to
docs/tickets/TICKET-NAME/{research-topic}.mdordocs/{research-topic}.md(creates folder if needed)
Example:
/1_research_codebase
> How does the payment processing system work?
Output: Detailed research document with:
- Code references (file:line)
- Architecture insights
- Patterns and conventions
- Related components
- Historical context from
docs/
Phase 2: Planning (/2_create_plan)
Purpose: Create detailed, phased implementation plan
Process:
- Read requirements and research FULLY
- Interactive planning with user
- Generate phased approach
- Save to
docs/tickets/TICKET-NAME/plan.md(creates folder if needed)
Example:
/2_create_plan
> Add Stripe payment integration based on the research
Plan Structure:
# Feature Implementation Plan
## Phase 1: Database Setup
### Changes Required:
- Add payment tables
- Migration scripts
### Success Criteria:
#### Automated:
- [ ] Migration runs successfully
- [ ] Tests pass
#### Manual:
- [ ] Data integrity verified
## Phase 2: API Integration
[...]
Phase 3: Define Test Cases (/3_define_test_cases)
Purpose: Design executable test cases using BDD principles
Process:
- Invoke command with feature description
- AI researches existing test patterns in codebase
- Generates actual runnable test code file
- Creates lightweight index in
docs/tickets/TICKET-NAME/test-cases.md
Example:
/3_define_test_cases
> Partner enrollment workflow when ordering kit products
Output:
-
PRIMARY: Test Code File -
test/[feature]/[feature].test.ts- Actual runnable tests with Given-When-Then structure
- Minimal helpers (only when duplication > 2x)
- Tests ARE the specification
-
SECONDARY: Lightweight Index -
docs/tickets/TICKET-NAME/test-cases.md- Quick reference with line numbers
- Commands to run tests
- Coverage summary
Test Structure:
describe("Feature Name", () => {
test("behavior description", async () => {
// Given: [preconditions]
const state = { files: {}, todos: [] };
// When: [action]
const result = await executeFeature(state);
// Then: [expected outcome]
expect(result.success).toBe(true);
});
});
Coverage Areas:
- Happy paths
- Edge cases
- Error scenarios
- Boundary conditions
- Authorization/permission checks
Phase 4: Implementation (/4_implement_plan)
Purpose: Execute plan systematically
Process:
- Read plan and test files (if exist) FULLY
- Read all note files in ticket folder
- Implement phase by phase
- If test file exists: Make tests pass (test-driven approach)
- Run verification after each phase
- Update plan checkboxes
Example:
/4_implement_plan
> docs/tickets/TICKET-NAME/plan.md
Progress Tracking:
- Uses checkboxes in plan
- TodoWrite for task management
- Creates note files for new requirements
- Communicates blockers clearly
Phase 5: Validation (/5_validate_implementation)
Purpose: Verify implementation matches plan
Process:
- Read all ticket documentation (plan, test-cases, notes, research, sessions)
- Review git changes
- Run all automated checks
- If test file exists: Run tests and verify 100% pass
- Generate validation report
- Identify deviations
- Recommend iteration if issues found
Example:
/5_validate_implementation
> Validate the Stripe integration implementation
Report Includes:
- Implementation status
- Test results (if applicable)
- Code review findings
- Requirements from notes
- Manual testing requirements
- Next steps (often: run step 6)
Phase 6: Iteration (/6_iterate_implementation)
Purpose: Fix bugs, address deviations, refine features
Process:
- Read validation report, plan, notes
- Categorize issues (bugs, deviations, missing requirements)
- Prioritize and fix systematically
- Fix production code to make tests pass (not modify tests)
- Update documentation (plan checkboxes, note files)
- Verify fixes with automated checks
Example:
/6_iterate_implementation
> docs/tickets/TICKET-NAME/plan.md
Iteration Cycle:
Step 5 (Validate) β Step 6 (Iterate) β Step 5 (Validate) β ...
Continue until all validation criteria pass.
Command Reference
Core Workflow Commands
/1_research_codebase
- Purpose: Deep dive into codebase
- Input: Research question
- Output: Research document
- Agents Used: All locator/analyzer agents (codebase-locator, codebase-analyzer, codebase-pattern-finder, codebase-research-locator, codebase-research-analyzer, codebase-online-researcher)
/2_create_plan
- Purpose: Create implementation plan
- Input: Requirements/ticket
- Output: Phased plan document
- Interactive: Yes
/3_define_test_cases
- Purpose: Generate executable test code using BDD principles
- Input: Feature/functionality to test
- Output: Test file (
test/[feature]/[feature].test.ts) + lightweight index (docs/tickets/TICKET-NAME/test-cases.md) - Approach: Tests ARE the specification - executable documentation
- Agent Used: codebase-pattern-finder (automatic)
/4_implement_plan
- Purpose: Execute implementation
- Input: Plan path
- Output: Completed implementation
- Note: If tests exist, uses test-driven approach
/5_validate_implementation
- Purpose: Verify implementation
- Input: Plan path (optional)
- Output: Validation report
- Note: Works in cycle with step 6
/6_iterate_implementation
- Purpose: Fix bugs and address deviations found in validation
- Input: Plan path
- Output: Fixed implementation
- Note: Works in cycle with step 5
Session Management
The framework supports saving and resuming work through persistent documentation:
/7_save_progress
- Purpose: Save work progress and context
- Input: Current work state
- Output: Session summary and checkpoint
- Creates:
docs/tickets/TICKET-NAME/sessions/NNN_feature.mddocument (NNN is sequential)
/8_resume_work
- Purpose: Resume previously saved work
- Input: Session summary path or auto-discover
- Output: Restored context and continuation
- Reads: Session, plan, research, and note files
/9_research_cloud
- Purpose: Analyze cloud infrastructure (READ-ONLY)
- Input: Cloud platform and focus area
- Output: Infrastructure analysis document
- Creates:
docs/tickets/TICKET-NAME/cloud-platform-environment.mdordocs/cloud-platform-environment.mddocuments - Safety: Only executes READ-ONLY operations
Agent Reference
codebase-locator
- Role: Find relevant files
- Tools: Grep, Glob, LS
- Returns: Categorized file listings
codebase-analyzer
- Role: Understand implementation
- Tools: Read, Grep, Glob, LS
- Returns: Detailed code analysis
codebase-pattern-finder
- Role: Find examples to follow
- Tools: Grep, Glob, Read, LS
- Returns: Code patterns and examples
codebase-research-locator
- Role: Find existing documents in
docs/directory - Tools: Read, Grep, Glob, LS
- Returns: Categorized document listings
codebase-research-analyzer
- Role: Extract insights from research documents
- Tools: Read, Grep, Glob, LS
- Returns: Key decisions, constraints, and actionable insights
codebase-online-researcher
- Role: Research external documentation and web resources
- Tools: DeepWiki, Playwright browser tools
- Returns: External documentation findings with links
Best Practices
1. Research First
- Always start with research for complex features
- Don't skip research even if you think you know the codebase
- Research documents become valuable references
2. Plan Thoroughly
- Break work into testable phases
- Include specific success criteria
- Document what's NOT in scope
- Resolve all questions before finalizing
- Consider how work will be committed
3. Implement Systematically
- Complete one phase before starting next
- Run tests after each phase
- Update plan checkboxes as you go
- Communicate blockers immediately
4. Document Everything
- Research findings persist in
docs/tickets/TICKET-NAME/ordocs/ - Plans serve as technical specs
- Session summaries maintain continuity
5. Use Parallel Agents
- Spawn multiple agents for research
- Let them work simultaneously
- Combine findings for comprehensive view
6. Design Tests Early
- Define test cases before implementing features
- Use
/3_define_test_casesto generate actual runnable test code - Tests become the living specification
- Ensure tests cover happy paths, edge cases, and errors
- Let tests guide implementation (test-driven approach)
Customization Guide
Adapting Commands
- Remove framework-specific references:
# Before (cli project specific)
Run `cli thoughts sync`
# After (Generic)
Save to docs/tickets/TICKET-NAME/research.md or docs/{research-topic}.md
- Adjust tool commands:
# Match your project's tooling
- Tests: `npm test` β `yarn test`
- Lint: `npm run lint` β `make lint`
- Build: `npm run build` β `cargo build`
- Customize success criteria:
# Add project-specific checks
- [ ] Security scan passes: `npm audit`
- [ ] Performance benchmarks met
- [ ] Documentation generated
Adding Custom Agents
Create new agents for specific needs:
---
name: security-analyzer
description: Analyzes security implications
tools: Read, Grep
---
You are a security specialist...
Project-Specific CLAUDE.md
Add instructions for your project:
# Project Conventions
## Testing
- Always write tests first (TDD)
- Minimum 80% coverage required
- Use Jest for unit tests
## Code Style
- Use Prettier formatting
- Follow ESLint rules
- Prefer functional programming
## Git Workflow
- Feature branches from develop
- Squash commits on merge
- Conventional commit messages
Troubleshooting
Common Issues
Q: Research phase taking too long?
- A: Limit scope of research question
- Focus on specific component/feature
- Use more targeted queries
Q: Plan too vague?
- A: Request more specific details
- Ask for code examples
- Ensure success criteria are measurable
Q: Implementation doesn't match plan?
- A: Stop and communicate mismatch
- Update plan if needed
- Validate assumptions with research
Q: How to commit changes?
- A: Use git commands directly after validation
- Group related changes logically
- Write clear commit messages following project conventions
Tips for Success
- Start Small: Test with simple feature first
- Iterate: Customize based on what works
- Build Library: Accumulate research/plans over time
- Team Alignment: Share framework with team
- Regular Reviews: Update commands based on learnings
Advanced Usage
Chaining Commands
For complex features, chain commands:
# Step 1: Research
/1_research_codebase
> Research current auth system
# Step 2: Plan
/2_create_plan
> Based on research, plan OAuth integration
# Step 3: Define tests
/3_define_test_cases
> OAuth authentication flows
# Step 4: Implement
/4_implement_plan
> docs/tickets/TICKET-NAME/plan.md
# Step 5: Validate
/5_validate_implementation
> docs/tickets/TICKET-NAME/plan.md
# Step 6: Iterate if needed
/6_iterate_implementation
> docs/tickets/TICKET-NAME/plan.md
# Then manually commit using git
Parallel Research
Research multiple aspects simultaneously:
/1_research_codebase
> How do authentication, authorization, and user management work together?
This spawns agents to research each aspect in parallel.
Cloud Infrastructure Analysis
Analyze cloud deployments without making changes:
/9_research_cloud
> Azure
> all
# Analyzes:
- Resource inventory and costs
- Security and compliance
- Architecture patterns
- Optimization opportunities
Test-Driven Development Workflow
Design tests before implementation:
# Step 1: Define test cases
/3_define_test_cases
> Partner enrollment when customer orders a kit product
# Output includes:
# - Actual test code: test/partners/enrollment.test.ts
# - Lightweight index: docs/tickets/TICKET-NAME/test-cases.md
# - Tests cover happy path, edge cases, errors, boundaries, auth
# Step 2: Create plan for feature implementation
/2_create_plan
> Implement partner enrollment logic to make tests pass
# Step 3: Implement the feature
/4_implement_plan
> docs/tickets/TICKET-NAME/plan.md
# Tests drive implementation - make them pass!
# Step 4: Validate
/5_validate_implementation
> docs/tickets/TICKET-NAME/plan.md
# Step 5: Iterate if tests don't pass
/6_iterate_implementation
> docs/tickets/TICKET-NAME/plan.md
Key Benefit: Tests are the living specification - executable documentation that defines correct behavior.
Conclusion
This framework provides structure without rigidity. It scales from simple features to complex architectural changes. The key is consistent use - the more you use it, the more valuable your docs/tickets/ directory becomes as organizational knowledge.
Remember: The framework is a tool to enhance development, not replace thinking. Use it to augment your capabilities, not as a rigid process.
Related Documents
Visual Truth Engine: Product-Market Fit & Go-to-Market Strategy
**Date:** January 22, 2026 | **Status:** Early-Stage Launch Strategy
Media Handling Playbook - ZyeutΓ© v3
**Last Updated:** December 15, 2025
Trader ROI Playbook (Codex + CI)
Purpose: increase engineering output per hour while keeping quality stable or better.
OSCP Attack Playbook
**Author:** Brad Turner