aiblueprint-cli 1.4.42 → 1.4.43

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 (24) hide show
  1. package/claude-code-config/skills/apex/SKILL.md +229 -84
  2. package/claude-code-config/skills/apex/scripts/setup-templates.sh +6 -50
  3. package/claude-code-config/skills/apex/steps/step-00-init.md +33 -39
  4. package/claude-code-config/skills/apex/steps/step-00b-interactive.md +1 -13
  5. package/claude-code-config/skills/apex/steps/step-01-analyze.md +17 -36
  6. package/claude-code-config/skills/apex/steps/step-02-plan.md +24 -353
  7. package/claude-code-config/skills/apex/steps/step-03-execute.md +0 -1
  8. package/claude-code-config/skills/apex/steps/step-04-validate.md +26 -41
  9. package/claude-code-config/skills/apex/templates/00-context.md +0 -10
  10. package/claude-code-config/skills/apex/templates/README.md +6 -25
  11. package/package.json +1 -1
  12. package/claude-code-config/skills/apex/steps/step-00b-save.md +0 -123
  13. package/claude-code-config/skills/apex/steps/step-02b-tasks.md +0 -301
  14. package/claude-code-config/skills/apex/steps/step-03-execute-teams.md +0 -296
  15. package/claude-code-config/skills/apex/steps/step-05-examine.md +0 -351
  16. package/claude-code-config/skills/apex/steps/step-06-resolve.md +0 -238
  17. package/claude-code-config/skills/apex/steps/step-07-tests.md +0 -250
  18. package/claude-code-config/skills/apex/steps/step-08-run-tests.md +0 -308
  19. package/claude-code-config/skills/apex/steps/step-09-finish.md +0 -223
  20. package/claude-code-config/skills/apex/templates/05-examine.md +0 -10
  21. package/claude-code-config/skills/apex/templates/06-resolve.md +0 -10
  22. package/claude-code-config/skills/apex/templates/07-tests.md +0 -10
  23. package/claude-code-config/skills/apex/templates/08-run-tests.md +0 -10
  24. package/claude-code-config/skills/apex/templates/09-finish.md +0 -10
@@ -11,14 +11,11 @@ next_step: steps/step-02-plan.md
11
11
  - 🛑 NEVER plan or design solutions - that's step 2
12
12
  - 🛑 NEVER create todos or implementation tasks
13
13
  - 🛑 NEVER decide HOW to implement anything
14
- - 🛑 NEVER mark analyze as "complete" BEFORE writing findings to `{output_dir}/01-analyze.md` (if save_mode)
15
14
  - ✅ ALWAYS focus on discovering WHAT EXISTS
16
15
  - ✅ ALWAYS report findings with file paths and line numbers
17
- - ✅ IF save_mode: ALWAYS use Edit tool to append ALL findings to `{output_dir}/01-analyze.md` BEFORE proceeding
18
16
  - 📋 YOU ARE AN EXPLORER, not a planner
19
17
  - 💬 FOCUS on "What is here?" NOT "What should we build?"
20
18
  - 🚫 FORBIDDEN to suggest implementations or approaches
21
- - 🚫 FORBIDDEN to skip file saving when save_mode is true
22
19
 
23
20
  ## 🧠 SMART AGENT STRATEGY
24
21
 
@@ -33,10 +30,9 @@ Before exploring, THINK about what information you need and launch the RIGHT age
33
30
  ## EXECUTION PROTOCOLS:
34
31
 
35
32
  - 🎯 Launch parallel exploration agents (unless economy_mode)
36
- - 💾 IF save_mode: Use Edit tool to append findings to `{output_dir}/01-analyze.md` AFTER agents complete and BEFORE showing summary
33
+ - 💾 Append findings to output file (if save_mode)
37
34
  - 📖 Document patterns with specific file:line references
38
35
  - 🚫 FORBIDDEN to proceed until context is complete
39
- - 🚫 FORBIDDEN to proceed to step-02 without saving findings first (if save_mode)
40
36
 
41
37
  ## CONTEXT BOUNDARIES:
42
38
 
