The Problem
Without structure, complex features often fail:- Jumping into implementation without understanding the codebase
- Missing edge cases or dependencies
- Discovering plan was wrong after 20 edits
- No clear stopping points for review
The Solution: RPI Workflow
Research > Plan > Implement with validation gates between each phase.Phase 1: Research
Goal: Assess feasibility and gather context before planning.Activities
Confidence Scoring
Score each dimension 0-20 points:| Dimension | Question | 0 Points | 20 Points |
|---|---|---|---|
| Scope Clarity | Know exactly what files change? | No idea | Complete list |
| Pattern Familiarity | Similar patterns exist? | Never seen | Multiple examples |
| Dependency Awareness | Know what depends on this? | Unknown | Fully mapped |
| Edge Cases | Can identify edge cases? | Uncertain | Comprehensive list |
| Test Strategy | Know how to verify? | Unclear | Clear test plan |
- 70-100: GO to planning
- 50-69: Gather more context, re-score
- 0-49: Ask user for more information
Research Output
Phase 2: Plan
Goal: Design the solution and get approval before writing code.Plan Template
Real Example
Example: Webhook Support Plan
Example: Webhook Support Plan
Approval Gate
Wait for explicit approval:- “proceed”
- “approved”
- “go ahead”
- “looks good”
- Ask clarifying questions
- Revise the plan
- Present revised plan
- Wait for approval again
Never proceed to implementation without explicit approval. This is the most critical gate.
Phase 3: Implement
Goal: Execute the plan step by step with quality gates.Implementation Rules
Review Checkpoints
Every 5 edits, pause and report:Quality Gates
Before marking implementation complete:- Lint
- Typecheck
- Tests
- Self-Review
When Plan Is Wrong
If implementation reveals the plan was incorrect:- Stop implementation
- Document what you learned
- Go back to Phase 2 (Plan)
- Revise the plan
- Get approval again
- Resume implementation
Phase 4: Review & Commit
Goal: Final verification before committing.Review Checklist
Security Review
Security Review
- No hardcoded credentials or API keys
- Input validation on all user data
- SQL injection prevention (parameterized queries)
- XSS prevention (sanitized output)
- Authentication and authorization checks
- HTTPS for external calls
Code Quality
Code Quality
- Follows existing code patterns
- No copy-paste duplication
- Clear variable and function names
- Comments for non-obvious logic
- Error messages are helpful
- No debug statements (console.log, debugger)
Testing
Testing
- Unit tests for business logic
- Integration tests for API endpoints
- Edge cases covered
- Error cases covered
- Tests are maintainable (not brittle)
- Coverage maintained or increased
Documentation
Documentation
- README updated if needed
- API documentation updated
- Migration instructions if schema changed
- CHANGELOG entry
Commit Message
Use conventional commit format:The /develop Command
Pro Workflow provides a/develop command that orchestrates all phases:
What It Does
Orchestrator Agent
The orchestrator agent drives the process:- Opus model for deep reasoning
- Project memory to recall patterns
- Pre-loaded with pro-workflow skill
- Full tool access for all phases
When to Use Multi-Phase
| Scenario | Use Multi-Phase? |
|---|---|
| Feature touches > 5 files | ✓ Yes |
| Architecture decision needed | ✓ Yes |
| Requirements unclear | ✓ Yes |
| Multiple approaches possible | ✓ Yes |
| Simple bug fix | ✗ No, just fix it |
| Single file change | ✗ No, too much overhead |
| Typo or formatting | ✗ No, directly edit |
Best Practices
Do
Score confidence honestly in research phase
Wait for explicit approval before implementing
Follow plan order during implementation
Run tests after each file change
Pause at review checkpoints (every 5 edits)
Go back to planning if plan is wrong
Capture learnings at the end
Don’t
Real-World Examples
Feature: User Authentication
Feature: User Authentication
Research Phase:
- Found existing auth stubs in
src/auth/ - JWT pattern used in sister project
- Database schema needs migration
- Score: 78/100 → GO
- 8 files to modify
- 3 new files (middleware, service, types)
- Approach: JWT + refresh tokens
- Risks: Token rotation, concurrent sessions
- Approved by user
- Checkpoint 1: JWT generation (5 files)
- Checkpoint 2: Refresh flow (5 files)
- Checkpoint 3: Middleware (3 files)
- All tests passing
- Security: HTTPS required, tokens expire
- Quality: Follows existing patterns
- Tests: 95% coverage
- Committed
Feature: GraphQL API
Feature: GraphQL API
Research Phase:
- No GraphQL in codebase
- REST patterns well-established
- Score: 45/100 → HOLD
- Asked user: “Should this use GraphQL or extend REST API?”
- “Extend REST for now, GraphQL later”
- REST patterns clear
- Versioning strategy exists
- Score: 82/100 → GO
Integration with Other Patterns
Multi-phase development works with: Self-Correction Loop- Capture corrections from each phase as [LEARN] rules
- Apply learnings in future research phases
- Run research in background worktree while continuing other work
- Don’t block on planning
- Review checkpoints align with 80/20 pattern
- Batch reviews at phase boundaries
- Parallel research: multiple teammates explore different approaches
- Lead synthesizes findings into single plan
Next Steps
Orchestration Patterns
Learn advanced orchestration techniques
Self-Correction Loop
Capture learnings from each phase