|
| 1 | +--- |
| 2 | +name: plan-and-execute |
| 3 | +description: Automatically plan and execute requirements. Creates a markdown task list with the UpdatePlan tool, and systematically executes each task while updating progress. Use when working with task planning or when you need to break down and execute complex multi-step requirements. |
| 4 | +--- |
| 5 | + |
| 6 | +# Plan and Execute |
| 7 | + |
| 8 | +This Skill helps you automatically plan and execute requirements. It creates a structured markdown task list with the UpdatePlan tool and systematically works through each task while keeping progress visible. |
| 9 | + |
| 10 | +## Quick Start |
| 11 | + |
| 12 | +When you need to work through a multi-step request: |
| 13 | + |
| 14 | +1. Analyze the requirements and explore enough project context |
| 15 | +2. Clarify unclear or ambiguous requirements with AskUserQuestion |
| 16 | +3. Create a markdown task list by calling the UpdatePlan tool |
| 17 | +4. Execute tasks one by one, updating the tool plan in real time |
| 18 | +5. Revise the remaining plan as new context appears |
| 19 | + |
| 20 | +## Instructions |
| 21 | + |
| 22 | +### Step 1: Analyze the requirements |
| 23 | + |
| 24 | +Identify the requirements from the available context. Explore the project enough to make the plan concrete and accurate. |
| 25 | + |
| 26 | +If the original requirements are unclear, incomplete, or ambiguous, call the AskUserQuestion tool before creating the task list. Ask only the questions needed to avoid implementing the wrong behavior, and keep each question specific to the decision that affects the plan or acceptance criteria. |
| 27 | + |
| 28 | +If a required referenced file path is missing, ask for it with AskUserQuestion: |
| 29 | + |
| 30 | +``` |
| 31 | +What is the path to the referenced file? |
| 32 | +``` |
| 33 | + |
| 34 | +Referenced files can be in any text format (.md, .txt, etc.) that contains task requirements or feature descriptions. If no additional file is needed, continue from the available requirements. |
| 35 | + |
| 36 | +- What are the main requirements? |
| 37 | +- What tasks need to be completed? |
| 38 | +- Are there dependencies between tasks? |
| 39 | +- What is the complexity level? |
| 40 | +- Which files, modules, commands, or tests are relevant? |
| 41 | +- What ambiguity would change the implementation or acceptance criteria? |
| 42 | + |
| 43 | +### Step 2: Create the task list |
| 44 | + |
| 45 | +Create a structured markdown task list and pass it to the UpdatePlan tool as the `plan` string. The tool input must use this shape: |
| 46 | + |
| 47 | +```json |
| 48 | +{ |
| 49 | + "plan": "## Task List\n\n- [ ] Task 1 description\n- [ ] Task 2 description\n- [ ] Task 3 description" |
| 50 | +} |
| 51 | +``` |
| 52 | + |
| 53 | +Use this markdown format for the `plan` content: |
| 54 | + |
| 55 | +```markdown |
| 56 | +## Task List |
| 57 | + |
| 58 | +- [ ] Task 1 description |
| 59 | +- [ ] Task 2 description |
| 60 | +- [ ] Task 3 description |
| 61 | +``` |
| 62 | + |
| 63 | +Break down complex requirements into specific, actionable tasks and call UpdatePlan with the full markdown task list. |
| 64 | + |
| 65 | +### Step 3: Execute tasks systematically |
| 66 | + |
| 67 | +For each task in the list: |
| 68 | + |
| 69 | +1. **Refresh the plan**: Before starting the first task and after completing each task, re-evaluate the latest conversation and project context. Update the remaining tasks when scope, order, blockers, or follow-up work changes. |
| 70 | +2. **Mark as in progress**: Call UpdatePlan with the task changed from `[ ]` to `[>]` |
| 71 | +3. **Execute the task**: Use appropriate tools to complete the work |
| 72 | +4. **Mark as completed**: Call UpdatePlan with the task changed from `[>]` to `[x]` when finished |
| 73 | +5. **Move to next task**: Only ONE task should be in progress at a time |
| 74 | + |
| 75 | +Important rules: |
| 76 | +- Always keep the plan aligned with the latest context before executing the next task |
| 77 | +- Always call UpdatePlan BEFORE starting work on a task |
| 78 | +- Always call UpdatePlan IMMEDIATELY after completing a task |
| 79 | +- Always pass the complete current markdown task list, not a partial diff |
| 80 | +- Never work on multiple tasks simultaneously |
| 81 | +- Remove tasks that are no longer relevant, and add newly discovered tasks before working on them |
| 82 | +- If you encounter errors, keep the task as `[>]` and create new tasks to resolve blockers |
| 83 | + |
| 84 | +### Step 4: Handle task breakdown |
| 85 | + |
| 86 | +If during execution you discover a task is more complex than expected: |
| 87 | + |
| 88 | +1. Keep the current task as `[>]` |
| 89 | +2. Call UpdatePlan with new sub-tasks below it with indentation: |
| 90 | + ```markdown |
| 91 | + - [>] Main task |
| 92 | + - [ ] Sub-task 1 |
| 93 | + - [ ] Sub-task 2 |
| 94 | + ``` |
| 95 | +3. Complete sub-tasks first, then mark the main task as complete with UpdatePlan |
| 96 | + |
| 97 | +### Step 5: Final verification |
| 98 | + |
| 99 | +After all tasks are completed (`[x]`): |
| 100 | + |
| 101 | +1. Review the original requirements to ensure everything is addressed |
| 102 | +2. Run any final checks (tests, builds, linting) |
| 103 | +3. Call UpdatePlan with every task marked `[x]` |
| 104 | +4. Provide a concise completion summary in the final response |
| 105 | + |
| 106 | +## Task State Symbols |
| 107 | + |
| 108 | +- `[ ]` - Pending |
| 109 | +- `[>]` - In progress |
| 110 | +- `[x]` - Completed |
| 111 | +- `[!]` - Blocked |
| 112 | + |
| 113 | +## Examples |
| 114 | + |
| 115 | +### Example 1: Simple feature request |
| 116 | + |
| 117 | +**Example requirements:** |
| 118 | +```markdown |
| 119 | +# 新功能:添加深色模式切换 |
| 120 | + |
| 121 | +用户应该能够在浅色和深色主题之间切换。 |
| 122 | +切换开关应放在设置页面中。 |
| 123 | +``` |
| 124 | + |
| 125 | +**分析后的 UpdatePlan 调用:** |
| 126 | +```markdown |
| 127 | +## Task List |
| 128 | + |
| 129 | +- [ ] 在设置页面创建深色模式切换组件 |
| 130 | +- [ ] 添加深色模式状态管理(context/store) |
| 131 | +- [ ] 实现深色主题的 CSS-in-JS 样式 |
| 132 | +- [ ] 更新现有组件以支持主题切换 |
| 133 | +- [ ] 运行测试并验证功能 |
| 134 | +``` |
| 135 | + |
| 136 | +**UpdatePlan call during execution:** |
| 137 | +```markdown |
| 138 | +## Task List |
| 139 | + |
| 140 | +- [x] 在设置页面创建深色模式切换组件 |
| 141 | +- [>] 添加深色模式状态管理(context/store) |
| 142 | +- [ ] 实现深色主题的 CSS-in-JS 样式 |
| 143 | +- [ ] 更新现有组件以支持主题切换 |
| 144 | +- [ ] 运行测试并验证功能 |
| 145 | +``` |
| 146 | + |
| 147 | +### Example 2: Bug fix with investigation |
| 148 | + |
| 149 | +**Example requirements:** |
| 150 | +```markdown |
| 151 | +# Fix bug:登录表单提交时崩溃 |
| 152 | + |
| 153 | +当用户点击提交时,应用崩溃。 |
| 154 | +错误信息:"Cannot read property 'email' of undefined" |
| 155 | +``` |
| 156 | + |
| 157 | +**UpdatePlan call after analysis:** |
| 158 | +```markdown |
| 159 | +## Task List |
| 160 | + |
| 161 | +- [ ] 在本地复现缺陷 |
| 162 | +- [ ] 调查登录表单组件中的错误 |
| 163 | +- [ ] 定位 undefined email 属性的根本原因 |
| 164 | +- [ ] 实施修复 |
| 165 | +- [ ] 添加验证以防止类似问题 |
| 166 | +- [ ] 使用各种输入测试修复 |
| 167 | +- [ ] 更新错误处理 |
| 168 | +``` |
| 169 | + |
| 170 | +## When to Use This Skill |
| 171 | + |
| 172 | +Use this Skill when: |
| 173 | + |
| 174 | +1. **Complex multi-step tasks** - Request requires 3+ distinct steps |
| 175 | +2. **Feature implementation** - Building new functionality from requirements |
| 176 | +3. **Bug fixing** - Need to investigate, fix, and verify |
| 177 | +4. **Refactoring** - Multiple files or components need changes |
| 178 | +5. **Detailed requirements** - Specifications need to be translated into concrete tasks |
| 179 | +6. **Need progress tracking** - Want visible progress without editing source files |
| 180 | + |
| 181 | +## When NOT to Use This Skill |
| 182 | + |
| 183 | +Skip this Skill when: |
| 184 | + |
| 185 | +1. **Single simple task** - Just one straightforward action needed |
| 186 | +2. **Trivial changes** - Quick fixes that don't need planning |
| 187 | +3. **Informational requests** - User just wants explanation, not execution |
| 188 | +4. **No execution requested** - User only wants brainstorming or a high-level explanation |
| 189 | + |
| 190 | +## Best Practices |
| 191 | + |
| 192 | +1. **Be specific with tasks**: "Add login button to navbar" not "Update UI" |
| 193 | +2. **Keep tasks atomic**: Each task should be independently completable |
| 194 | +3. **Update immediately**: Don't batch status updates, do them in real-time |
| 195 | +4. **One task at a time**: Never mark multiple tasks as `[>]` |
| 196 | +5. **Handle blockers**: If stuck, create new tasks to resolve the blocker |
| 197 | +6. **Verify completion**: Only mark `[x]` when task is fully done |
| 198 | + |
| 199 | +## Advanced Usage |
| 200 | + |
| 201 | +### Handling dependencies |
| 202 | + |
| 203 | +When tasks have dependencies, order them properly: |
| 204 | + |
| 205 | +```markdown |
| 206 | +- [ ] Create database schema |
| 207 | +- [ ] Implement API endpoints (depends on schema) |
| 208 | +- [ ] Build frontend forms (depends on API) |
| 209 | +``` |
| 210 | + |
| 211 | +### Using sub-tasks |
| 212 | + |
| 213 | +For complex tasks, break them down: |
| 214 | + |
| 215 | +```markdown |
| 216 | +- [>] Implement authentication system |
| 217 | + - [x] Set up JWT library |
| 218 | + - [>] Create login endpoint |
| 219 | + - [ ] Create logout endpoint |
| 220 | + - [ ] Add token refresh logic |
| 221 | +``` |
| 222 | + |
| 223 | +### Adding notes |
| 224 | + |
| 225 | +Add implementation notes or findings: |
| 226 | + |
| 227 | +```markdown |
| 228 | +- [x] Investigate performance issue |
| 229 | + - Note: Found N+1 query in user loader |
| 230 | + - Solution: Added dataloader batching |
| 231 | +``` |
| 232 | + |
| 233 | +## Workflow Summary |
| 234 | + |
| 235 | +1. Analyze the requirements and relevant project context |
| 236 | +2. Call AskUserQuestion if the original requirements are unclear or ambiguous |
| 237 | +3. Call UpdatePlan with the structured markdown task list |
| 238 | +4. Refresh the remaining plan before the first task |
| 239 | +5. For each task: |
| 240 | + - Update to `[>]` with UpdatePlan |
| 241 | + - Execute the task |
| 242 | + - Update to `[x]` with UpdatePlan |
| 243 | + - Re-evaluate and revise remaining tasks before moving on |
| 244 | +6. Call UpdatePlan with all tasks completed and summarize the result |
| 245 | + |
| 246 | +This approach keeps planning and progress tracking in the UpdatePlan display, leaving source materials unchanged unless the actual task requires editing them. |
0 commit comments