@@ -218,14 +214,9 @@ Find common patterns and pitfalls.
218
214
  [Task: websearch - Stripe webhook security best practices]
219
215
  ```
220
216
 
221
- ### 4. Synthesize Findings + Save to File
217
+ ### 4. Synthesize Findings
222
218
 
223
- <critical>
224
- **IF `{save_mode}` = true: You MUST write findings to the file BEFORE presenting the summary or proceeding.**
225
- This is the most commonly skipped step. DO NOT skip it.
226
- </critical>
227
-
228
- Combine all agent results into structured context using this format:
219
+ Combine results into structured context:
229
220
 
230
221
  ```markdown
231
222
  ## Codebase Context
@@ -265,9 +256,7 @@ Combine all agent results into structured context using this format:
265
256
  - Use httpOnly cookies for tokens
266
257
  ```
267
258
 
268
- **IF `{save_mode}` = true (MANDATORY - DO THIS NOW):**
269
-
270
- Use the **Edit tool** to append the full synthesis to `{output_dir}/01-analyze.md`. Replace the placeholder text `_Findings will be appended here as exploration progresses..._` with all the structured findings above.
259
+ **If `{save_mode}` = true:** Append synthesis to 01-analyze.md
271
260
 
272
261
  ### 5. Infer Acceptance Criteria
273
262
 
@@ -285,26 +274,9 @@ Based on "{task_description}" and existing patterns:
285
274
  _These will be refined in the planning step._
286
275
  ```
287
276
 
288
- **If `{save_mode}` = true:** Append acceptance criteria to `{output_dir}/01-analyze.md` using Edit tool.
277
+ **If `{save_mode}` = true:** Update 00-context.md with acceptance criteria
289
278
 
290
- ### 6. Complete Save Output (if save_mode)
291
-
292
- <critical>
293
- **This step MUST happen BEFORE presenting the summary to the user.**
294
- The file must already contain all findings before you proceed.
295
- </critical>
296
-
297
- **If `{save_mode}` = true:**
298
-
299
- 1. Verify `{output_dir}/01-analyze.md` contains the full analysis (Read it to confirm)
300
- 2. Update progress:
301
-
302
- ```bash
303
- bash {skill_dir}/scripts/update-progress.sh "{task_id}" "01" "analyze" "complete"
304
- bash {skill_dir}/scripts/update-progress.sh "{task_id}" "02" "plan" "in_progress"
305
- ```
306
-
307
- ### 7. Present Context Summary
279
+ ### 6. Present Context Summary
308
280
 
309
281
  **Always (regardless of auto_mode):**
310
282
 
@@ -328,6 +300,17 @@ Present summary and proceed directly to planning:
328
300
  Do NOT ask for user confirmation here - always proceed directly to step-02-plan.
329
301
  </critical>
330
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
+
331
314
  ---
332
315
 
333
316
  ## SUCCESS METRICS:
@@ -346,7 +329,6 @@ Do NOT ask for user confirmation here - always proceed directly to step-02-plan.
346
329
 
347
330
  ## FAILURE MODES:
348
331
 
