|
| 1 | +--- |
| 2 | +description: "Create interactive implementation plan from GitHub issue" |
| 3 | +argument-hint: "<issue-number> [--no-review]" |
| 4 | +allowed-tools: |
| 5 | + - Bash |
| 6 | + - Read |
| 7 | + - Glob |
| 8 | + - Grep |
| 9 | +--- |
| 10 | + |
| 11 | +# Plan Issue |
| 12 | + |
| 13 | +Fetch a GitHub issue and create an interactive, detailed implementation plan with clear rationale for each decision. |
| 14 | + |
| 15 | +## Usage |
| 16 | + |
| 17 | +``` |
| 18 | +/plan-issue <issue-number> [--no-review] |
| 19 | +``` |
| 20 | + |
| 21 | +**Required argument:** |
| 22 | +- `issue-number`: The GitHub issue number to create a plan for |
| 23 | + |
| 24 | +**Optional flag:** |
| 25 | +- `--no-review`: Skip interactive review and proceed directly to plan mode (useful when you trust the automated plan generation) |
| 26 | + |
| 27 | +## Workflow |
| 28 | + |
| 29 | +### 1. Validate Issue Number |
| 30 | +- Check if `$1` (issue number) is provided |
| 31 | +- If NOT provided, ask the user to provide the issue number and stop |
| 32 | +- If provided, proceed with fetching the issue |
| 33 | + |
| 34 | +### 2. Fetch Issue Data |
| 35 | +Retrieve comprehensive issue information using GitHub CLI: |
| 36 | + |
| 37 | +```bash |
| 38 | +gh issue view {issue-number} --json number,title,body,labels,assignees,milestone |
| 39 | +``` |
| 40 | + |
| 41 | +Extract and analyze: |
| 42 | +- Issue title and number |
| 43 | +- Full issue body (requirement, implementation details, etc.) |
| 44 | +- Labels (feat, fix, doc, agent, etc.) |
| 45 | +- Any structured sections (Requirement, Implementation Plan, etc.) |
| 46 | + |
| 47 | +### 3. Analyze Issue Content |
| 48 | + |
| 49 | +Parse the issue body to understand: |
| 50 | + |
| 51 | +**Problem/Requirement Analysis:** |
| 52 | +- What is the core problem or requirement? |
| 53 | +- Why does this need to be solved? |
| 54 | +- What is the expected outcome? |
| 55 | +- Are there any constraints or considerations? |
| 56 | + |
| 57 | +**Context Gathering:** |
| 58 | +- Review related files mentioned in the issue |
| 59 | +- Check existing patterns in the codebase |
| 60 | +- Identify dependencies or related features |
| 61 | + |
| 62 | +### 4. Generate Initial Plan |
| 63 | + |
| 64 | +Create a structured implementation plan with the following sections: |
| 65 | + |
| 66 | +#### Problem Analysis |
| 67 | +- **What**: Clear statement of what needs to be solved |
| 68 | +- **Why**: Explanation of why this is important |
| 69 | +- **Context**: Relevant background information |
| 70 | + |
| 71 | +#### Solution Approach |
| 72 | +- **Strategy**: High-level approach to solving the problem |
| 73 | +- **Architecture**: Key design decisions and their rationale |
| 74 | +- **Alternatives Considered**: Other approaches and why they weren't chosen |
| 75 | +- **Trade-offs**: What we're optimizing for and what we're accepting |
| 76 | + |
| 77 | +#### Implementation Steps |
| 78 | +For each step, include: |
| 79 | +- **Step description**: What will be done |
| 80 | +- **Rationale**: Why this step is necessary |
| 81 | +- **How**: Specific approach or method |
| 82 | +- **Files affected**: Which files will be created/modified |
| 83 | +- **Dependencies**: What needs to be done first |
| 84 | + |
| 85 | +#### Success Criteria |
| 86 | +- How will we know the implementation is complete? |
| 87 | +- What should be tested? |
| 88 | +- What documentation needs to be updated? |
| 89 | + |
| 90 | +### 5. Interactive Step-by-Step Review |
| 91 | + |
| 92 | +**IMPORTANT:** Check if `--no-review` flag is present: |
| 93 | +- If `$2` is `--no-review`, skip the interactive review process entirely and proceed directly to step 6 |
| 94 | +- Otherwise, ask the user for their review preference: |
| 95 | + - "Would you like to review each section step-by-step, or should I proceed without review?" |
| 96 | + - If user says "no review" or "proceed without review" or similar, skip to step 6 |
| 97 | + - If user wants review, proceed with step-by-step approval below |
| 98 | + |
| 99 | +**Step-by-step approval process:** |
| 100 | + |
| 101 | +1. **Present Problem Analysis section** |
| 102 | + - Show the "Problem Analysis" section with What/Why/Context |
| 103 | + - Explain the reasoning behind the problem understanding |
| 104 | + - Ask: "Does this problem analysis accurately capture the issue? Any adjustments needed?" |
| 105 | + - Wait for user response and iterate if needed |
| 106 | + - Get explicit approval before proceeding |
| 107 | + |
| 108 | +2. **Present Solution Approach section** |
| 109 | + - Show the "Solution Approach" section with Strategy/Architecture/Alternatives/Trade-offs |
| 110 | + - Explain key design decisions and why they were chosen |
| 111 | + - Ask: "Does this solution approach make sense? Are there alternative approaches we should consider?" |
| 112 | + - Wait for user response and iterate if needed |
| 113 | + - Get explicit approval before proceeding |
| 114 | + |
| 115 | +3. **Present Implementation Steps section** |
| 116 | + - Show the "Implementation Steps" with detailed breakdown |
| 117 | + - Explain the order and dependencies between steps |
| 118 | + - Ask: "Are these implementation steps clear and complete? Should any steps be added, removed, or reordered?" |
| 119 | + - Wait for user response and iterate if needed |
| 120 | + - Get explicit approval before proceeding |
| 121 | + |
| 122 | +4. **Present Success Criteria section** |
| 123 | + - Show the "Success Criteria" section |
| 124 | + - Explain how we'll verify completion |
| 125 | + - Ask: "Are these success criteria sufficient? Anything missing?" |
| 126 | + - Wait for user response and iterate if needed |
| 127 | + - Get explicit approval before proceeding |
| 128 | + |
| 129 | +5. **Final confirmation** |
| 130 | + - Summarize the complete plan |
| 131 | + - Ask: "The plan is ready. Should I enter plan mode and begin implementation?" |
| 132 | + - Wait for final approval |
| 133 | + |
| 134 | +### 6. Enter Plan Mode |
| 135 | + |
| 136 | +Once the user approves the plan: |
| 137 | +- Use the `ExitPlanMode` tool with the finalized plan |
| 138 | +- The plan should be concise but include key sections: |
| 139 | + - Problem summary |
| 140 | + - Solution approach |
| 141 | + - Implementation steps |
| 142 | + - Success criteria |
| 143 | + |
| 144 | +## Examples |
| 145 | + |
| 146 | +### Basic Usage (with interactive review) |
| 147 | + |
| 148 | +```bash |
| 149 | +/plan-issue 13 |
| 150 | +``` |
| 151 | + |
| 152 | +This will: |
| 153 | +1. Fetch issue #13 from GitHub |
| 154 | +2. Analyze the issue content (title, body, labels, etc.) |
| 155 | +3. Generate a comprehensive implementation plan with Problem Analysis, Solution Approach, Implementation Steps, and Success Criteria |
| 156 | +4. Ask if you want step-by-step review or proceed without review |
| 157 | +5. If you choose review, present each section interactively for approval |
| 158 | +6. Enter plan mode with the finalized plan |
| 159 | + |
| 160 | +### Quick Mode (skip review) |
| 161 | + |
| 162 | +```bash |
| 163 | +/plan-issue 13 --no-review |
| 164 | +``` |
| 165 | + |
| 166 | +This will: |
| 167 | +1. Fetch issue #13 from GitHub |
| 168 | +2. Analyze the issue content |
| 169 | +3. Generate the complete implementation plan |
| 170 | +4. **Directly enter plan mode without interactive review** (useful when you trust the automated plan or want to iterate quickly) |
| 171 | + |
| 172 | +### Example Output Structure |
| 173 | + |
| 174 | +After analyzing the issue, the command will generate a plan like: |
| 175 | + |
| 176 | +```markdown |
| 177 | +## Problem Analysis |
| 178 | +**What**: [Clear statement of the problem] |
| 179 | +**Why**: [Importance and context] |
| 180 | +**Context**: [Relevant background information] |
| 181 | + |
| 182 | +## Solution Approach |
| 183 | +**Strategy**: [High-level approach] |
| 184 | +**Architecture**: [Key design decisions and rationale] |
| 185 | +**Alternatives Considered**: [Other options and why they weren't chosen] |
| 186 | +**Trade-offs**: [What we're optimizing for] |
| 187 | + |
| 188 | +## Implementation Steps |
| 189 | +1. [Step description] |
| 190 | + - Rationale: [Why this is needed] |
| 191 | + - How: [Specific approach] |
| 192 | + - Files: [Files to create/modify] |
| 193 | + - Dependencies: [What needs to be done first] |
| 194 | + |
| 195 | +2. [Next step...] |
| 196 | + |
| 197 | +## Success Criteria |
| 198 | +- [How to verify completion] |
| 199 | +- [What to test] |
| 200 | +- [Documentation updates needed] |
| 201 | +``` |
| 202 | + |
| 203 | +## Best Practices |
| 204 | + |
| 205 | +### Analysis |
| 206 | +- Read the issue thoroughly before planning |
| 207 | +- Look for existing patterns in the codebase |
| 208 | +- Consider edge cases and error handling |
| 209 | +- Think about testing requirements |
| 210 | + |
| 211 | +### Communication |
| 212 | +- Be transparent about reasoning |
| 213 | +- Explain trade-offs clearly |
| 214 | +- Use concrete examples when helpful |
| 215 | +- Break down complex steps into smaller ones |
| 216 | + |
| 217 | +### Iteration |
| 218 | +- Welcome user feedback and questions |
| 219 | +- Be willing to revise the approach |
| 220 | +- Don't commit to a plan without user approval |
| 221 | +- Acknowledge when the user has better insights |
| 222 | + |
| 223 | +### Plan Structure |
| 224 | +- Keep implementation steps actionable and specific |
| 225 | +- Order steps logically with dependencies clear |
| 226 | +- Include both "what" and "why" for each step |
| 227 | +- Make success criteria measurable |
0 commit comments