aiblueprint-cli 1.4.24 → 1.4.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/claude-code-config/skills/workflow-apex-free/SKILL.md +261 -0
- package/claude-code-config/skills/workflow-apex-free/scripts/setup-templates.sh +100 -0
- package/claude-code-config/skills/workflow-apex-free/scripts/update-progress.sh +80 -0
- package/claude-code-config/skills/workflow-apex-free/steps/step-00-init.md +267 -0
- package/claude-code-config/skills/workflow-apex-free/steps/step-00b-branch.md +126 -0
- package/claude-code-config/skills/workflow-apex-free/steps/step-00b-economy.md +244 -0
- package/claude-code-config/skills/workflow-apex-free/steps/step-00b-interactive.md +153 -0
- package/claude-code-config/skills/workflow-apex-free/steps/step-01-analyze.md +361 -0
- package/claude-code-config/skills/workflow-apex-free/steps/step-02-plan.md +264 -0
- package/claude-code-config/skills/workflow-apex-free/steps/step-03-execute.md +239 -0
- package/claude-code-config/skills/workflow-apex-free/steps/step-04-validate.md +251 -0
- package/claude-code-config/skills/workflow-apex-free/templates/00-context.md +43 -0
- package/claude-code-config/skills/workflow-apex-free/templates/01-analyze.md +10 -0
- package/claude-code-config/skills/workflow-apex-free/templates/02-plan.md +10 -0
- package/claude-code-config/skills/workflow-apex-free/templates/03-execute.md +10 -0
- package/claude-code-config/skills/workflow-apex-free/templates/04-validate.md +10 -0
- package/claude-code-config/skills/workflow-apex-free/templates/README.md +176 -0
- package/claude-code-config/skills/workflow-apex-free/templates/step-complete.md +7 -0
- package/dist/cli.js +179 -37
- package/package.json +1 -1
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: step-01-analyze
|
|
3
|
+
description: Pure context gathering - explore codebase to understand WHAT EXISTS
|
|
4
|
+
next_step: steps/step-02-plan.md
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Step 1: Analyze (Context Gathering)
|
|
8
|
+
|
|
9
|
+
## MANDATORY EXECUTION RULES (READ FIRST):
|
|
10
|
+
|
|
11
|
+
- 🛑 NEVER plan or design solutions - that's step 2
|
|
12
|
+
- 🛑 NEVER create todos or implementation tasks
|
|
13
|
+
- 🛑 NEVER decide HOW to implement anything
|
|
14
|
+
- ✅ ALWAYS focus on discovering WHAT EXISTS
|
|
15
|
+
- ✅ ALWAYS report findings with file paths and line numbers
|
|
16
|
+
- 📋 YOU ARE AN EXPLORER, not a planner
|
|
17
|
+
- 💬 FOCUS on "What is here?" NOT "What should we build?"
|
|
18
|
+
- 🚫 FORBIDDEN to suggest implementations or approaches
|
|
19
|
+
|
|
20
|
+
## 🧠 SMART AGENT STRATEGY
|
|
21
|
+
|
|
22
|
+
<critical>
|
|
23
|
+
**ADAPTIVE AGENT LAUNCHING** (unless economy_mode is true)
|
|
24
|
+
|
|
25
|
+
Before exploring, THINK about what information you need and launch the RIGHT agents - between 1 and 10 depending on task complexity.
|
|
26
|
+
|
|
27
|
+
**DO NOT blindly launch all agents. BE SMART.**
|
|
28
|
+
</critical>
|
|
29
|
+
|
|
30
|
+
## EXECUTION PROTOCOLS:
|
|
31
|
+
|
|
32
|
+
- 🎯 Launch parallel exploration agents (unless economy_mode)
|
|
33
|
+
- 💾 Append findings to output file (if save_mode)
|
|
34
|
+
- 📖 Document patterns with specific file:line references
|
|
35
|
+
- 🚫 FORBIDDEN to proceed until context is complete
|
|
36
|
+
|
|
37
|
+
## CONTEXT BOUNDARIES:
|
|
38
|
+
|
|
39
|
+
- Variables from step-00-init are available
|
|
40
|
+
- No implementation decisions have been made yet
|
|
41
|
+
- Codebase state is unknown - must be discovered
|
|
42
|
+
- Don't assume knowledge about the codebase
|
|
43
|
+
|
|
44
|
+
## YOUR TASK:
|
|
45
|
+
|
|
46
|
+
Gather ALL relevant context about WHAT CURRENTLY EXISTS in the codebase related to the task.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
<available_state>
|
|
51
|
+
From step-00-init:
|
|
52
|
+
|
|
53
|
+
| Variable | Description |
|
|
54
|
+
|----------|-------------|
|
|
55
|
+
| `{task_description}` | What to implement |
|
|
56
|
+
| `{task_id}` | Kebab-case identifier |
|
|
57
|
+
| `{auto_mode}` | Skip confirmations |
|
|
58
|
+
| `{examine_mode}` | Auto-proceed to review |
|
|
59
|
+
| `{save_mode}` | Save outputs to files |
|
|
60
|
+
| `{test_mode}` | Include test steps |
|
|
61
|
+
| `{economy_mode}` | No subagents, direct tools |
|
|
62
|
+
| `{output_dir}` | Path to output (if save_mode) |
|
|
63
|
+
</available_state>
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## EXECUTION SEQUENCE:
|
|
68
|
+
|
|
69
|
+
### 1. Initialize Save Output (if save_mode)
|
|
70
|
+
|
|
71
|
+
**If `{save_mode}` = true:**
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
bash {skill_dir}/scripts/update-progress.sh "{task_id}" "01" "analyze" "in_progress"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Append findings to `{output_dir}/01-analyze.md` as you work.
|
|
78
|
+
|
|
79
|
+
### 2. Extract Search Keywords
|
|
80
|
+
|
|
81
|
+
From the task description, identify:
|
|
82
|
+
- **Domain terms**: auth, user, payment, etc.
|
|
83
|
+
- **Technical terms**: API, route, component, etc.
|
|
84
|
+
- **Action hints**: create, update, fix, add, etc.
|
|
85
|
+
|
|
86
|
+
These keywords guide exploration - NOT planning.
|
|
87
|
+
|
|
88
|
+
### 3. Explore Codebase
|
|
89
|
+
|
|
90
|
+
**If `{economy_mode}` = true:**
|
|
91
|
+
→ Use direct tools (see step-00b-economy.md for rules)
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
1. Glob to find files: **/*{keyword}*
|
|
95
|
+
2. Grep to search content in likely locations
|
|
96
|
+
3. Read the most relevant 3-5 files
|
|
97
|
+
4. Skip web research unless stuck
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**If `{economy_mode}` = false:**
|
|
101
|
+
→ Use SMART agent strategy below
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
### 🧠 STEP 3A: ANALYZE TASK COMPLEXITY
|
|
106
|
+
|
|
107
|
+
**Before launching agents, THINK:**
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
Task: {task_description}
|
|
111
|
+
|
|
112
|
+
1. SCOPE: How many areas of the codebase are affected?
|
|
113
|
+
- Single file/function → Low
|
|
114
|
+
- Multiple related files → Medium
|
|
115
|
+
- Cross-cutting concerns → High
|
|
116
|
+
|
|
117
|
+
2. LIBRARIES: Which external libraries are involved?
|
|
118
|
+
- None or well-known basics → Skip docs
|
|
119
|
+
- Unfamiliar library or specific API needed → Need docs
|
|
120
|
+
- Multiple libraries interacting → Need multiple doc agents
|
|
121
|
+
|
|
122
|
+
3. PATTERNS: Do I need to understand existing patterns?
|
|
123
|
+
- Simple addition → Maybe skip codebase exploration
|
|
124
|
+
- Must integrate with existing code → Need codebase exploration
|
|
125
|
+
|
|
126
|
+
4. UNCERTAINTY: What am I unsure about?
|
|
127
|
+
- Clear requirements, known approach → Fewer agents
|
|
128
|
+
- Unclear approach, unfamiliar territory → More agents
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
### 🎯 STEP 3B: CHOOSE YOUR AGENTS (1-10)
|
|
134
|
+
|
|
135
|
+
**Available Agent Types:**
|
|
136
|
+
|
|
137
|
+
| Agent | Use When |
|
|
138
|
+
|-------|----------|
|
|
139
|
+
| `explore-codebase` | Need to find existing patterns, related files, utilities |
|
|
140
|
+
| `explore-docs` | Unfamiliar library API, need current syntax, complex feature |
|
|
141
|
+
| `websearch` | Need common approaches, best practices, gotchas |
|
|
142
|
+
|
|
143
|
+
**Decision Matrix:**
|
|
144
|
+
|
|
145
|
+
| Task Type | Agents Needed | Example |
|
|
146
|
+
|-----------|---------------|---------|
|
|
147
|
+
| **Simple fix** | 1-2 | Bug fix in known file → 1x explore-codebase |
|
|
148
|
+
| **Add feature (familiar stack)** | 2-3 | Add button → 1x explore-codebase + 1x websearch |
|
|
149
|
+
| **Add feature (unfamiliar library)** | 3-5 | Add Stripe → 1x codebase + 1x explore-docs (Stripe) + 1x websearch |
|
|
150
|
+
| **Complex integration** | 5-8 | Auth + payments → 1x codebase + 2-3x explore-docs + 1-2x websearch |
|
|
151
|
+
| **Major feature (multiple systems)** | 6-10 | Full e-commerce → Multiple codebase areas + multiple docs + research |
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
### 🚀 STEP 3C: LAUNCH AGENTS IN PARALLEL
|
|
156
|
+
|
|
157
|
+
**Launch ALL chosen agents in ONE message.**
|
|
158
|
+
|
|
159
|
+
**Agent Prompts:**
|
|
160
|
+
|
|
161
|
+
**`explore-codebase`** - Use for finding existing code:
|
|
162
|
+
```
|
|
163
|
+
Find existing code related to: {specific_area}
|
|
164
|
+
|
|
165
|
+
Report:
|
|
166
|
+
1. Files with paths and line numbers
|
|
167
|
+
2. Patterns used for similar features
|
|
168
|
+
3. Relevant utilities
|
|
169
|
+
4. Test patterns
|
|
170
|
+
|
|
171
|
+
DO NOT suggest implementations.
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**`explore-docs`** - Use ONLY when you need specific library knowledge:
|
|
175
|
+
```
|
|
176
|
+
Research {library_name} documentation for: {specific_question}
|
|
177
|
+
|
|
178
|
+
Find:
|
|
179
|
+
1. Current API for {specific_feature}
|
|
180
|
+
2. Code examples
|
|
181
|
+
3. Configuration needed
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**`websearch`** - Use for approaches and gotchas:
|
|
185
|
+
```
|
|
186
|
+
Search: {specific_question_or_approach}
|
|
187
|
+
|
|
188
|
+
Find common patterns and pitfalls.
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
### 📋 EXAMPLE AGENT LAUNCHES
|
|
194
|
+
|
|
195
|
+
**Simple task** (fix button styling) → 1 agent:
|
|
196
|
+
```
|
|
197
|
+
[Task: explore-codebase - find button components and styling patterns]
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
**Medium task** (add user profile page) → 3 agents:
|
|
201
|
+
```
|
|
202
|
+
[Task: explore-codebase - find user-related components and data fetching patterns]
|
|
203
|
+
[Task: explore-codebase - find page layout and routing patterns]
|
|
204
|
+
[Task: websearch - Next.js profile page best practices]
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**Complex task** (add Stripe subscriptions) → 6 agents:
|
|
208
|
+
```
|
|
209
|
+
[Task: explore-codebase - find existing payment/billing code]
|
|
210
|
+
[Task: explore-codebase - find user account and settings patterns]
|
|
211
|
+
[Task: explore-docs - Stripe subscription API and webhooks]
|
|
212
|
+
[Task: explore-docs - Stripe Customer Portal integration]
|
|
213
|
+
[Task: websearch - Stripe subscriptions Next.js implementation]
|
|
214
|
+
[Task: websearch - Stripe webhook security best practices]
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### 4. Synthesize Findings
|
|
218
|
+
|
|
219
|
+
Combine results into structured context:
|
|
220
|
+
|
|
221
|
+
```markdown
|
|
222
|
+
## Codebase Context
|
|
223
|
+
|
|
224
|
+
### Related Files Found
|
|
225
|
+
| File | Lines | Contains |
|
|
226
|
+
|------|-------|----------|
|
|
227
|
+
| `src/auth/login.ts` | 1-150 | Existing login implementation |
|
|
228
|
+
| `src/utils/validate.ts` | 20-45 | Email validation helper |
|
|
229
|
+
|
|
230
|
+
### Patterns Observed
|
|
231
|
+
- **Route pattern**: Uses Next.js App Router with `route.ts`
|
|
232
|
+
- **Validation**: Uses zod schemas in `schemas/` folder
|
|
233
|
+
- **Error handling**: Throws custom ApiError classes
|
|
234
|
+
|
|
235
|
+
### Utilities Available
|
|
236
|
+
- `src/lib/auth.ts` - JWT sign/verify functions
|
|
237
|
+
- `src/lib/db.ts` - Prisma client instance
|
|
238
|
+
|
|
239
|
+
### Similar Implementations
|
|
240
|
+
- `src/auth/login.ts:42` - Login flow (reference for patterns)
|
|
241
|
+
|
|
242
|
+
### Test Patterns
|
|
243
|
+
- Tests in `__tests__/` folders
|
|
244
|
+
- Uses vitest with testing-library
|
|
245
|
+
|
|
246
|
+
## Documentation Insights
|
|
247
|
+
|
|
248
|
+
### Libraries Used
|
|
249
|
+
- **jose**: JWT library - uses `SignJWT` class
|
|
250
|
+
- **prisma**: ORM - uses `prisma.user.create()` pattern
|
|
251
|
+
|
|
252
|
+
## Research Findings
|
|
253
|
+
|
|
254
|
+
### Common Approaches
|
|
255
|
+
- Registration: validate → hash → create → issue token
|
|
256
|
+
- Use httpOnly cookies for tokens
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
**If `{save_mode}` = true:** Append synthesis to 01-analyze.md
|
|
260
|
+
|
|
261
|
+
### 5. Infer Acceptance Criteria
|
|
262
|
+
|
|
263
|
+
Based on task and context, infer success criteria:
|
|
264
|
+
|
|
265
|
+
```markdown
|
|
266
|
+
## Inferred Acceptance Criteria
|
|
267
|
+
|
|
268
|
+
Based on "{task_description}" and existing patterns:
|
|
269
|
+
|
|
270
|
+
- [ ] AC1: [specific measurable outcome]
|
|
271
|
+
- [ ] AC2: [specific measurable outcome]
|
|
272
|
+
- [ ] AC3: [specific measurable outcome]
|
|
273
|
+
|
|
274
|
+
_These will be refined in the planning step._
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
**If `{save_mode}` = true:** Update 00-context.md with acceptance criteria
|
|
278
|
+
|
|
279
|
+
### 6. Present Context Summary
|
|
280
|
+
|
|
281
|
+
**Always (regardless of auto_mode):**
|
|
282
|
+
|
|
283
|
+
Present summary and proceed directly to planning:
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
**Context Gathering Complete**
|
|
287
|
+
|
|
288
|
+
**Files analyzed:** {count}
|
|
289
|
+
**Patterns identified:** {count}
|
|
290
|
+
**Utilities found:** {count}
|
|
291
|
+
|
|
292
|
+
**Key findings:**
|
|
293
|
+
- {summary of relevant files}
|
|
294
|
+
- {patterns that will guide implementation}
|
|
295
|
+
|
|
296
|
+
→ Proceeding to planning phase...
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
<critical>
|
|
300
|
+
Do NOT ask for user confirmation here - always proceed directly to step-02-plan.
|
|
301
|
+
</critical>
|
|
302
|
+
|
|
303
|
+
### 7. Complete Save Output (if save_mode)
|
|
304
|
+
|
|
305
|
+
**If `{save_mode}` = true:**
|
|
306
|
+
|
|
307
|
+
Append summary to `{output_dir}/01-analyze.md` then:
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
bash {skill_dir}/scripts/update-progress.sh "{task_id}" "01" "analyze" "complete"
|
|
311
|
+
bash {skill_dir}/scripts/update-progress.sh "{task_id}" "02" "plan" "in_progress"
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## SUCCESS METRICS:
|
|
317
|
+
|
|
318
|
+
✅ Related files identified with paths and line numbers
|
|
319
|
+
✅ Existing patterns documented with specific examples
|
|
320
|
+
✅ Available utilities noted
|
|
321
|
+
✅ Dependencies listed
|
|
322
|
+
✅ Acceptance criteria inferred
|
|
323
|
+
✅ NO planning or implementation decisions made
|
|
324
|
+
✅ Output saved (if save_mode)
|
|
325
|
+
✅ Task complexity analyzed BEFORE launching agents
|
|
326
|
+
✅ Right NUMBER of agents launched (1-10 based on complexity)
|
|
327
|
+
✅ Right TYPE of agents chosen for the task
|
|
328
|
+
✅ All agents launched in PARALLEL (single message)
|
|
329
|
+
|
|
330
|
+
## FAILURE MODES:
|
|
331
|
+
|
|
332
|
+
❌ Starting to plan or design (that's step 2!)
|
|
333
|
+
❌ Suggesting implementations or approaches
|
|
334
|
+
❌ Missing obvious related files
|
|
335
|
+
❌ Not documenting patterns with file:line references
|
|
336
|
+
❌ Launching agents sequentially instead of parallel
|
|
337
|
+
❌ Using subagents when economy_mode is true
|
|
338
|
+
❌ **CRITICAL**: Blocking workflow with unnecessary confirmation prompts
|
|
339
|
+
❌ Launching too many agents for a simple task (wasteful)
|
|
340
|
+
❌ Launching too few agents for a complex task (insufficient context)
|
|
341
|
+
❌ Not analyzing task complexity before choosing agents
|
|
342
|
+
❌ Skipping `explore-docs` when genuinely unfamiliar with a library API
|
|
343
|
+
|
|
344
|
+
## ANALYZE PROTOCOLS:
|
|
345
|
+
|
|
346
|
+
- This step is ONLY about discovery
|
|
347
|
+
- Report what EXISTS, not what SHOULD BE
|
|
348
|
+
- Include file paths and line numbers for all findings
|
|
349
|
+
- Don't assume - verify by reading files
|
|
350
|
+
- In economy mode, use direct tools only
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
## NEXT STEP:
|
|
355
|
+
|
|
356
|
+
Always proceed directly to `./step-02-plan.md` after presenting context summary.
|
|
357
|
+
|
|
358
|
+
<critical>
|
|
359
|
+
Remember: Analysis is ONLY about "What exists?" - save all planning for step-02!
|
|
360
|
+
Do NOT ask for confirmation - proceed directly!
|
|
361
|
+
</critical>
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: step-02-plan
|
|
3
|
+
description: Strategic planning - create detailed file-by-file implementation strategy
|
|
4
|
+
prev_step: steps/step-01-analyze.md
|
|
5
|
+
next_step: steps/step-03-execute.md
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Step 2: Plan (Strategic Design)
|
|
9
|
+
|
|
10
|
+
## MANDATORY EXECUTION RULES (READ FIRST):
|
|
11
|
+
|
|
12
|
+
- 🛑 NEVER start implementing - that's step 3
|
|
13
|
+
- 🛑 NEVER write or modify code in this step
|
|
14
|
+
- ✅ ALWAYS structure plan by FILE, not by feature
|
|
15
|
+
- ✅ ALWAYS include specific line numbers from analysis
|
|
16
|
+
- ✅ ALWAYS map acceptance criteria to file changes
|
|
17
|
+
- 📋 YOU ARE A PLANNER, not an implementer
|
|
18
|
+
- 💬 FOCUS on "What changes need to be made where?"
|
|
19
|
+
- 🚫 FORBIDDEN to use Edit, Write, or Bash tools
|
|
20
|
+
|
|
21
|
+
## EXECUTION PROTOCOLS:
|
|
22
|
+
|
|
23
|
+
- 🎯 ULTRA THINK before creating the plan
|
|
24
|
+
- 💾 Save plan to output file (if save_mode)
|
|
25
|
+
- 📖 Reference patterns from step-01 analysis
|
|
26
|
+
- 🚫 FORBIDDEN to proceed until user approves plan (unless auto_mode)
|
|
27
|
+
|
|
28
|
+
## CONTEXT BOUNDARIES:
|
|
29
|
+
|
|
30
|
+
- Context from step-01 (files, patterns, utilities) is available
|
|
31
|
+
- Implementation has NOT started
|
|
32
|
+
- User has NOT approved any changes yet
|
|
33
|
+
- Plan must be complete before execution
|
|
34
|
+
|
|
35
|
+
## YOUR TASK:
|
|
36
|
+
|
|
37
|
+
Transform analysis findings into a comprehensive, executable, file-by-file implementation plan.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
<available_state>
|
|
42
|
+
From previous steps:
|
|
43
|
+
|
|
44
|
+
| Variable | Description |
|
|
45
|
+
|----------|-------------|
|
|
46
|
+
| `{task_description}` | What to implement |
|
|
47
|
+
| `{task_id}` | Kebab-case identifier |
|
|
48
|
+
| `{acceptance_criteria}` | Success criteria from step-01 |
|
|
49
|
+
| `{auto_mode}` | Skip confirmations |
|
|
50
|
+
| `{save_mode}` | Save outputs to files |
|
|
51
|
+
| `{output_dir}` | Path to output (if save_mode) |
|
|
52
|
+
| Files found | From step-01 codebase exploration |
|
|
53
|
+
| Patterns | From step-01 pattern analysis |
|
|
54
|
+
| Utilities | From step-01 utility discovery |
|
|
55
|
+
</available_state>
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## EXECUTION SEQUENCE:
|
|
60
|
+
|
|
61
|
+
### 1. Initialize Save Output (if save_mode)
|
|
62
|
+
|
|
63
|
+
**If `{save_mode}` = true:**
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
bash {skill_dir}/scripts/update-progress.sh "{task_id}" "02" "plan" "in_progress"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Append plan to `{output_dir}/02-plan.md` as you work.
|
|
70
|
+
|
|
71
|
+
### 2. ULTRA THINK: Design Complete Strategy
|
|
72
|
+
|
|
73
|
+
**CRITICAL: Think through ENTIRE implementation before writing any plan.**
|
|
74
|
+
|
|
75
|
+
Mental simulation:
|
|
76
|
+
- Walk through the implementation step by step
|
|
77
|
+
- Identify all files that need changes
|
|
78
|
+
- Determine logical order (dependencies first)
|
|
79
|
+
- Consider edge cases and error handling
|
|
80
|
+
- Plan test coverage
|
|
81
|
+
|
|
82
|
+
### 3. Clarify Ambiguities
|
|
83
|
+
|
|
84
|
+
**If `{auto_mode}` = true:**
|
|
85
|
+
→ Use recommended option for any ambiguity, proceed automatically
|
|
86
|
+
|
|
87
|
+
**If `{auto_mode}` = false AND multiple valid approaches exist:**
|
|
88
|
+
|
|
89
|
+
```yaml
|
|
90
|
+
questions:
|
|
91
|
+
- header: "Approach"
|
|
92
|
+
question: "Multiple approaches are possible. Which should we use?"
|
|
93
|
+
options:
|
|
94
|
+
- label: "Approach A (Recommended)"
|
|
95
|
+
description: "Description and tradeoffs of A"
|
|
96
|
+
- label: "Approach B"
|
|
97
|
+
description: "Description and tradeoffs of B"
|
|
98
|
+
- label: "Approach C"
|
|
99
|
+
description: "Description and tradeoffs of C"
|
|
100
|
+
multiSelect: false
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 4. Create Detailed Plan
|
|
104
|
+
|
|
105
|
+
**Structure by FILE, not by feature:**
|
|
106
|
+
|
|
107
|
+
```markdown
|
|
108
|
+
## Implementation Plan: {task_description}
|
|
109
|
+
|
|
110
|
+
### Overview
|
|
111
|
+
[1-2 sentences: High-level strategy and approach]
|
|
112
|
+
|
|
113
|
+
### Prerequisites
|
|
114
|
+
- [ ] Prerequisite 1 (if any)
|
|
115
|
+
- [ ] Prerequisite 2 (if any)
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
### File Changes
|
|
120
|
+
|
|
121
|
+
#### `src/path/file1.ts`
|
|
122
|
+
- Add `functionName` that handles X
|
|
123
|
+
- Extract logic from Y (follow pattern in `example.ts:45`)
|
|
124
|
+
- Handle error case: [specific scenario]
|
|
125
|
+
- Consider: [edge case or important context]
|
|
126
|
+
|
|
127
|
+
#### `src/path/file2.ts`
|
|
128
|
+
- Update imports to include new module
|
|
129
|
+
- Call `functionName` in existing flow at line ~42
|
|
130
|
+
- Update types: Add `NewType` interface
|
|
131
|
+
|
|
132
|
+
#### `src/path/file3.ts` (NEW FILE)
|
|
133
|
+
- Create utility for Z
|
|
134
|
+
- Export: `utilityFunction`, `HelperType`
|
|
135
|
+
- Pattern: Follow `similar-util.ts` structure
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
### Testing Strategy
|
|
140
|
+
|
|
141
|
+
**New tests:**
|
|
142
|
+
- `src/path/file1.test.ts` - Test functionName with:
|
|
143
|
+
- Happy path
|
|
144
|
+
- Error case
|
|
145
|
+
- Edge case
|
|
146
|
+
|
|
147
|
+
**Update existing:**
|
|
148
|
+
- `src/path/existing.test.ts` - Add test for new flow
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
### Acceptance Criteria Mapping
|
|
153
|
+
- [ ] AC1: Satisfied by changes in `file1.ts`
|
|
154
|
+
- [ ] AC2: Satisfied by changes in `file2.ts`
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
### Risks & Considerations
|
|
159
|
+
- Risk 1: [potential issue and mitigation]
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**If `{save_mode}` = true:** Append full plan to 02-plan.md
|
|
163
|
+
|
|
164
|
+
### 5. Verify Plan Completeness
|
|
165
|
+
|
|
166
|
+
Checklist:
|
|
167
|
+
- [ ] All files identified - nothing missing
|
|
168
|
+
- [ ] Logical order - dependencies handled first
|
|
169
|
+
- [ ] Clear actions - every step specific and actionable
|
|
170
|
+
- [ ] Test coverage - all paths have test strategy
|
|
171
|
+
- [ ] In scope - no scope creep
|
|
172
|
+
- [ ] AC mapped - every criterion has implementation
|
|
173
|
+
|
|
174
|
+
### 6. Present Plan for Approval
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
**Implementation Plan Ready**
|
|
178
|
+
|
|
179
|
+
**Overview:** [1 sentence summary]
|
|
180
|
+
|
|
181
|
+
**Files to modify:** {count} files
|
|
182
|
+
**New files:** {count} files
|
|
183
|
+
**Tests:** {count} test files
|
|
184
|
+
|
|
185
|
+
**Estimated changes:**
|
|
186
|
+
- `file1.ts` - Major changes (add function, handle errors)
|
|
187
|
+
- `file2.ts` - Minor changes (imports, single call)
|
|
188
|
+
- `file1.test.ts` - New test file
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**If `{auto_mode}` = true:**
|
|
192
|
+
→ Skip confirmation, proceed directly to execution
|
|
193
|
+
|
|
194
|
+
**If `{auto_mode}` = false:**
|
|
195
|
+
|
|
196
|
+
```yaml
|
|
197
|
+
questions:
|
|
198
|
+
- header: "Plan"
|
|
199
|
+
question: "Review the implementation plan. Ready to proceed?"
|
|
200
|
+
options:
|
|
201
|
+
- label: "Approve and execute (Recommended)"
|
|
202
|
+
description: "Plan looks good, start implementation"
|
|
203
|
+
- label: "Adjust plan"
|
|
204
|
+
description: "I want to modify specific parts"
|
|
205
|
+
- label: "Ask questions"
|
|
206
|
+
description: "I have questions about the plan"
|
|
207
|
+
- label: "Start over"
|
|
208
|
+
description: "Revise the entire plan"
|
|
209
|
+
multiSelect: false
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### 7. Complete Save Output (if save_mode)
|
|
213
|
+
|
|
214
|
+
**If `{save_mode}` = true:**
|
|
215
|
+
|
|
216
|
+
Append to `{output_dir}/02-plan.md`:
|
|
217
|
+
```markdown
|
|
218
|
+
---
|
|
219
|
+
## Step Complete
|
|
220
|
+
**Status:** ✓ Complete
|
|
221
|
+
**Files planned:** {count}
|
|
222
|
+
**Tests planned:** {count}
|
|
223
|
+
**Next:** step-03-execute.md
|
|
224
|
+
**Timestamp:** {ISO timestamp}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## SUCCESS METRICS:
|
|
230
|
+
|
|
231
|
+
✅ Complete file-by-file plan created
|
|
232
|
+
✅ Logical dependency order established
|
|
233
|
+
✅ All acceptance criteria mapped to changes
|
|
234
|
+
✅ Test strategy defined
|
|
235
|
+
✅ User approved plan (or auto-approved)
|
|
236
|
+
✅ NO code written or modified
|
|
237
|
+
✅ Output saved (if save_mode)
|
|
238
|
+
|
|
239
|
+
## FAILURE MODES:
|
|
240
|
+
|
|
241
|
+
❌ Organizing by feature instead of file
|
|
242
|
+
❌ Vague actions like "add feature" or "fix issue"
|
|
243
|
+
❌ Missing test strategy
|
|
244
|
+
❌ Not mapping to acceptance criteria
|
|
245
|
+
❌ Starting to write code (that's step 3!)
|
|
246
|
+
❌ **CRITICAL**: Not using AskUserQuestion for approval
|
|
247
|
+
|
|
248
|
+
## PLANNING PROTOCOLS:
|
|
249
|
+
|
|
250
|
+
- Structure by FILE - each file is a section
|
|
251
|
+
- Include line number references from analysis
|
|
252
|
+
- Every action must be specific and actionable
|
|
253
|
+
- Map every AC to specific file changes
|
|
254
|
+
- Plan tests alongside implementation
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## NEXT STEP:
|
|
259
|
+
|
|
260
|
+
After user approves via AskUserQuestion (or auto-proceed), load `./step-03-execute.md`
|
|
261
|
+
|
|
262
|
+
<critical>
|
|
263
|
+
Remember: Planning is ONLY about designing the approach - save all implementation for step-03!
|
|
264
|
+
</critical>
|