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
@@ -0,0 +1,116 @@
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] [-m] [-r <task-id>] <task description>"
5
+ ---
6
+
7
+ <objective>
8
+ Execute systematic implementation workflows using the APEX methodology with progressive step loading.
9
+ </objective>
10
+
11
+ <quick_start>
12
+
13
+ ```bash
14
+ /apex add authentication middleware # Basic
15
+ /apex -a -s implement user registration # Autonomous + save
16
+ /apex -a -x -s fix login bug # With adversarial review
17
+ /apex -a -m implement full auth system # Agent Teams (parallel)
18
+ /apex -a -x -s -t add auth middleware # Full workflow with tests
19
+ /apex -a -pr add auth middleware # With PR creation
20
+ /apex -r 01-auth-middleware # Resume previous task
21
+ /apex -e add auth middleware # Economy mode (save tokens)
22
+ /apex -i add auth middleware # Interactive flag config
23
+ ```
24
+
25
+ </quick_start>
26
+
27
+ <flags>
28
+ **Enable (lowercase ON) / Disable (UPPERCASE OFF):**
29
+
30
+ | ON | OFF | Long | Description |
31
+ |----|-----|------|-------------|
32
+ | `-a` | `-A` | `--auto` | Skip confirmations, auto-approve |
33
+ | `-x` | `-X` | `--examine` | Adversarial code review |
34
+ | `-s` | `-S` | `--save` | Save outputs to `.claude/output/apex/` |
35
+ | `-t` | `-T` | `--test` | Include test creation + runner |
36
+ | `-e` | `-E` | `--economy` | No subagents, save tokens |
37
+ | `-b` | `-B` | `--branch` | Verify not on main, create branch |
38
+ | `-pr` | `-PR` | `--pull-request` | Create PR at end (enables -b) |
39
+ | `-i` | | `--interactive` | Configure flags via menu |
40
+ | `-k` | `-K` | `--tasks` | Task breakdown with dependencies |
41
+ | `-m` | `-M` | `--teams` | Agent Teams parallel execution (enables -k) |
42
+ | `-r` | | `--resume` | Resume from previous task ID |
43
+
44
+ **Parsing:** Defaults from `steps/step-00-init.md`, flags override, remainder = `{task_description}`, ID = `NN-kebab-case`.
45
+ </flags>
46
+
47
+ <workflow>
48
+ 1. **Init** → Parse flags, setup state
49
+ 2. **Analyze** → Context gathering (1-10 parallel agents)
50
+ 3. **Plan** → File-by-file strategy + TaskList creation
51
+ 4. **Tasks** → Task breakdown (if -k or -m)
52
+ 5. **Execute** → Implementation (standard or Agent Teams if -m)
53
+ 6. **Validate** → Typecheck, lint, tests
54
+ 7. **Tests** → Create + run tests (if -t)
55
+ 8. **Examine** → Adversarial review (if -x)
56
+ 9. **Resolve** → Fix findings (if examine found issues)
57
+ 10. **Finish** → Create PR (if -pr)
58
+ </workflow>
59
+
60
+ <step_files>
61
+
62
+ | Step | File | Purpose |
63
+ |------|------|---------|
64
+ | 00 | `steps/step-00-init.md` | Parse flags, initialize state |
65
+ | 00b | `steps/step-00b-save.md` | Setup save output structure (if -s) |
66
+ | 00b | `steps/step-00b-branch.md` | Git branch setup (if -b) |
67
+ | 00b | `steps/step-00b-economy.md` | Economy mode overrides (if -e) |
68
+ | 00b | `steps/step-00b-interactive.md` | Interactive flag config (if -i) |
69
+ | 01 | `steps/step-01-analyze.md` | Smart context gathering |
70
+ | 02 | `steps/step-02-plan.md` | File-by-file plan + TaskList |
71
+ | 02b | `steps/step-02b-tasks.md` | Task breakdown (if -k/-m) |
72
+ | 03 | `steps/step-03-execute.md` | Todo-driven implementation |
73
+ | 03t | `steps/step-03-execute-teams.md` | Agent Team execution (if -m) |
74
+ | 04 | `steps/step-04-validate.md` | Self-check and validation |
75
+ | 05 | `steps/step-05-examine.md` | Adversarial code review |
76
+ | 06 | `steps/step-06-resolve.md` | Finding resolution |
77
+ | 07 | `steps/step-07-tests.md` | Test analysis and creation |
78
+ | 08 | `steps/step-08-run-tests.md` | Test runner loop |
79
+ | 09 | `steps/step-09-finish.md` | Create pull request |
80
+
81
+ </step_files>
82
+
83
+ <state_variables>
84
+
85
+ | Variable | Type | Set by |
86
+ |----------|------|--------|
87
+ | `{task_description}` | string | step-00 |
88
+ | `{feature_name}` | string | step-00 |
89
+ | `{task_id}` | string | step-00 / step-00b-save |
90
+ | `{acceptance_criteria}` | list | step-01 |
91
+ | `{auto_mode}` | boolean | step-00 |
92
+ | `{examine_mode}` | boolean | step-00 |
93
+ | `{save_mode}` | boolean | step-00 |
94
+ | `{test_mode}` | boolean | step-00 |
95
+ | `{economy_mode}` | boolean | step-00 |
96
+ | `{branch_mode}` | boolean | step-00 |
97
+ | `{pr_mode}` | boolean | step-00 |
98
+ | `{tasks_mode}` | boolean | step-00 |
99
+ | `{teams_mode}` | boolean | step-00 |
100
+ | `{output_dir}` | string | step-00b-save |
101
+ | `{branch_name}` | string | step-00b-branch |
102
+
103
+ </state_variables>
104
+
105
+ <execution_rules>
106
+ - **Load one step at a time** (progressive loading)
107
+ - **ULTRA THINK** before major decisions
108
+ - **Persist state variables** across all steps
109
+ - **Follow next_step directive** at end of each step
110
+ - **Save outputs** if `{save_mode}` = true (each step appends to its file)
111
+ - **Use parallel agents** for independent exploration (step-01)
112
+ </execution_rules>
113
+
114
+ <entry_point>
115
+ **FIRST ACTION:** Load `steps/step-00-init.md`
116
+ </entry_point>
@@ -18,8 +18,9 @@ ECONOMY_MODE="${7:-false}"
18
18
  BRANCH_MODE="${8:-false}"
