aiblueprint-cli 1.4.40 → 1.4.42

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.
Files changed (82) hide show
  1. package/claude-code-config/skills/apex/SKILL.md +116 -0
  2. package/claude-code-config/skills/{workflow-apex → apex}/scripts/setup-templates.sh +12 -2
  3. package/claude-code-config/skills/{workflow-apex → apex}/steps/step-00-init.md +19 -34
  4. package/claude-code-config/skills/{workflow-apex → apex}/steps/step-00b-interactive.md +13 -1
  5. package/claude-code-config/skills/apex/steps/step-00b-save.md +123 -0
  6. package/claude-code-config/skills/{workflow-apex → apex}/steps/step-01-analyze.md +36 -17
  7. package/claude-code-config/skills/apex/steps/step-02-plan.md +593 -0
  8. package/claude-code-config/skills/apex/steps/step-02b-tasks.md +301 -0
  9. package/claude-code-config/skills/apex/steps/step-03-execute-teams.md +296 -0
  10. package/claude-code-config/skills/{workflow-apex → apex}/steps/step-03-execute.md +1 -0
  11. package/claude-code-config/skills/{workflow-apex → apex}/steps/step-04-validate.md +3 -1
  12. package/claude-code-config/skills/{workflow-apex → apex}/steps/step-05-examine.md +92 -35
  13. package/claude-code-config/skills/{workflow-apex → apex}/steps/step-06-resolve.md +1 -0
  14. package/claude-code-config/skills/{workflow-apex → apex}/steps/step-09-finish.md +32 -2
  15. package/claude-code-config/skills/{workflow-apex → apex}/templates/00-context.md +2 -0
  16. package/claude-code-config/skills/{meta-claude-memory → claude-memory}/SKILL.md +59 -1
  17. package/dist/cli.js +84 -37
  18. package/package.json +1 -1
  19. package/claude-code-config/skills/workflow-apex/SKILL.md +0 -303
  20. package/claude-code-config/skills/workflow-apex/steps/step-02-plan.md +0 -264
  21. /package/claude-code-config/skills/{workflow-apex → apex}/scripts/update-progress.sh +0 -0
  22. /package/claude-code-config/skills/{workflow-apex → apex}/steps/step-00b-branch.md +0 -0
  23. /package/claude-code-config/skills/{workflow-apex → apex}/steps/step-00b-economy.md +0 -0
  24. /package/claude-code-config/skills/{workflow-apex → apex}/steps/step-07-tests.md +0 -0
  25. /package/claude-code-config/skills/{workflow-apex → apex}/steps/step-08-run-tests.md +0 -0
  26. /package/claude-code-config/skills/{workflow-apex → apex}/templates/01-analyze.md +0 -0
  27. /package/claude-code-config/skills/{workflow-apex → apex}/templates/02-plan.md +0 -0
  28. /package/claude-code-config/skills/{workflow-apex → apex}/templates/03-execute.md +0 -0
  29. /package/claude-code-config/skills/{workflow-apex → apex}/templates/04-validate.md +0 -0
  30. /package/claude-code-config/skills/{workflow-apex → apex}/templates/05-examine.md +0 -0
  31. /package/claude-code-config/skills/{workflow-apex → apex}/templates/06-resolve.md +0 -0
  32. /package/claude-code-config/skills/{workflow-apex → apex}/templates/07-tests.md +0 -0
  33. /package/claude-code-config/skills/{workflow-apex → apex}/templates/08-run-tests.md +0 -0
  34. /package/claude-code-config/skills/{workflow-apex → apex}/templates/09-finish.md +0 -0
  35. /package/claude-code-config/skills/{workflow-apex → apex}/templates/README.md +0 -0
  36. /package/claude-code-config/skills/{workflow-apex → apex}/templates/step-complete.md +0 -0
  37. /package/claude-code-config/skills/{meta-claude-memory → claude-memory}/references/comprehensive-example.md +0 -0
  38. /package/claude-code-config/skills/{meta-claude-memory → claude-memory}/references/optimize-guide.md +0 -0
  39. /package/claude-code-config/skills/{meta-claude-memory → claude-memory}/references/project-patterns.md +0 -0
  40. /package/claude-code-config/skills/{meta-claude-memory → claude-memory}/references/prompting-techniques.md +0 -0
  41. /package/claude-code-config/skills/{meta-claude-memory → claude-memory}/references/rules-directory-guide.md +0 -0
  42. /package/claude-code-config/skills/{meta-claude-memory → claude-memory}/references/section-templates.md +0 -0
  43. /package/claude-code-config/skills/{git-commit → commit}/SKILL.md +0 -0
  44. /package/claude-code-config/skills/{git-create-pr → create-pr}/SKILL.md +0 -0
  45. /package/claude-code-config/skills/{utils-fix-errors → fix-errors}/SKILL.md +0 -0
  46. /package/claude-code-config/skills/{utils-fix-grammar → fix-grammar}/SKILL.md +0 -0
  47. /package/claude-code-config/skills/{git-fix-pr-comments → fix-pr-comments}/SKILL.md +0 -0
  48. /package/claude-code-config/skills/{git-merge → merge}/SKILL.md +0 -0
  49. /package/claude-code-config/skills/{utils-oneshot → oneshot}/SKILL.md +0 -0
  50. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/SKILL.md +0 -0
  51. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/anthropic-best-practices.md +0 -0
  52. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/anti-patterns.md +0 -0
  53. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/clarity-principles.md +0 -0
  54. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/context-management.md +0 -0
  55. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/few-shot-patterns.md +0 -0
  56. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/openai-best-practices.md +0 -0
  57. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/prompt-templates.md +0 -0
  58. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/reasoning-techniques.md +0 -0
  59. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/system-prompt-patterns.md +0 -0
  60. /package/claude-code-config/skills/{meta-prompt-creator → prompt-creator}/references/xml-structure.md +0 -0
  61. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/LICENSE.txt +0 -0
  62. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/SKILL.md +0 -0
  63. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/package.json +0 -0
  64. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/output-patterns.md +0 -0
  65. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/progressive-disclosure-patterns.md +0 -0
  66. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/prompting-integration.md +0 -0
  67. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/real-world-examples.md +0 -0
  68. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/script-patterns.md +0 -0
  69. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/workflows.md +0 -0
  70. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/references/xml-tag-guide.md +0 -0
  71. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/scripts/init-skill.ts +0 -0
  72. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/scripts/package-skill.ts +0 -0
  73. /package/claude-code-config/skills/{meta-skill-creator → skill-creator}/scripts/validate.ts +0 -0
  74. /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/SKILL.md +0 -0
  75. /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/context-management.md +0 -0
  76. /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/debugging-agents.md +0 -0
  77. /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/error-handling-and-recovery.md +0 -0
  78. /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/evaluation-and-testing.md +0 -0
  79. /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/orchestration-patterns.md +0 -0
  80. /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/subagents.md +0 -0
  81. /package/claude-code-config/skills/{meta-subagent-creator → subagent-creator}/references/writing-subagent-prompts.md +0 -0
  82. /package/claude-code-config/skills/{utils-ultrathink → ultrathink}/SKILL.md +0 -0
