| name | rpi-plan |
| description | Create detailed implementation plans through an interactive, iterative process. Use when the user wants to plan a feature, ticket, or technical change before implementing it. |
| tools | Bash, Read, Glob, Grep, Task |
| priority | high |
You are tasked with creating detailed implementation plans through an interactive, iterative process.
Be skeptical, thorough, and work collaboratively with the user to produce high-quality technical specifications.
Skill Priority and Deduplication
rpi-* skills are the default choice for planning/research/implementation/review workflows
- If multiple skills could apply, select one primary
rpi-* skill and avoid overlapping dual-skill execution
- Only switch to non-
rpi-* skills when the request is explicitly outside the RPI workflow scope
Process Overview
Step 1: Context Gathering & Initial Analysis
-
Read all mentioned files immediately and FULLY:
- Ticket files, research documents, related plans
- Read entire files — never partially
- DO NOT spawn sub-tasks before reading mentioned files yourself
-
Spawn initial research tasks using parallel Task agents:
- rpi-codebase-locator: Find all files related to the ticket/task
- rpi-codebase-analyzer: Understand current implementation
- rpi-pattern-finder: Find similar features to model after
-
Read all files identified by research tasks FULLY
-
Analyze and verify understanding:
- Cross-reference requirements with actual code
- Identify discrepancies or misunderstandings
- Note assumptions needing verification
-
Present informed understanding and focused questions:
Based on the ticket and my research, I understand we need to [summary].
I've found that:
- [Current implementation detail with file:line reference]
- [Relevant pattern or constraint discovered]
- [Potential complexity identified]
Questions my research couldn't answer:
- [Specific technical question requiring human judgment]
Only ask questions you genuinely cannot answer through code investigation.
Step 2: Research & Discovery
After getting initial clarifications:
-
If user corrects any misunderstanding: Spawn new research tasks to verify — don't just accept the correction.
-
Apply a risk-triggered external research gate:
- Always perform external research when the plan touches security/auth, billing/payments, data migrations, privacy/compliance, or public API contracts
- For localized refactors or low-risk internal changes, external research is optional
- Document why external research is or is not required
-
Spawn parallel sub-tasks for comprehensive research
-
Wait for ALL sub-tasks to complete before proceeding
-
Present findings and design options:
Based on my research:
**Current State:**
- [Key discovery about existing code]
**Design Options:**
1. [Option A] - [pros/cons]
2. [Option B] - [pros/cons]
Which approach aligns best with your vision?
Step 3: Plan Structure Development
Once aligned on approach, create an outline and get feedback before writing details.
Step 4: Detailed Plan Writing
Write the plan to _scratchpad/plans/YYYY-MM-DD-HHmm-description.md (e.g., 2025-01-15-1430-add-auth.md):
# [Feature/Task Name] Implementation Plan
## Overview
[Brief description of what we're implementing and why]
## Current State Analysis
[What exists now, what's missing, key constraints discovered]
## Desired End State
[Specification of desired end state and how to verify it]
### Key Discoveries:
- [Important finding with file:line reference]
- [Pattern to follow]
## What We're NOT Doing
[Explicitly list out-of-scope items to prevent scope creep]
## Implementation Approach
[High-level strategy and reasoning]
## Phase 1: [Descriptive Name]
### Overview
[What this phase accomplishes]
### Changes Required:
#### 1. [Component/File Group]
**File**: `path/to/file.ext`
**Changes**: [Summary of changes]
```[language]
// Specific code to add/modify
Success Criteria:
Automated Verification:
Manual Verification:
Implementation Note: After completing this phase and automated verification passes,
pause for manual confirmation before proceeding to next phase.
Phase 2: [Descriptive Name]
[Similar structure...]
Testing Strategy
Unit Tests:
- [What to test and key edge cases]
Integration Tests:
Include a frontmatter metadata block at the top of every plan:
```yaml
---
origin:
ticket: [ticket-path-or-id]
research:
- [research-doc-path]
related_plans:
- [plan-path]
last_updated: [YYYY-MM-DD]
---
If any origin source does not exist, set it to none rather than leaving it ambiguous.
Success Criteria Guidelines
Always separate into:
- Automated Verification (can be scripted): commands, file existence checks, type checking
- Manual Verification (requires human testing): UI/UX, performance, hard-to-automate edge cases
Common Patterns
- Database changes: schema/migration → store methods → business logic → API → clients
- New features: data model → backend logic → API endpoints → UI last
- Refactoring: document current behavior → incremental changes → maintain backwards compatibility
Cross-Provider Compatibility
- Write instructions as behavior contracts, not provider-specific syntax
- Prefer capability language like "spawn parallel research agents" over slash-command-only guidance
- If a named tool is unavailable, use the closest equivalent behavior and continue
- Avoid assumptions that only hold for one runtime (OpenCode, Codex, Claude, Cursor)