19
19
  PR_MODE="${9:-false}"
20
20
  INTERACTIVE_MODE="${10:-false}"
21
- BRANCH_NAME="${11:-}"
22
- ORIGINAL_INPUT="${12:-}"
21
+ TASKS_MODE="${11:-false}"
22
+ BRANCH_NAME="${12:-}"
23
+ ORIGINAL_INPUT="${13:-}"
23
24
 
24
25
  # Validate required arguments
25
26
  if [[ -z "$FEATURE_NAME" ]]; then
@@ -83,6 +84,9 @@ render_template() {
83
84
  local pr_status="⏭ Skip"
84
85
  [[ "$PR_MODE" == "true" ]] && pr_status="⏸ Pending"
85
86
 
87
+ local tasks_status="⏭ Skip"
88
+ [[ "$TASKS_MODE" == "true" ]] && tasks_status="⏸ Pending"
89
+
86
90
  # Read template and replace variables
87
91
  sed -e "s|{{task_id}}|${TASK_ID}|g" \
88
92
  -e "s|{{task_description}}|${TASK_DESCRIPTION}|g" \
@@ -95,10 +99,12 @@ render_template() {
95
99
  -e "s|{{branch_mode}}|${BRANCH_MODE}|g" \
96
100
  -e "s|{{pr_mode}}|${PR_MODE}|g" \
97
101
  -e "s|{{interactive_mode}}|${INTERACTIVE_MODE}|g" \
102
+ -e "s|{{tasks_mode}}|${TASKS_MODE}|g" \
98
103
  -e "s|{{branch_name}}|${BRANCH_NAME}|g" \
99
104
  -e "s|{{original_input}}|${ORIGINAL_INPUT}|g" \
100
105
  -e "s|{{examine_status}}|${examine_status}|g" \
101
106
  -e "s|{{test_status}}|${test_status}|g" \
107
+ -e "s|{{tasks_status}}|${tasks_status}|g" \
102
108
  -e "s|{{pr_status}}|${pr_status}|g" \
103
109
  "$template_file" > "$output_file"
104
110
  }
@@ -123,6 +129,10 @@ if [[ "$TEST_MODE" == "true" ]]; then
123
129
  render_template "${TEMPLATE_DIR}/08-run-tests.md" "${OUTPUT_DIR}/08-run-tests.md"
124
130
  fi
125
131
 
132
+ if [[ "$TASKS_MODE" == "true" ]]; then
133
+ mkdir -p "${OUTPUT_DIR}/tasks"
134
+ fi
135
+
126
136
  if [[ "$PR_MODE" == "true" ]]; then
127
137
  render_template "${TEMPLATE_DIR}/09-finish.md" "${OUTPUT_DIR}/09-finish.md"
128
138
  fi
@@ -56,6 +56,8 @@ economy_mode: false # -e: No subagents, save tokens (for limited plans)
56
56
  branch_mode: false # -b: Verify not on main, create branch if needed
57
57
  pr_mode: false # -pr: Create pull request at end (enables -b)
58
58
  interactive_mode: false # -i: Configure flags interactively
59
+ tasks_mode: false # -k: Generate task breakdown after plan
60
+ teams_mode: false # -m: Use Claude Code Agent Teams for parallel execution
59
61
 
60
62
  # Presets:
61
63
  # Budget-friendly: economy_mode: true
@@ -84,6 +86,8 @@ interactive_mode: false # -i: Configure flags interactively
84
86
  {branch_mode} = <default>
85
87
  {pr_mode} = <default>
86
88
  {interactive_mode} = <default>
89
+ {tasks_mode} = <default>
90
+ {teams_mode} = <default>
87
91
  ```
88
92
 
89
93
  **Step 2: Parse user input and override defaults:**
@@ -104,6 +108,14 @@ Disable flags (UPPERCASE - turn OFF):
104
108
  -E or --no-economy → {economy_mode} = false
105
109
  -B or --no-branch → {branch_mode} = false
106
110
  -PR or --no-pull-request → {pr_mode} = false
111
+ -K or --no-tasks → {tasks_mode} = false
112
+ -M or --no-teams → {teams_mode} = false
113
+
114
+ Tasks mode:
115
+ -k or --tasks → {tasks_mode} = true
116
+
117
+ Teams mode:
118
+ -m or --teams → {teams_mode} = true, {tasks_mode} = true
107
119
 
108
120
  Branch/PR flags:
109
121
  -b or --branch → {branch_mode} = true
@@ -178,43 +190,14 @@ IF {branch_mode} = true:
178
190
  IF {economy_mode} = true:
179
191
  → Load steps/step-00b-economy.md
180
192
  → Apply economy overrides
181
- ```
182
193
 
183
- ### 4. Create Output Structure (if save_mode)
184
-
185
- **If `{save_mode}` = true:**
186
-
187
- Run the template setup script to initialize all output files:
188
-
189
- ```bash
190
- bash {skill_dir}/scripts/setup-templates.sh \
191
- "{feature_name}" \
192
- "{task_description}" \
193
- "{auto_mode}" \
194
- "{examine_mode}" \
195
- "{save_mode}" \
196
- "{test_mode}" \
197
- "{economy_mode}" \
198
- "{branch_mode}" \
199
- "{pr_mode}" \
200
- "{interactive_mode}" \
201
- "{branch_name}" \
202
- "{original_input}"
194
+ IF {save_mode} = true:
195
+ → Load steps/step-00b-save.md
196
+ Create output structure, generate {task_id} and {output_dir}
197
+ → Return here with {task_id} and {output_dir} set
203
198
  ```
204
199
 
205
- **Note:** Pass `{feature_name}` (without number prefix), NOT `{task_id}`.
206
- The script auto-detects the next available number from existing folders.
207
-
208
- This script:
209
-
210
- - Auto-generates `{task_id}` = `NN-{feature_name}` (next available number)
211
- - Creates `.claude/output/apex/{task_id}/` directory
212
- - Initializes `00-context.md` with configuration and progress table
213
- - Pre-creates all step files from templates (01-analyze.md, 02-plan.md, etc.)
214
- - Only creates files for enabled steps (examine, tests, PR)
215
- - Outputs the generated `{task_id}` for use in subsequent steps
216
-
217
- ### 5. Initialize and Proceed
200
+ ### 4. Initialize and Proceed
218
201
 
219
202
  **Always (regardless of auto_mode):**
220
203
 
@@ -233,6 +216,8 @@ Show COMPACT initialization summary (one table, then proceed immediately):
233
216
  | `{economy_mode}` | true/false |
234
217
  | `{branch_mode}` | true/false |
235
218
  | `{pr_mode}` | true/false |
219
+ | `{tasks_mode}` | true/false |
220
+ | `{teams_mode}` | true/false |
236
221
 
237
222
  → Analyzing...
238
223
  ```
@@ -45,6 +45,7 @@ Show current flag values:
45
45
  | Economy (`-e`) | {economy_mode ? "✓ ON" : "✗ OFF"} | No subagents |
46
46
  | Branch (`-b`) | {branch_mode ? "✓ ON" : "✗ OFF"} | Verify/create branch |
47
47
  | PR (`-pr`) | {pr_mode ? "✓ ON" : "✗ OFF"} | Create pull request |
48
+ | Teams (`-m`) | {teams_mode ? "✓ ON" : "✗ OFF"} | Agent Teams parallel execution |
48
49
  ```
49
50
 
50
51
  ### 2. Ask for Flag Changes
@@ -80,6 +81,8 @@ questions:
80
81
  description: "{branch_mode ? 'Disable' : 'Enable'} - verify/create git branch"
81
82
  - label: "PR mode"
82
83
  description: "{pr_mode ? 'Disable' : 'Enable'} - create pull request at end"
84
+ - label: "Teams mode"
85
+ description: "{teams_mode ? 'Disable' : 'Enable'} - Agent Teams parallel execution"
83
86
  - label: "Done - keep current"
84
87
  description: "No more changes, proceed with workflow"
85
88
  multiSelect: true
@@ -96,9 +99,17 @@ IF "Test mode" selected → {test_mode} = !{test_mode}
96
99
  IF "Economy mode" selected → {economy_mode} = !{economy_mode}
97
100
  IF "Branch mode" selected → {branch_mode} = !{branch_mode}
98
101
  IF "PR mode" selected → {pr_mode} = !{pr_mode}
102
+ IF "Teams mode" selected → {teams_mode} = !{teams_mode}
99
103
  ```
100
104
 
101
- **Special rule:** If PR mode enabled, auto-enable branch mode:
105
+ **Special rules:**
106
+
107
+ If Teams mode enabled, auto-enable tasks mode (teams requires task breakdown):
108
+ ```
109
+ IF {teams_mode} = true → {tasks_mode} = true
110
+ ```
111
+
112
+ If PR mode enabled, auto-enable branch mode:
102
113
  ```
103
114
  IF {pr_mode} = true → {branch_mode} = true
104
115
  ```
@@ -118,6 +129,7 @@ Display updated configuration:
118
129
  | Economy | {economy_mode ? "✓ ON" : "✗ OFF"} |
119
130
  | Branch | {branch_mode ? "✓ ON" : "✗ OFF"} |
120
131
  | PR | {pr_mode ? "✓ ON" : "✗ OFF"} |
132
+ | Teams | {teams_mode ? "✓ ON" : "✗ OFF"} |
121
133
  ```
122
134
 
123
135
  ### 6. Return
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: step-00b-save
3
+ description: Setup save output structure for APEX workflow
4
+ returns_to: step-00-init.md
5
+ ---
6
+
7
+ # Step 0b: Save Mode Setup
8
+
9
+ ## MANDATORY EXECUTION RULES (READ FIRST):
10
+
11
+ - 🛑 NEVER start analysis or implementation
12
+ - ✅ ALWAYS run the setup script to create output structure
13
+ - ✅ ALWAYS capture the generated `{task_id}` from the script output
14
+ - 📋 YOU ARE A SETUP MANAGER, not an implementer
15
+ - 🚫 FORBIDDEN to start any analysis work
16
+
17
+ ## CONTEXT BOUNDARIES:
18
+
19
+ - Variables available: `{feature_name}`, `{task_description}`, all flag variables, `{branch_name}`
20
+ - This sub-step sets: `{task_id}`, `{output_dir}`
21
+ - Return to step-00-init.md after completion
22
+
23
+ ## YOUR TASK:
24
+
25
+ Create the output directory structure and initialize all output files for the APEX workflow.
26
+
27
+ ---
28
+
29
+ ## OUTPUT STRUCTURE:
30
+
31
+ When save_mode is enabled, all outputs go to the PROJECT directory:
32
+
33
+ ```
34
+ .claude/output/apex/{task-id}/
35
+ ├── 00-context.md # Params, user request, timestamp
36
+ ├── 01-analyze.md # Analysis findings
37
+ ├── 02-plan.md # Implementation plan
38
+ ├── 03-execute.md # Execution log
39
+ ├── 04-validate.md # Validation results
40
+ ├── 02b-tasks/ # Task breakdown (if -k or -m)
41
+ │ ├── README.md
42
+ │ └── task-NN-*.md
43
+ ├── 05-examine.md # Review findings (if -x)
44
+ ├── 06-resolve.md # Resolution log (if -x)
45
+ ├── 07-tests.md # Test analysis (if -t)
46
+ ├── 08-run-tests.md # Test runner log (if -t)
47
+ └── 09-finish.md # PR creation (if -pr)
48
+ ```
49
+
50
+ ## EXECUTION SEQUENCE:
51
+
52
+ ### 1. Run Template Setup Script
53
+
54
+ ```bash
55
+ bash {skill_dir}/scripts/setup-templates.sh \
56
+ "{feature_name}" \
57
+ "{task_description}" \
58
+ "{auto_mode}" \
59
+ "{examine_mode}" \
60
+ "{save_mode}" \
61
+ "{test_mode}" \
62
+ "{economy_mode}" \
63
+ "{branch_mode}" \
64
+ "{pr_mode}" \
65
+ "{interactive_mode}" \
66
+ "{tasks_mode}" \
67
+ "{branch_name}" \
68
+ "{original_input}"
69
+ ```
70
+
71
+ **Note:** Pass `{feature_name}` (without number prefix), NOT `{task_id}`.
72
+
73
+ The script:
74
+ - Auto-generates `{task_id}` = `NN-{feature_name}` (next available number)
75
+ - Creates `.claude/output/apex/{task_id}/` directory
76
+ - Initializes `00-context.md` with configuration and progress table
77
+ - Pre-creates all step files from templates
78
+ - Only creates files for enabled steps (examine, tests, PR)
79
+ - Outputs the generated `{task_id}`
80
+
81
+ ### 2. Capture Output Variables
82
+
83
+ From the script output, set:
84
+ - `{task_id}` = the generated ID (e.g., `01-add-auth-middleware`)
85
+ - `{output_dir}` = `.claude/output/apex/{task_id}`
86
+
87
+ ### 3. Return
88
+
89
+ → Return to step-00-init.md with `{task_id}` and `{output_dir}` set
90
+
91
+ ---
92
+
93
+ ## SAVE OUTPUT PATTERN (for all subsequent steps):
94
+
95
+ Each step uses this pattern:
96
+
97
+ 1. `bash {skill_dir}/scripts/update-progress.sh "{task_id}" "{step_num}" "{step_name}" "in_progress"`
98
+ 2. Append findings/outputs to the pre-created step file
99
+ 3. `bash {skill_dir}/scripts/update-progress.sh "{task_id}" "{step_num}" "{step_name}" "complete"`
100
+
101
+ ---
102
+
103
+ ## SUCCESS METRICS:
104
+
105
+ ✅ Output directory created
106
+ ✅ `{task_id}` generated and captured
107
+ ✅ `{output_dir}` set
108
+ ✅ All template files initialized
109
+
110
+ ## FAILURE MODES:
111
+
112
+ ❌ Not capturing `{task_id}` from script output
113
+ ❌ Starting analysis before returning
114
+
115
+ ---
116
+
117
+ ## RETURN:
118
+
119
+ After setup complete, return to `./step-00-init.md` to continue initialization.
120
+
121
+ <critical>
122
+ Remember: This sub-step ONLY creates the output structure. Return immediately after setting {task_id} and {output_dir}.
123
+ </critical>
@@ -11,11 +11,14 @@ 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)
14
15
  - ✅ ALWAYS focus on discovering WHAT EXISTS
