A systematic workflow plugin for Claude Code that guides development through three structured phases: Research, Design, and Implementation.
This plugin implements a methodical approach to code changes, ensuring thorough understanding, careful planning, and verified implementation. It's designed to help developers tackle complex features by breaking them into manageable, well-thought-out steps.
┌─────────────────────────────────────────────────────────────┐
│ /rpi (or use /research, /design, /implement separately) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ 1. RESEARCH PHASE │
│ • Get task + short name from user │
│ • Hook creates: .claude/thoughts/{epoch}_{name}/ │
│ • Spawn parallel explore agents │
│ • Write comprehensive findings │
│ • OUTPUT: research.md │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ 2. PLAN PHASE │
│ • Read research.md │
│ • Present implementation options │
│ • Interactive planning with user │
│ • Define phases with success criteria │
│ • OUTPUT: plan.md (in same directory) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ 3. IMPLEMENT PHASE │
│ • Read plan.md + research.md │
│ • For each phase: │
│ - Implement changes │
│ - Run automated verification │
│ - Pause for manual testing │
│ - Update plan.md with checkmarks │
│ • OUTPUT: Updated plan.md + code changes │
└─────────────────────────────────────────────────────────────┘
│
▼
✅ Complete!
Directory structure created:
.claude/thoughts/1733595123_dark_mode/
├── research.md (comprehensive findings)
└── plan.md (implementation plan with ✓ checkmarks)
Add the marketplace and install the plugin:
/plugin marketplace add clzmj/claude-code-plugins
/plugin install rdi@clzmj- Clone or download this plugin to your local plugins directory
- Add to your
.claude/settings.json:
{
"plugins": [
{
"source": "/path/to/research-design-implement"
}
]
}Invoke the workflow with:
/rpiThis will start the interactive Research-Design-Implement workflow.
The research phase thoroughly explores your codebase to understand:
- Current implementation patterns
- Relevant files and their purposes
- Existing conventions and architecture
- Dependencies and integration points
Example:
User: /rpi
Claude: I'll guide you through a systematic Research → Plan → Implement workflow...
What would you like to work on?
User: I need to add a dark mode toggle to the settings page
Claude: Let me research the current codebase...
[Spawns parallel explore agents]
Research Findings:
### Current State
- Theme system exists in src/theme/ThemeProvider.tsx:12
- Settings page at src/pages/Settings.tsx:45
- Existing toggle components in src/components/Toggle.tsx:8
### Relevant Files
- `src/theme/ThemeProvider.tsx:12` - Current theme context implementation
- `src/hooks/useTheme.ts:5` - Theme hook for components
- `src/components/Toggle.tsx:8` - Reusable toggle component
Ready to move to planning?
The planning phase creates a detailed implementation roadmap:
- Multiple implementation approaches with pros/cons
- Phased breakdown of changes
- Clear success criteria (automated and manual)
- Out-of-scope items to prevent feature creep
Example:
User: Yes, let's plan
Claude: Based on my research, here are implementation options:
**Option 1: Extend Existing Theme System**
- Pros: Follows existing patterns, minimal code changes
- Cons: Limited to current theme capabilities
**Option 2: New Theme Management System**
- Pros: More flexible, better long-term
- Cons: Larger refactor, more testing needed
Which approach aligns with your needs?
User: Option 1
Claude: Here's my proposed plan structure:
## Implementation Phases
1. Add dark mode state to ThemeProvider
2. Create toggle component in Settings
3. Add CSS variables for dark mode
4. Update tests
Does this phasing make sense?
User: Yes
Claude: I've created the detailed implementation plan.
The plan includes:
- Specific file changes for each phase
- Automated verification (tests, linting, type checking)
- Manual verification steps (UI testing, edge cases)
- Migration notes for existing themes
Ready to implement?
The implementation phase executes the plan systematically:
- One phase at a time
- Automated verification after each phase
- Manual testing checkpoints
- Clear progress tracking
Example:
User: Yes, let's implement
Claude: Starting Phase 1: Add dark mode state to ThemeProvider
[Makes changes to src/theme/ThemeProvider.tsx]
[Runs automated verification]
Phase 1 Complete - Ready for Manual Verification
Automated verification passed:
- ✓ Tests pass: npm test
- ✓ Linting passes: npm run lint
- ✓ Type checking passes: npm run typecheck
Please perform manual verification:
- [ ] Theme context provides dark mode state
- [ ] No console errors when theme changes
Let me know when testing is complete so I can proceed to Phase 2.
User: Tested, looks good
Claude: Great! Moving to Phase 2: Create toggle component in Settings
[Continues with next phase...]
The research phase uses Claude Code's Task tool with the Explore agent to:
- Find relevant files across the codebase
- Understand current implementations
- Discover existing patterns
- Run multiple searches concurrently for efficiency
Planning is collaborative:
- Multiple approach options presented
- User feedback incorporated at each step
- Clear structure approval before detail work
- Iterative refinement until satisfactory
Implementation is broken into verified phases:
- Automated checks (tests, linting, type checking)
- Manual verification checkpoints
- Progress tracking with TodoWrite
- Adaptation when reality differs from plan
When the plan doesn't match reality:
- Clear communication of the issue
- Explanation of why it matters
- Multiple adaptation options presented
- User decision on how to proceed
Description: Start the full Research-Plan-Implement workflow
Model: Opus (for thorough analysis and planning)
Interactive: Yes - guides you through all three phases with checkpoints
Phases:
- Research - Explore and understand the codebase
- Plan - Create detailed implementation roadmap
- Implement - Execute plan with verification
Description: Research and understand the codebase without planning or implementation
Model: Opus
Use when: You want to explore and document the current implementation before deciding on changes
Description: Design a detailed implementation plan (with optional research)
Model: Opus
Use when: You understand the codebase and want to create an implementation roadmap
Note: Named /design to avoid conflicts with Claude Code's native /plan command
Description: Execute an existing implementation plan with verification
Model: Opus
Use when: You have an approved plan and want to implement it systematically
The plugin includes specialized agents used during the research phase:
Finds WHERE code lives in the codebase. Locates and categorizes files by:
- Implementation files
- Test files
- Configuration
- Type definitions
- Documentation
Analyzes HOW code works. Provides:
- Data flow tracing
- Function documentation
- Component interactions
- State management patterns
- Error handling approaches
Discovers existing PATTERNS to follow. Identifies:
- Similar implementations
- Coding conventions
- Testing approaches
- Integration patterns
- Template structures
The plugin includes utility hooks:
Creates the research directory with epoch timestamp:
- Input: Short name (e.g., "dark_mode_toggle")
- Output: Directory path (e.g., ".claude/thoughts/1733595123_dark_mode_toggle")
- Validates naming format (lowercase, underscores only)
- Used automatically by
/researchand/rpicommands
/rpiUser: I need to add user authentication with JWT tokens
Claude: [RESEARCH PHASE]
Let me research authentication in your codebase...
Research Findings:
- Found Express middleware pattern in src/middleware/
- Existing user model in src/models/User.ts
- JWT library already in package.json
[PLAN PHASE]
Option 1: Add JWT to existing auth
Option 2: New auth service with JWT
Which approach?
[IMPLEMENT PHASE]
Phase 1: Add JWT signing to auth service
Automated ✓ | Manual testing needed
Phase 2: Create JWT middleware
Automated ✓ | Manual testing needed
Complete!
/rpiUser: I want to refactor the data fetching to use React Query
Claude: [RESEARCH PHASE]
Analyzing current data fetching...
Found:
- 15 components using useEffect + fetch
- Custom hooks in src/hooks/useApi.ts
- No caching layer
[PLAN PHASE]
Phased migration approach:
1. Install React Query
2. Create query hooks for API endpoints
3. Migrate components one by one
4. Remove old useApi hook
[IMPLEMENT PHASE]
Phase 1: Setup React Query
Phase 2: Create query hooks (5 endpoints)
Phase 3: Migrate components (15 files)
Phase 4: Cleanup old code
/rpiUser: Users are seeing duplicate items in the list
Claude: [RESEARCH PHASE]
Investigating list rendering...
Found:
- List component in src/components/ItemList.tsx:34
- Data fetch in src/hooks/useItems.ts:12
- Key prop using index instead of item.id
Root cause: Array index keys causing React to rerender incorrectly
[PLAN PHASE]
Fix approach:
1. Update key prop to use item.id
2. Add unique constraint check
3. Add test for duplicate prevention
[IMPLEMENT PHASE]
Phase 1: Fix key props
Automated ✓ | Manual ✓
Phase 2: Add tests
Automated ✓
Bug fixed!
✅ Good for:
- Complex features touching multiple files
- Refactoring with significant scope
- Features requiring architectural decisions
- Tasks needing careful planning
- Changes with unclear requirements initially
❌ Not needed for:
- Simple bug fixes with obvious solutions
- Typo corrections
- Minor documentation updates
- One-line changes
- Provide context upfront: Share tickets, requirements, constraints
- Engage in research: Confirm findings match your understanding
- Review the plan: Don't rush to implementation
- Test thoroughly: Manual verification is crucial
- Communicate issues: If something doesn't match, speak up
- Be specific about your requirements
- Ask questions during planning if anything is unclear
- Review each phase before approving next steps
- Test manually - automated tests don't catch everything
- Provide feedback to improve the plan
The plugin uses Opus model by default for thorough analysis. You can customize in your .claude/settings.json:
{
"commands": {
"rpi": {
"model": "opus"
}
}
}The research phase prevents costly mistakes. However, if you're very familiar with the code:
User: I already know the codebase well, can we go straight to planning?
Claude: Absolutely, let me create a plan based on what you know...
This is expected sometimes - codebases evolve:
Claude: Issue in Phase 2:
Expected: Authentication in src/auth/
Found: Actually in src/services/auth/
Should I adapt the plan to match current structure?
Each phase has clear checkpoints. You can pause and resume:
User: Let's stop after Phase 2, I need to review
Claude: No problem. Phase 2 complete and verified.
Resume with Phase 3 whenever you're ready.
To contribute improvements to this plugin:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
Apache-2.0
Carlos Lezama (carlos@carrots.sh)
For issues, questions, or suggestions:
- Open an issue on GitHub
- Check existing documentation
- Review example workflows above
- Initial release
- Research-Plan-Implement workflow
- Parallel agent research
- Interactive planning
- Phased implementation with verification