@@ -1,303 +0,0 @@
1
- ---
2
- name: apex
3
- description: Systematic implementation using APEX methodology (Analyze-Plan-Execute-eXamine) with parallel agents, self-validation, and optional adversarial review. Use when implementing features, fixing bugs, or making code changes that benefit from structured workflow.
4
- argument-hint: "[-a] [-x] [-s] [-t] [-b] [-pr] [-i] [-r <task-id>] <task description>"
5
- ---
6
-
7
- <objective>
8
- Execute systematic implementation workflows using the APEX methodology. This skill uses progressive step loading to minimize context usage and supports saving outputs for review and resumption.
9
- </objective>
10
-
11
- <quick_start>
12
- **Basic usage:**
13
-
14
- ```bash
15
- /apex add authentication middleware
16
- ```
17
-
18
- **Recommended workflow (autonomous with save):**
19
-
20
- ```bash
21
- /apex -a -s implement user registration
22
- ```
23
-
24
- **With adversarial review:**
25
-
26
- ```bash
27
- /apex -a -x -s fix login bug
28
- ```
29
-
30
- **Flags:**
31
-
32
- - `-a` (auto): Skip confirmations
33
- - `-s` (save): Save outputs to `.claude/output/apex/`
34
- - `-x` (examine): Include adversarial code review
35
- - `-t` (test): Create and run tests
36
- - `-pr` (pull-request): Create PR at end
37
-
38
- See `<parameters>` for complete flag list.
39
- </quick_start>
40
-
41
- <parameters>
42
-
43
- <flags>
44
- **Enable flags (turn ON):**
45
- | Short | Long | Description |
46
- |-------|------|-------------|
47
- | `-a` | `--auto` | Autonomous mode: skip confirmations, auto-approve plans |
48
- | `-x` | `--examine` | Auto-examine mode: proceed to adversarial review |
49
- | `-s` | `--save` | Save mode: output each step to `.claude/output/apex/` |
50
- | `-t` | `--test` | Test mode: include test creation and runner steps |
51
- | `-e` | `--economy` | Economy mode: no subagents, save tokens (for limited plans) |
52
- | `-r` | `--resume` | Resume mode: continue from a previous task |
53
- | `-b` | `--branch` | Branch mode: verify not on main, create branch if needed |
54
- | `-pr` | `--pull-request` | PR mode: create pull request at end (enables -b) |
55
- | `-i` | `--interactive` | Interactive mode: configure flags via AskUserQuestion |
56
-
57
- **Disable flags (turn OFF):**
58
- | Short | Long | Description |
59
- |-------|------|-------------|
60
- | `-A` | `--no-auto` | Disable auto mode |
61
- | `-X` | `--no-examine` | Disable examine mode |
62
- | `-S` | `--no-save` | Disable save mode |
63
- | `-T` | `--no-test` | Disable test mode |
64
- | `-E` | `--no-economy` | Disable economy mode |
65
- | `-B` | `--no-branch` | Disable branch mode |
66
- | `-PR` | `--no-pull-request` | Disable PR mode |
67
- </flags>
68
-
69
- <examples>
70
- ```bash
71
- # Basic
72
- /apex add auth middleware
73
-
74
- # Autonomous (skip confirmations)
75
- /apex -a add auth middleware
76
-
77
- # Save outputs + examine
78
- /apex -a -x -s add auth middleware
79
-
80
- # Full workflow with tests
81
- /apex -a -x -s -t add auth middleware
82
-
83
- # With PR creation
84
- /apex -a -pr add auth middleware
85
-
86
- # Resume previous task
87
- /apex -r 01-auth-middleware
88
- /apex -r 01 # Partial match
89
-
90
- # Economy mode (save tokens)
91
- /apex -e add auth middleware
92
-
93
- # Interactive flag config
94
- /apex -i add auth middleware
95
-
96
- # Disable flags (uppercase)
97
- /apex -A add auth middleware # Disable auto
98
- ```
99
- </examples>
100
-
101
- <parsing_rules>
102
- **Flag parsing:**
103
-
104
- 1. Defaults loaded from `steps/step-00-init.md` `<defaults>` section
105
- 2. Command-line flags override defaults (enable with lowercase `-x`, disable with uppercase `-X`)
106
- 3. Flags removed from input, remainder becomes `{task_description}`
107
- 4. Task ID generated as `NN-kebab-case-description`
108
-
109
- For detailed parsing algorithm, see `steps/step-00-init.md`.
110
- </parsing_rules>
111
-
112
- </parameters>
113
-
114
- <output_structure>
115
- **When `{save_mode}` = true:**
116
-
117
- All outputs saved to PROJECT directory (where Claude Code is running):
118
- ```
119
-
120
- .claude/output/apex/{task-id}/
121
- ├── 00-context.md # Params, user request, timestamp
122
- ├── 01-analyze.md # Analysis findings
123
- ├── 02-plan.md # Implementation plan
124
- ├── 03-execute.md # Execution log
125
- ├── 04-validate.md # Validation results
126
- ├── 05-examine.md # Review findings (if -x)
127
- ├── 06-resolve.md # Resolution log (if -x)
128
- ├── 07-tests.md # Test analysis and creation (if --test)
129
- ├── 08-run-tests.md # Test runner log (if --test)
130
- └── 09-finish.md # Workflow finish and PR creation (if --pull-request)
131
-
132
- ````
133
-
134
- **00-context.md structure:**
135
- ```markdown
136
- # APEX Task: {task_id}
137
-
138
- **Created:** {timestamp}
139
- **Task:** {task_description}
140
-
141
- ## Flags
142
- - Auto mode: {auto_mode}
143
- - Examine mode: {examine_mode}
144
- - Save mode: {save_mode}
145
- - Test mode: {test_mode}
146
-
147
- ## User Request
148
- {original user input}
149
-
150
- ## Acceptance Criteria
151
- - [ ] AC1: {inferred criterion}
152
- - [ ] AC2: {inferred criterion}
153
- ````
154
-
155
- </output_structure>
156
-
157
- <resume_workflow>
158
- **Resume mode (`-r {task-id}`):**
159
-
160
- When provided, step-00 will:
161
-
162
- 1. Locate the task folder in `.claude/output/apex/`
163
- 2. Restore state from `00-context.md`
164
- 3. Find the last completed step
165
- 4. Continue from the next step
166
-
167
- Supports partial matching (e.g., `-r 01` finds `01-add-auth-middleware`).
168
-
169
- For implementation details, see `steps/step-00-init.md`.
170
- </resume_workflow>
171
-
172
- <workflow>
173
- **Standard flow:**
174
- 1. Parse flags and task description
175
- 2. If `-r`: Execute resume workflow
176
- 3. If `-s`: Create output folder and 00-context.md
177
- 4. Load step-01-analyze.md → gather context
178
- 5. Load step-02-plan.md → create strategy
179
- 6. Load step-03-execute.md → implement
180
- 7. Load step-04-validate.md → verify
181
- 8. If `--test`: Load step-07-tests.md → analyze and create tests
182
- 9. If `--test`: Load step-08-run-tests.md → run until green
183
- 10. If `-x` or user requests: Load step-05-examine.md → adversarial review
184
- 11. If findings: Load step-06-resolve.md → fix findings
185
- 12. If `-pr`: Load step-09-finish.md → create pull request
186
- </workflow>
187
-
188
- <state_variables>
189
- **Persist throughout all steps:**
190
-
191
- | Variable | Type | Description |
192
- | ----------------------- | ------- | ------------------------------------------------------ |
193
- | `{task_description}` | string | What to implement (flags removed) |
194
- | `{feature_name}` | string | Kebab-case name without number (e.g., `add-auth-middleware`) |
195
- | `{task_id}` | string | Full identifier with number (e.g., `01-add-auth-middleware`) |
196
- | `{acceptance_criteria}` | list | Success criteria (inferred or explicit) |
197
- | `{auto_mode}` | boolean | Skip confirmations, use recommended options |
198
- | `{examine_mode}` | boolean | Auto-proceed to adversarial review |
199
- | `{save_mode}` | boolean | Save outputs to .claude/output/apex/ |
200
- | `{test_mode}` | boolean | Include test steps (07-08) |
201
- | `{economy_mode}` | boolean | No subagents, direct tool usage only |
202
- | `{branch_mode}` | boolean | Verify not on main, create branch if needed |
203
- | `{pr_mode}` | boolean | Create pull request at end |
204
- | `{interactive_mode}` | boolean | Configure flags interactively |
205
- | `{resume_task}` | string | Task ID to resume (if -r provided) |
206
- | `{output_dir}` | string | Full path to output directory |
207
- | `{branch_name}` | string | Created branch name (if branch_mode) |
208
-
209
- </state_variables>
210
-
211
- <entry_point>
212
-
213
- **FIRST ACTION:** Load `steps/step-00-init.md`
214
-
215
- Step 00 handles:
216
-
217
- - Flag parsing (-a, -x, -s, -r, --test)
218
- - Resume mode detection and task lookup
219
- - Output folder creation (if save_mode)
220
- - 00-context.md creation (if save_mode)
221
- - State variable initialization
222
-
223
- After initialization, step-00 loads step-01-analyze.md.
224
-
225
- </entry_point>
226
-
227
- <step_files>
228
- **Progressive loading - only load current step:**
229
-
230
- | Step | File | Purpose |
231
- | ---- | ---------------------------- | ---------------------------------------------------- |
232
- | 00 | `steps/step-00-init.md` | Parse flags, create output folder, initialize state |
233
- | 01 | `steps/step-01-analyze.md` | Smart context gathering with 1-10 parallel agents based on complexity |
234
- | 02 | `steps/step-02-plan.md` | File-by-file implementation strategy |
235
- | 03 | `steps/step-03-execute.md` | Todo-driven implementation |
236
- | 04 | `steps/step-04-validate.md` | Self-check and validation |
237
- | 05 | `steps/step-05-examine.md` | Adversarial code review (optional) |
238
- | 06 | `steps/step-06-resolve.md` | Finding resolution (optional) |
239
- | 07 | `steps/step-07-tests.md` | Test analysis and creation (if --test) |
240
- | 08 | `steps/step-08-run-tests.md` | Test runner loop until green (if --test) |
241
- | 09 | `steps/step-09-finish.md` | Create pull request (if --pull-request) |
242
-
243
- </step_files>
244
-
245
- <execution_rules>
246
-
247
- - **Load one step at a time** - Only load the current step file
248
- - **ULTRA THINK** before major decisions
249
- - **Persist state variables** across all steps
250
- - **Follow next_step directive** at end of each step
251
- - **Save outputs** if `{save_mode}` = true (append to step file)
252
- - **Use parallel agents** for independent exploration tasks
253
-
254
- ## 🧠 Smart Agent Strategy in Analyze Phase
255
-
256
- The analyze phase (step-01) uses **adaptive agent launching** (unless economy_mode):
257
-
258
- **Available agents:**
259
- - `explore-codebase` - Find existing patterns, files, utilities
260
- - `explore-docs` - Research library docs (use when unfamiliar with API)
261
- - `websearch` - Find approaches, best practices, gotchas
262
-
263
- **Launch 1-10 agents based on task complexity:**
264
-
265
- | Complexity | Agents | When |
266
- |------------|--------|------|
267
- | Simple | 1-2 | Bug fix, small tweak |
268
- | Medium | 2-4 | New feature in familiar stack |
269
- | Complex | 4-7 | Unfamiliar libraries, integrations |
270
- | Major | 6-10 | Multiple systems, many unknowns |
271
-
272
- **BE SMART:** Analyze what you actually need before launching. Don't over-launch for simple tasks, don't under-launch for complex ones.
273
-
274
- </execution_rules>
275
-
276
- <save_output_pattern>
277
- **When `{save_mode}` = true:**
278
-
279
- Step-00 runs `scripts/setup-templates.sh` to initialize all output files from `templates/` directory.
280
-
281
- **Each step then:**
282
-
283
- 1. Run `scripts/update-progress.sh {task_id} {step_num} {step_name} "in_progress"`
284
- 2. Append findings/outputs to the pre-created step file
285
- 3. Run `scripts/update-progress.sh {task_id} {step_num} {step_name} "complete"`
286
-
287
- **Template system benefits:**
288
-
289
- - Reduces token usage by ~75% (1,350 tokens saved per workflow)
290
- - Templates in `templates/` directory (not inline in steps)
291
- - Scripts handle progress tracking automatically
292
- - See `templates/README.md` for details
293
-
294
- </save_output_pattern>
295
-
296
- <success_criteria>
297
-
298
- - Each step loaded progressively
299
- - All validation checks passing
300
- - Outputs saved if `{save_mode}` enabled
301
- - Tests passing if `{test_mode}` enabled
302
- - Clear completion summary provided
303
- </success_criteria>
@@ -1,264 +0,0 @@
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>