15
16
  - ✅ 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
16
18
  - 📋 YOU ARE AN EXPLORER, not a planner
17
19
  - 💬 FOCUS on "What is here?" NOT "What should we build?"
18
20
  - 🚫 FORBIDDEN to suggest implementations or approaches
21
+ - 🚫 FORBIDDEN to skip file saving when save_mode is true
19
22
 
20
23
  ## 🧠 SMART AGENT STRATEGY
21
24
 
@@ -30,9 +33,10 @@ Before exploring, THINK about what information you need and launch the RIGHT age
30
33
  ## EXECUTION PROTOCOLS:
31
34
 
32
35
  - 🎯 Launch parallel exploration agents (unless economy_mode)
33
- - 💾 Append findings to output file (if save_mode)
36
+ - 💾 IF save_mode: Use Edit tool to append findings to `{output_dir}/01-analyze.md` AFTER agents complete and BEFORE showing summary
34
37
  - 📖 Document patterns with specific file:line references
35
38
  - 🚫 FORBIDDEN to proceed until context is complete
39
+ - 🚫 FORBIDDEN to proceed to step-02 without saving findings first (if save_mode)
36
40
 
37
41
  ## CONTEXT BOUNDARIES:
38
42
 
@@ -214,9 +218,14 @@ Find common patterns and pitfalls.
214
218
  [Task: websearch - Stripe webhook security best practices]