349
- ❌ **CRITICAL**: Skipping file save when save_mode is true (proceeding to plan without writing to 01-analyze.md)
350
332
  ❌ Starting to plan or design (that's step 2!)
351
333
  ❌ Suggesting implementations or approaches
352
334
  ❌ Missing obvious related files
@@ -376,5 +358,4 @@ Always proceed directly to `./step-02-plan.md` after presenting context summary.
376
358
  <critical>
377
359
  Remember: Analysis is ONLY about "What exists?" - save all planning for step-02!
378
360
  Do NOT ask for confirmation - proceed directly!
379
- IF save_mode = true: The 01-analyze.md file MUST contain all findings BEFORE you load step-02-plan.md.
380
361
  </critical>
@@ -11,23 +11,19 @@ next_step: steps/step-03-execute.md
11
11
 
12
12
  - 🛑 NEVER start implementing - that's step 3
13
13
  - 🛑 NEVER write or modify code in this step
14
- - 🛑 NEVER mark plan as "complete" BEFORE writing plan to `{output_dir}/02-plan.md` (if save_mode)
15
14
  - ✅ ALWAYS structure plan by FILE, not by feature
16
15
  - ✅ ALWAYS include specific line numbers from analysis
17
16
  - ✅ ALWAYS map acceptance criteria to file changes
18
- - ✅ ALWAYS create a TaskList using TaskCreate tool to track all planned file changes
19
- - ✅ IF save_mode: ALWAYS use Edit tool to write the full plan to `{output_dir}/02-plan.md` BEFORE showing summary
20
17
  - 📋 YOU ARE A PLANNER, not an implementer
21
18
  - 💬 FOCUS on "What changes need to be made where?"
22
- - 🚫 FORBIDDEN to use Edit/Write on source code files (only on output files if save_mode)
19
+ - 🚫 FORBIDDEN to use Edit, Write, or Bash tools
23
20
 
24
21
  ## EXECUTION PROTOCOLS:
25
22
 
26
23
  - 🎯 ULTRA THINK before creating the plan
27
- - 💾 IF save_mode: Use Edit tool to write the full plan to `{output_dir}/02-plan.md` AFTER creating the plan and BEFORE presenting summary
24
+ - 💾 Save plan to output file (if save_mode)
28
25
  - 📖 Reference patterns from step-01 analysis
29
26
  - 🚫 FORBIDDEN to proceed until user approves plan (unless auto_mode)
30
- - 🚫 FORBIDDEN to proceed to step-03 without saving plan first (if save_mode)
31
27
 
32
28
  ## CONTEXT BOUNDARIES:
33
29
 
@@ -163,64 +159,9 @@ questions:
163
159
  - Risk 1: [potential issue and mitigation]
164
160
  ```
165
161
 
166
- **IF `{save_mode}` = true (MANDATORY - DO THIS NOW):**
162
+ **If `{save_mode}` = true:** Append full plan to 02-plan.md
167
163
 
168
- <critical>
169
- Use the **Edit tool** to write the FULL plan to `{output_dir}/02-plan.md`. Replace the placeholder content with the complete plan including all file changes, testing strategy, acceptance criteria mapping, and risks.
170
- </critical>
171
-
172
- ### 5. Create Team (if teams_mode - BEFORE TaskList)
173
-
174
- <critical>
175
- If `{teams_mode}` = true, you MUST create the team BEFORE creating any tasks.
176
- TeamCreate resets the task list — so the team must exist first, then tasks are added to it.
177
- Do NOT spawn any agents yet — that happens in step-03-execute-teams.
178
- </critical>
179
-
180
- **If `{teams_mode}` = true:**
181
-
182
- ```
183
- TeamCreate:
184
- team_name: "apex-{feature_name}"
185
- description: "APEX: {task_description}"
186
- ```
187
-
188
- → This creates the team and its empty task list.
189
- → All subsequent TaskCreate calls will use this team's task list.
190
- → Agents are spawned later in step-03-execute-teams.
191
-
192
- ### 6. Create Task List (MANDATORY)
193
-
194
- <critical>
195
- You MUST create a TaskList using TaskCreate for every planned change.
196
- This is NOT optional - the task list tracks progress through execution.
197
- If teams_mode is enabled, the team was already created in step 5 — tasks go into the team's task list.
198
- </critical>
199
-
200
- **Create one task per file change from the plan:**
201
-
202
- For each file in the plan, call `TaskCreate` with:
203
- - **subject**: `{action} {filepath}` (e.g., "Add validateToken to src/auth/handler.ts")
204
- - **description**: The full details of what changes are needed for this file, including specific functions, patterns to follow, and line references
205
- - **activeForm**: Present continuous form (e.g., "Adding validateToken to handler.ts")
206
-
207
- **Then set up dependencies using `TaskUpdate`:**
208
- - If file B depends on file A (e.g., B imports from A), use `addBlockedBy` to mark the dependency
209
- - This ensures execution follows the correct order
210
-
211
- **Example:**
212
- ```
213
- TaskCreate: "Create auth types in src/types/auth.ts"
214
- → description: "Create AuthToken interface, ValidateResult type. Follow pattern from src/types/user.ts"
215
- → activeForm: "Creating auth types"
216
-
217
- TaskCreate: "Add validateToken to src/auth/handler.ts"
218
- → description: "Add validateToken function that returns ValidateResult. Handle expired token error case."
219
- → activeForm: "Adding validateToken to handler"
220
- → Then: TaskUpdate with addBlockedBy: [auth-types-task-id]
221
- ```
222
-
223
- ### 7. Verify Plan Completeness
164
+ ### 5. Verify Plan Completeness
224
165
 
225
166
  Checklist:
226
167
  - [ ] All files identified - nothing missing
@@ -229,139 +170,11 @@ Checklist:
229
170
  - [ ] Test coverage - all paths have test strategy
230
171
  - [ ] In scope - no scope creep
231
172
  - [ ] AC mapped - every criterion has implementation
232
- - [ ] **TaskList created with all file changes**
233
- - [ ] **Task dependencies set correctly**
234
-
235
- ### 8. Brainstorm Uncertainty Points
236
-
237
- <critical>
238
- Before proceeding, THINK about what you're NOT 100% certain about.
239
- DO NOT ask generic "is this plan good?" questions.
240
- Instead, identify SPECIFIC uncertainties and ask TARGETED questions.
241
- </critical>
242
-
243
- **ULTRA THINK: Identify Uncertainties**
244
-
245
- For each aspect of the plan, rate your confidence (High/Medium/Low):
246
-
247
- ```markdown
248
- ## Uncertainty Analysis
249
-
250
- | Aspect | Confidence | Uncertainty |
251
- |--------|------------|-------------|
252
- | File locations correct? | High/Medium/Low | [What's unclear] |
253
- | Patterns match codebase? | High/Medium/Low | [What's unclear] |
254
- | Dependencies complete? | High/Medium/Low | [What's unclear] |
255
- | Error handling approach? | High/Medium/Low | [What's unclear] |
256
- | User expectations for X? | High/Medium/Low | [What's unclear] |
257
- | Technical approach for Y? | High/Medium/Low | [What's unclear] |
258
- ```
259
-
260
- **Identify TOP 1-4 uncertainties with Low or Medium confidence.**
261
173
 
262
- These are the ONLY things worth asking about.
174
+ ### 6. Present Plan for Approval
263
175
 
264
- ---
265
-
266
- ### 9. Ask Smart Questions (if not auto_mode)
267
-
268
- **If `{auto_mode}` = true:**
269
- → Skip questions, use your best judgment, proceed directly
270
-
271
- **If `{auto_mode}` = false AND you have uncertainties:**
272
-
273
- <critical>
274
- ONLY ask questions about things where:
275
- 1. Multiple valid approaches exist AND the choice significantly impacts implementation
276
- 2. User intent is genuinely ambiguous from the task description
277
- 3. A wrong assumption could cause significant rework
278
-
279
- DO NOT ask about:
280
- - Implementation details you can decide yourself
281
- - Things you're "slightly unsure" about (just decide)
282
- - Generic plan approval (never ask "is this plan good?")
283
- </critical>
284
-
285
- **Question Types to Use:**
286
-
287
- **Type 1: Behavior Clarification**
288
- When user intent is genuinely unclear:
289
- ```yaml
290
- questions:
291
- - header: "Behavior"
292
- question: "When [specific scenario], should the system [option A] or [option B]?"
293
- options:
294
- - label: "[Option A] (Recommended)"
295
- description: "[What A does and why it might be preferred]"
296
- - label: "[Option B]"
297
- description: "[What B does and when it's better]"
298
- multiSelect: false
299
- ```
300
-
301
- **Type 2: Scope Clarification**
302
- When scope boundaries are unclear:
303
- ```yaml
304
- questions:
305
- - header: "Scope"
306
- question: "Should we also [related thing] as part of this, or keep it focused on [core thing]?"
307
- options:
308
- - label: "Keep focused (Recommended)"
309
- description: "Only do [core thing], faster implementation"
310
- - label: "Include [related thing]"
311
- description: "More complete but expands scope"
312
- multiSelect: false
313
- ```
314
-
315
- **Type 3: Technical Choice**
316
- When multiple valid technical approaches exist:
317
- ```yaml
318
- questions:
319
- - header: "Approach"
320
- question: "For [specific technical decision], we can use [approach A] or [approach B]. Which fits your needs?"
321
- options:
322
- - label: "[Approach A] (Recommended)"
323
- description: "[Tradeoffs of A - e.g., simpler but less flexible]"
324
- - label: "[Approach B]"
325
- description: "[Tradeoffs of B - e.g., more complex but extensible]"
326
- multiSelect: false
327
176
  ```
328
-
329
- **Type 4: Edge Case Handling**
330
- When edge case behavior is unclear:
331
- ```yaml
332
- questions:
333
- - header: "Edge case"
334
- question: "If [edge case scenario] occurs, should we [behavior A] or [behavior B]?"
335
- options:
336
- - label: "[Behavior A] (Recommended)"
337
- description: "[What happens with A]"
338
- - label: "[Behavior B]"
339
- description: "[What happens with B]"
340
- multiSelect: false
341
- ```
342
-
343
- **If you have 0 uncertainties worth asking about:**
344
- → Proceed directly to execution without asking anything
345
-
346
- **Example of GOOD questions:**
347
- - "When a user submits invalid email format, should we show inline validation or only validate on submit?"
348
- - "Should the loading state show a spinner on the button or a full-page skeleton?"
349
- - "For rate limiting, should we limit per user or per IP address?"
350
-
351
- **Example of BAD questions (NEVER ask these):**
352
- - ❌ "Does this plan look good to you?"
353
- - ❌ "Ready to proceed with implementation?"
354
- - ❌ "Should I use async/await or promises?" (just decide)
355
- - ❌ "Is the file structure correct?" (you already verified)
356
-
357
- ---
358
-
359
- ### 10. Present Plan Summary & Approve
360
-
361
- **Always show the full plan summary (both auto and non-auto):**
362
-
363
- ```
364
- **Implementation Plan Ready: {task_description}**
177
+ **Implementation Plan Ready**
365
178
 
366
179
  **Overview:** [1 sentence summary]
367
180
 
@@ -369,146 +182,34 @@ questions:
369
182
  **New files:** {count} files
370
183
  **Tests:** {count} test files
371
184
 
372
- **Key decisions made:**
373
- - [Decision 1 from user responses or auto-decided]
374
- - [Decision 2 from user responses or auto-decided]
375
-
376
185
  **Estimated changes:**
377
186
  - `file1.ts` - Major changes (add function, handle errors)
378
187
  - `file2.ts` - Minor changes (imports, single call)
379
188
  - `file1.test.ts` - New test file
380
-
381
- **Acceptance Criteria Coverage:**
382
- - [ ] AC1: Satisfied by changes in `file1.ts`
383
- - [ ] AC2: Satisfied by changes in `file2.ts`
384
-
385
- **Risks & Considerations:**
386
- - [Risk 1 and mitigation]
387
189
  ```
388
190
 
389
- ---
390
-
391
191
  **If `{auto_mode}` = true:**
392
- Show the full summary above, then proceed directly to next step
192
+ Skip confirmation, proceed directly to execution
393
193
 
394
194
  **If `{auto_mode}` = false:**
395
195
 
396
- <critical>
397
- Use EnterPlanMode / ExitPlanMode for plan approval — NOT AskUserQuestion.
398
- This gives the user proper plan review UI and supports "Execute and clear context".
399
- </critical>
400
-
401
- **Step 10a: Call `EnterPlanMode`**
402
-
403
- This transitions into plan mode so the user can review and approve.
404
-
405
- **Step 10b: Write the plan to the plan file**
406
-
407
- The system will provide a plan file path. Write the FULL plan to it, including APEX state for context survival.
408
-
409
- <critical>
410
- The plan file must contain ALL details from step 4 — do NOT strip sections.
411
- Include everything: Overview, Prerequisites, File Changes, Testing Strategy, Acceptance Criteria Mapping, Risks & Considerations, Key Decisions.
412
- </critical>
413
-
414
- ```markdown
415
- # APEX Implementation Plan: {task_description}
416
-
417
- ## APEX Workflow Context
418
-
419
- > **IMPORTANT:** This is an APEX workflow plan. If you are reading this after
420
- > "Execute and clear context", continue the APEX workflow by loading the next
421
- > step file listed below.
422
-
423
- ### State Variables
424
- | Variable | Value |
425
- |----------|-------|
426
- | task_description | {task_description} |
427
- | task_id | {task_id} |
428
- | feature_name | {feature_name} |
429
- | auto_mode | {auto_mode} |
430
- | examine_mode | {examine_mode} |
431
- | save_mode | {save_mode} |
432
- | test_mode | {test_mode} |
433
- | economy_mode | {economy_mode} |
434
- | branch_mode | {branch_mode} |
435
- | pr_mode | {pr_mode} |
436
- | tasks_mode | {tasks_mode} |
437
- | teams_mode | {teams_mode} |
438
- | output_dir | {output_dir} |
439
- | branch_name | {branch_name} |
440
-
441
- ### Next Step After Approval
442
- {if tasks_mode or teams_mode:}
443
- Load `skills/workflow-apex/steps/step-02b-tasks.md`
444
- {else:}
445
- Load `skills/workflow-apex/steps/step-03-execute.md`
446
-
447
- ---
448
-
449
- ## Plan Overview
450
- [1-2 sentence high-level strategy and approach]
451
-
452
- ## Prerequisites
453
- - [ ] Prerequisite 1 (if any)
454
- - [ ] Prerequisite 2 (if any)
455
-
456
- ## File Changes
457
-
458
- [Full file-by-file plan from step 4 — every file with specific actions, line references, patterns to follow, edge cases]
459
-
460
- ## Testing Strategy
461
-
462
- **New tests:**
463
- - [test files to create with coverage details]
464
-
465
- **Update existing:**
466
- - [existing test files to modify]
467
-
468
- ## Acceptance Criteria Mapping
469
- - [ ] AC1: Satisfied by changes in `file1.ts`
470
- - [ ] AC2: Satisfied by changes in `file2.ts`
471
-
472
- ## Key Decisions
473
- - [Decision 1 from user responses or auto-decided]
474
- - [Decision 2 from user responses or auto-decided]
475
-
476
- ## Risks & Considerations
477
- - [Risk 1: potential issue and mitigation]
478
- - [Risk 2: potential issue and mitigation]
479
- ```
480
-
481
- **Step 10c: Call `ExitPlanMode`**
482
-
483
- Include appropriate allowedPrompts for execution:
484
-
485
196
  ```yaml
486
- allowedPrompts:
487
- - tool: Bash
488
- prompt: "run build, typecheck, lint, test, and format commands"
489
- - tool: Bash
490
- prompt: "run git operations for branch management and commits"
491
- - tool: Bash
492
- prompt: "run APEX workflow scripts for progress tracking"
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
493
210
  ```
494
211
 
495
- **Step 10d: Handle "Execute and clear context"**
496
-
497
- If the user chooses "Execute and clear context":
498
- - Context is cleared but the plan file survives
499
- - The agent re-reads the plan file on the next turn
500
- - The APEX Workflow Context section in the plan file tells the agent:
501
- 1. This is an APEX workflow — restore all state variables from the table
502
- 2. Load the next step file indicated in "Next Step After Approval"
503
- 3. Continue the workflow as normal
504
-
505
- <critical>
506
- The plan file MUST contain ALL state variables, the next step path, AND the full detailed plan.
507
- Without this, "Execute and clear context" breaks the APEX workflow.
508
- Never strip sections from the plan file — it must be the complete implementation reference.
509
- </critical>
510
-
511
- ### 11. Complete Save Output (if save_mode)
212
+ ### 7. Complete Save Output (if save_mode)
512
213
 
513
214
  **If `{save_mode}` = true:**
514
215
 
@@ -519,7 +220,6 @@ Append to `{output_dir}/02-plan.md`:
519
220
  **Status:** ✓ Complete
520
221
  **Files planned:** {count}
521
222
  **Tests planned:** {count}
522
- **Uncertainties resolved:** {count}
523
223
  **Next:** step-03-execute.md
524
224
  **Timestamp:** {ISO timestamp}
525
225
  ```
@@ -532,30 +232,18 @@ Append to `{output_dir}/02-plan.md`:
532
232
  ✅ Logical dependency order established
533
233
  ✅ All acceptance criteria mapped to changes
534
234
  ✅ Test strategy defined
535
- **Team created with TeamCreate BEFORE TaskList (if teams_mode)**
536
- ✅ **TaskList created with TaskCreate for every file change**
537
- ✅ **Task dependencies set with TaskUpdate (addBlockedBy)**
538
- ✅ Uncertainty points identified and addressed
539
- ✅ Smart, targeted questions asked (if not auto_mode and uncertainties exist)
540
- ✅ **Plan approved via EnterPlanMode/ExitPlanMode (if not auto_mode)**
541
- ✅ **Plan file contains APEX state variables for "Execute and clear context" survival**
235
+ User approved plan (or auto-approved)
542
236
  ✅ NO code written or modified
543
237
  ✅ Output saved (if save_mode)
544
238
 
545
239
  ## FAILURE MODES:
546
240
 
547
- ❌ **CRITICAL**: Skipping file save when save_mode is true (proceeding without writing to 02-plan.md)
548
241
  ❌ Organizing by feature instead of file
549
242
  ❌ Vague actions like "add feature" or "fix issue"
550
243
  ❌ Missing test strategy
551
244
  ❌ Not mapping to acceptance criteria
552
245
  ❌ Starting to write code (that's step 3!)
553
- ❌ **CRITICAL**: Not creating a TaskList with TaskCreate
554
- ❌ **CRITICAL**: Asking generic "is this plan good?" questions
555
- ❌ **CRITICAL**: Asking about implementation details you can decide yourself
556
- ❌ **CRITICAL**: Not brainstorming uncertainties before asking questions
557
- ❌ **CRITICAL**: Using AskUserQuestion for plan approval instead of EnterPlanMode/ExitPlanMode (when auto_mode=false)
558
- ❌ **CRITICAL**: Plan file missing APEX state variables (breaks "Execute and clear context")
246
+ ❌ **CRITICAL**: Not using AskUserQuestion for approval
559
247
 
560
248
  ## PLANNING PROTOCOLS:
561
249
 
@@ -569,25 +257,8 @@ Append to `{output_dir}/02-plan.md`:
569
257
 
570
258
  ## NEXT STEP:
571
259
 
572
- **If `{auto_mode}` = true:** Proceed directly after plan summary.
573
- **If `{auto_mode}` = false:** Proceed after user approves via ExitPlanMode.
574
-
575
- **If "Execute and clear context" was chosen:**
576
- → The agent re-reads the plan file, restores APEX state variables from the table, and loads the next step indicated in the plan file.
577
-
578
- **Routing:**
579
-
580
- **If `{tasks_mode}` = true OR `{teams_mode}` = true:**
581
- → Load `./step-02b-tasks.md` to generate task breakdown with dependencies
582
-
583
- **If `{teams_mode}` = true (after task breakdown):**
584
- → Flow continues to `./step-03-execute-teams.md` for Agent Team parallel execution
585
-
586
- **Otherwise:**
587
- → Load `./step-03-execute.md` to start implementation
260
+ After user approves via AskUserQuestion (or auto-proceed), load `./step-03-execute.md`
588
261
 
589
262
  <critical>
590
263
  Remember: Planning is ONLY about designing the approach - save all implementation for step-03!
591
- When auto_mode=false, ALWAYS use EnterPlanMode/ExitPlanMode for approval — never AskUserQuestion.
592
- The plan file MUST contain APEX state variables so "Execute and clear context" works.
593
264
  </critical>
@@ -32,7 +32,6 @@ next_step: steps/step-04-validate.md
32
32
  - Files to modify are known from the plan
33
33
  - Patterns to follow are documented from step-01
34
34
  - Don't add features - stick to the plan
35
- - **If context was cleared ("Execute and clear context"):** The plan file contains all APEX state variables in the "APEX Workflow Context" section. Read the plan file first and restore all variables before proceeding.
36
35
 
37
36
  ## YOUR TASK:
38
37