215
219
  ```
216
220
 
217
- ### 4. Synthesize Findings
221
+ ### 4. Synthesize Findings + Save to File
218
222
 
219
- Combine results into structured context:
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:
220
229
 
221
230
  ```markdown
222
231
  ## Codebase Context
@@ -256,7 +265,9 @@ Combine results into structured context:
256
265
  - Use httpOnly cookies for tokens
257
266
  ```
258
267
 
259
- **If `{save_mode}` = true:** Append synthesis to 01-analyze.md
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.
260
271
 
261
272
  ### 5. Infer Acceptance Criteria
262
273
 
@@ -274,9 +285,26 @@ Based on "{task_description}" and existing patterns:
274
285
  _These will be refined in the planning step._
275
286
  ```
276
287
 
277
- **If `{save_mode}` = true:** Update 00-context.md with acceptance criteria
288
+ **If `{save_mode}` = true:** Append acceptance criteria to `{output_dir}/01-analyze.md` using Edit tool.
278
289
 
279
- ### 6. Present Context Summary
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
280
308
 
281
309
  **Always (regardless of auto_mode):**
282
310
 
@@ -300,17 +328,6 @@ Present summary and proceed directly to planning:
300
328
  Do NOT ask for user confirmation here - always proceed directly to step-02-plan.
301
329
  </critical>
302
330
 
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
331
  ---
315
332
 
316
333
  ## SUCCESS METRICS:
@@ -329,6 +346,7 @@ bash {skill_dir}/scripts/update-progress.sh "{task_id}" "02" "plan" "in_progress
329
346
 
330
347
  ## FAILURE MODES:
331
348
 
349
+ ❌ **CRITICAL**: Skipping file save when save_mode is true (proceeding to plan without writing to 01-analyze.md)
332
350
  ❌ Starting to plan or design (that's step 2!)
333
351
  ❌ Suggesting implementations or approaches
334
352
  ❌ Missing obvious related files
@@ -358,4 +376,5 @@ Always proceed directly to `./step-02-plan.md` after presenting context summary.
358
376
  <critical>
359
377
  Remember: Analysis is ONLY about "What exists?" - save all planning for step-02!
360
378
  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.
361
380
  </critical>