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
@@ -1,116 +1,261 @@
1
1
  ---
2
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>"
3
+ description: Systematic implementation using APEX methodology (Analyze-Plan-Execute-Validate) with parallel agents and self-validation. Use when implementing features, fixing bugs, or making code changes that benefit from structured workflow.
4
+ argument-hint: "[-a] [-s] [-e] [-b] [-i] [-r <task-id>] <task description>"
5
5
  ---
6
6
 
7
7
  <objective>
8
- Execute systematic implementation workflows using the APEX methodology with progressive step loading.
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
9
  </objective>
10
10
 
11
11
  <quick_start>
12
+ **Basic usage:**
12
13
 
13
14
  ```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
15
+ /apex add authentication middleware
23
16
  ```
24
17
 
18
+ **Recommended workflow (autonomous with save):**
19
+
20
+ ```bash
21
+ /apex -a -s implement user registration
22
+ ```
23
+
24
+ **Flags:**
25
+
26
+ - `-a` (auto): Skip confirmations
27
+ - `-s` (save): Save outputs to `.claude/output/apex/`
28
+ - `-e` (economy): No subagents, save tokens
29
+
30
+ See `<parameters>` for complete flag list.
25
31
  </quick_start>
26
32
 
33
+ <parameters>
34
+
27
35
  <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`.
36
+ **Enable flags (turn ON):**
37
+ | Short | Long | Description |
38
+ |-------|------|-------------|
39
+ | `-a` | `--auto` | Autonomous mode: skip confirmations, auto-approve plans |
40
+ | `-s` | `--save` | Save mode: output each step to `.claude/output/apex/` |
41
+ | `-e` | `--economy` | Economy mode: no subagents, save tokens (for limited plans) |
42
+ | `-r` | `--resume` | Resume mode: continue from a previous task |
43
+ | `-b` | `--branch` | Branch mode: verify not on main, create branch if needed |
44
+ | `-i` | `--interactive` | Interactive mode: configure flags via AskUserQuestion |
45
+
46
+ **Disable flags (turn OFF):**
47
+ | Short | Long | Description |
48
+ |-------|------|-------------|
49
+ | `-A` | `--no-auto` | Disable auto mode |
50
+ | `-S` | `--no-save` | Disable save mode |
51
+ | `-E` | `--no-economy` | Disable economy mode |
52
+ | `-B` | `--no-branch` | Disable branch mode |
45
53
  </flags>
46
54
 
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>
55
+ <examples>
56
+ ```bash
57
+ # Basic
58
+ /apex add auth middleware
59
59
 
60
- <step_files>
60
+ # Autonomous (skip confirmations)
61
+ /apex -a add auth middleware
61
62
 
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 |
63
+ # Save outputs
64
+ /apex -a -s add auth middleware
80
65
 
81
- </step_files>
66
+ # Resume previous task
67
+ /apex -r 01-auth-middleware
68
+ /apex -r 01 # Partial match
69
+
70
+ # Economy mode (save tokens)
71
+ /apex -e add auth middleware
72
+
73
+ # Interactive flag config
74
+ /apex -i add auth middleware
75
+
76
+ # Disable flags (uppercase)
77
+ /apex -A add auth middleware # Disable auto
78
+ ```
79
+ </examples>
80
+
81
+ <parsing_rules>
82
+ **Flag parsing:**
83
+
84
+ 1. Defaults loaded from `steps/step-00-init.md` `<defaults>` section
85
+ 2. Command-line flags override defaults (enable with lowercase `-x`, disable with uppercase `-X`)
86
+ 3. Flags removed from input, remainder becomes `{task_description}`
87
+ 4. Task ID generated as `NN-kebab-case-description`
88
+
89
+ For detailed parsing algorithm, see `steps/step-00-init.md`.
90
+ </parsing_rules>
91
+
92
+ </parameters>
93
+
94
+ <output_structure>
95
+ **When `{save_mode}` = true:**
96
+
97
+ All outputs saved to PROJECT directory (where Claude Code is running):
98
+ ```
99
+ .claude/output/apex/{task-id}/
100
+ ├── 00-context.md # Params, user request, timestamp
101
+ ├── 01-analyze.md # Analysis findings
102
+ ├── 02-plan.md # Implementation plan
103
+ ├── 03-execute.md # Execution log
104
+ └── 04-validate.md # Validation results
105
+ ```
106
+
107
+ **00-context.md structure:**
108
+ ```markdown
109
+ # APEX Task: {task_id}
110
+
111
+ **Created:** {timestamp}
112
+ **Task:** {task_description}
113
+
114
+ ## Flags
115
+ - Auto mode: {auto_mode}
116
+ - Save mode: {save_mode}
117
+ - Economy mode: {economy_mode}
118
+
119
+ ## User Request
120
+ {original user input}
121
+
122
+ ## Acceptance Criteria
123
+ - [ ] AC1: {inferred criterion}
124
+ - [ ] AC2: {inferred criterion}
125
+ ```
126
+
127
+ </output_structure>
128
+
129
+ <resume_workflow>
130
+ **Resume mode (`-r {task-id}`):**
131
+
132
+ When provided, step-00 will:
133
+
134
+ 1. Locate the task folder in `.claude/output/apex/`
135
+ 2. Restore state from `00-context.md`
136
+ 3. Find the last completed step
137
+ 4. Continue from the next step
138
+
139
+ Supports partial matching (e.g., `-r 01` finds `01-add-auth-middleware`).
140
+
141
+ For implementation details, see `steps/step-00-init.md`.
142
+ </resume_workflow>
143
+
144
+ <workflow>
145
+ **Standard flow:**
146
+ 1. Parse flags and task description
147
+ 2. If `-r`: Execute resume workflow
148
+ 3. If `-s`: Create output folder and 00-context.md
149
+ 4. Load step-01-analyze.md → gather context
150
+ 5. Load step-02-plan.md → create strategy
151
+ 6. Load step-03-execute.md → implement
152
+ 7. Load step-04-validate.md → verify and complete
153
+ </workflow>
82
154
 
83
155
  <state_variables>
156
+ **Persist throughout all steps:**
84
157
 
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 |
158
+ | Variable | Type | Description |
159
+ | ----------------------- | ------- | ------------------------------------------------------ |
160
+ | `{task_description}` | string | What to implement (flags removed) |
161
+ | `{feature_name}` | string | Kebab-case name without number (e.g., `add-auth-middleware`) |
162
+ | `{task_id}` | string | Full identifier with number (e.g., `01-add-auth-middleware`) |
163
+ | `{acceptance_criteria}` | list | Success criteria (inferred or explicit) |
164
+ | `{auto_mode}` | boolean | Skip confirmations, use recommended options |
165
+ | `{save_mode}` | boolean | Save outputs to .claude/output/apex/ |
166
+ | `{economy_mode}` | boolean | No subagents, direct tool usage only |
167
+ | `{branch_mode}` | boolean | Verify not on main, create branch if needed |
168
+ | `{interactive_mode}` | boolean | Configure flags interactively |
169
+ | `{resume_task}` | string | Task ID to resume (if -r provided) |
170
+ | `{output_dir}` | string | Full path to output directory |
171
+ | `{branch_name}` | string | Created branch name (if branch_mode) |
102
172
 
103
173
  </state_variables>
104
174
 
175
+ <entry_point>
176
+
177
+ **FIRST ACTION:** Load `steps/step-00-init.md`
178
+
179
+ Step 00 handles:
180
+
181
+ - Flag parsing (-a, -x, -s, -r, --test)
182
+ - Resume mode detection and task lookup
183
+ - Output folder creation (if save_mode)
184
+ - 00-context.md creation (if save_mode)
185
+ - State variable initialization
186
+
187
+ After initialization, step-00 loads step-01-analyze.md.
188
+
189
+ </entry_point>
190
+
191
+ <step_files>
192
+ **Progressive loading - only load current step:**
193
+
194
+ | Step | File | Purpose |
195
+ | ---- | ---------------------------- | ---------------------------------------------------- |
196
+ | 00 | `steps/step-00-init.md` | Parse flags, create output folder, initialize state |
197
+ | 01 | `steps/step-01-analyze.md` | Smart context gathering with 1-10 parallel agents based on complexity |
198
+ | 02 | `steps/step-02-plan.md` | File-by-file implementation strategy |
199
+ | 03 | `steps/step-03-execute.md` | Todo-driven implementation |
200
+ | 04 | `steps/step-04-validate.md` | Self-check, validation, and workflow completion |
201
+
202
+ </step_files>
203
+
105
204
  <execution_rules>
106
- - **Load one step at a time** (progressive loading)
205
+
206
+ - **Load one step at a time** - Only load the current step file
107
207
  - **ULTRA THINK** before major decisions
108
208
  - **Persist state variables** across all steps
109
209
  - **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)
210
+ - **Save outputs** if `{save_mode}` = true (append to step file)
211
+ - **Use parallel agents** for independent exploration tasks
212
+
213
+ ## 🧠 Smart Agent Strategy in Analyze Phase
214
+
215
+ The analyze phase (step-01) uses **adaptive agent launching** (unless economy_mode):
216
+
217
+ **Available agents:**
218
+ - `explore-codebase` - Find existing patterns, files, utilities
219
+ - `explore-docs` - Research library docs (use when unfamiliar with API)
220
+ - `websearch` - Find approaches, best practices, gotchas
221
+
222
+ **Launch 1-10 agents based on task complexity:**
223
+
224
+ | Complexity | Agents | When |
225
+ |------------|--------|------|
226
+ | Simple | 1-2 | Bug fix, small tweak |
227
+ | Medium | 2-4 | New feature in familiar stack |
228
+ | Complex | 4-7 | Unfamiliar libraries, integrations |
229
+ | Major | 6-10 | Multiple systems, many unknowns |
230
+
231
+ **BE SMART:** Analyze what you actually need before launching. Don't over-launch for simple tasks, don't under-launch for complex ones.
232
+
112
233
  </execution_rules>
113
234
 
114
- <entry_point>
115
- **FIRST ACTION:** Load `steps/step-00-init.md`
116
- </entry_point>
235
+ <save_output_pattern>
236
+ **When `{save_mode}` = true:**
237
+
238
+ Step-00 runs `scripts/setup-templates.sh` to initialize all output files from `templates/` directory.
239
+
240
+ **Each step then:**
241
+
242
+ 1. Run `scripts/update-progress.sh {task_id} {step_num} {step_name} "in_progress"`
243
+ 2. Append findings/outputs to the pre-created step file
244
+ 3. Run `scripts/update-progress.sh {task_id} {step_num} {step_name} "complete"`
245
+
246
+ **Template system benefits:**
247
+
248
+ - Reduces token usage by ~75% (1,350 tokens saved per workflow)
249
+ - Templates in `templates/` directory (not inline in steps)
250
+ - Scripts handle progress tracking automatically
251
+ - See `templates/README.md` for details
252
+
253
+ </save_output_pattern>
254
+
255
+ <success_criteria>
256
+
257
+ - Each step loaded progressively
258
+ - All validation checks passing
259
+ - Outputs saved if `{save_mode}` enabled
260
+ - Clear completion summary provided
261
+ </success_criteria>
@@ -11,16 +11,12 @@ set -e
11
11
  FEATURE_NAME="$1"
12
12
  TASK_DESCRIPTION="$2"
13
13
  AUTO_MODE="${3:-false}"
14
- EXAMINE_MODE="${4:-false}"
15
- SAVE_MODE="${5:-false}"
16
- TEST_MODE="${6:-false}"
17
- ECONOMY_MODE="${7:-false}"
18
- BRANCH_MODE="${8:-false}"
19
- PR_MODE="${9:-false}"
20
- INTERACTIVE_MODE="${10:-false}"
21
- TASKS_MODE="${11:-false}"
22
- BRANCH_NAME="${12:-}"
23
- ORIGINAL_INPUT="${13:-}"
14
+ SAVE_MODE="${4:-false}"
15
+ ECONOMY_MODE="${5:-false}"
16
+ BRANCH_MODE="${6:-false}"
17
+ INTERACTIVE_MODE="${7:-false}"
18
+ BRANCH_NAME="${8:-}"
19
+ ORIGINAL_INPUT="${9:-}"
24
20
 
25
21
  # Validate required arguments
26
22
  if [[ -z "$FEATURE_NAME" ]]; then
@@ -74,38 +70,17 @@ render_template() {
74
70
  local template_file="$1"
75
71
  local output_file="$2"
76
72
 
77
- # Determine status strings based on flags
78
- local examine_status="⏭ Skip"
79
- [[ "$EXAMINE_MODE" == "true" ]] && examine_status="⏸ Pending"
80
-
81
- local test_status="⏭ Skip"
82
- [[ "$TEST_MODE" == "true" ]] && test_status="⏸ Pending"
83
-
84
- local pr_status="⏭ Skip"
85
- [[ "$PR_MODE" == "true" ]] && pr_status="⏸ Pending"
86
-
87
- local tasks_status="⏭ Skip"
88
- [[ "$TASKS_MODE" == "true" ]] && tasks_status="⏸ Pending"
89
-
90
73
  # Read template and replace variables
91
74
  sed -e "s|{{task_id}}|${TASK_ID}|g" \
92
75
  -e "s|{{task_description}}|${TASK_DESCRIPTION}|g" \
93
76
  -e "s|{{timestamp}}|${TIMESTAMP}|g" \
94
77
  -e "s|{{auto_mode}}|${AUTO_MODE}|g" \
95
- -e "s|{{examine_mode}}|${EXAMINE_MODE}|g" \
96
78
  -e "s|{{save_mode}}|${SAVE_MODE}|g" \
97
- -e "s|{{test_mode}}|${TEST_MODE}|g" \
98
79
  -e "s|{{economy_mode}}|${ECONOMY_MODE}|g" \
99
80
  -e "s|{{branch_mode}}|${BRANCH_MODE}|g" \
100
- -e "s|{{pr_mode}}|${PR_MODE}|g" \
101
81
  -e "s|{{interactive_mode}}|${INTERACTIVE_MODE}|g" \
102
- -e "s|{{tasks_mode}}|${TASKS_MODE}|g" \
103
82
  -e "s|{{branch_name}}|${BRANCH_NAME}|g" \
104
83
  -e "s|{{original_input}}|${ORIGINAL_INPUT}|g" \
105
- -e "s|{{examine_status}}|${examine_status}|g" \
106
- -e "s|{{test_status}}|${test_status}|g" \
107
- -e "s|{{tasks_status}}|${tasks_status}|g" \
108
- -e "s|{{pr_status}}|${pr_status}|g" \
109
84
  "$template_file" > "$output_file"
110
85
  }
111
86
 
@@ -118,25 +93,6 @@ render_template "${TEMPLATE_DIR}/02-plan.md" "${OUTPUT_DIR}/02-plan.md"
118
93
  render_template "${TEMPLATE_DIR}/03-execute.md" "${OUTPUT_DIR}/03-execute.md"
119
94
  render_template "${TEMPLATE_DIR}/04-validate.md" "${OUTPUT_DIR}/04-validate.md"
120
95
 
121
- # Conditional templates
122
- if [[ "$EXAMINE_MODE" == "true" ]]; then
123
- render_template "${TEMPLATE_DIR}/05-examine.md" "${OUTPUT_DIR}/05-examine.md"
124
- render_template "${TEMPLATE_DIR}/06-resolve.md" "${OUTPUT_DIR}/06-resolve.md"
125
- fi
126
-
127
- if [[ "$TEST_MODE" == "true" ]]; then
128
- render_template "${TEMPLATE_DIR}/07-tests.md" "${OUTPUT_DIR}/07-tests.md"
129
- render_template "${TEMPLATE_DIR}/08-run-tests.md" "${OUTPUT_DIR}/08-run-tests.md"
130
- fi
131
-
132
- if [[ "$TASKS_MODE" == "true" ]]; then
133
- mkdir -p "${OUTPUT_DIR}/tasks"
134
- fi
135
-
136
- if [[ "$PR_MODE" == "true" ]]; then
137
- render_template "${TEMPLATE_DIR}/09-finish.md" "${OUTPUT_DIR}/09-finish.md"
138
- fi
139
-
140
96
  # Output the generated task_id for capture by caller
141
97
  echo "TASK_ID=${TASK_ID}"
142
98
  echo "OUTPUT_DIR=${OUTPUT_DIR}"
@@ -49,20 +49,15 @@ Initialize the APEX workflow by parsing flags, detecting continuation state, and
49
49
  # ===========================================
50
50
 
51
51
  auto_mode: false # -a: Skip confirmations, use recommended options
52
- examine_mode: false # -x: Auto-proceed to adversarial review
53
52
  save_mode: false # -s: Save outputs to .claude/output/apex/
54
- test_mode: false # -t: Include test creation and runner steps
55
53
  economy_mode: false # -e: No subagents, save tokens (for limited plans)
56
54
  branch_mode: false # -b: Verify not on main, create branch if needed
57
- pr_mode: false # -pr: Create pull request at end (enables -b)
58
55
  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
61
56
 
62
57
  # Presets:
63
58
  # Budget-friendly: economy_mode: true
64
- # Full quality: examine_mode: true, save_mode: true, test_mode: true
65
- # Autonomous: auto_mode: true, examine_mode: true, save_mode: true, test_mode: true
59
+ # Full quality: save_mode: true
60
+ # Autonomous: auto_mode: true, save_mode: true
66
61
  ```
67
62
 
68
63
  **Flag Reference:** See `SKILL.md` for complete flag documentation and examples.
@@ -79,15 +74,10 @@ teams_mode: false # -m: Use Claude Code Agent Teams for parallel execution
79
74
 
80
75
  ```
81
76
  {auto_mode} = <default>
82
- {examine_mode} = <default>
83
77
  {save_mode} = <default>
84
- {test_mode} = <default>
85
78
  {economy_mode} = <default>
86
79
  {branch_mode} = <default>
87
- {pr_mode} = <default>
88
80
  {interactive_mode} = <default>
89
- {tasks_mode} = <default>
90
- {teams_mode} = <default>
91
81
  ```
92
82
 
93
83
  **Step 2: Parse user input and override defaults:**
@@ -95,31 +85,15 @@ teams_mode: false # -m: Use Claude Code Agent Teams for parallel execution
95
85
  ```
96
86
  Enable flags (lowercase - turn ON):
97
87
  -a or --auto → {auto_mode} = true
98
- -x or --examine → {examine_mode} = true
99
88
  -s or --save → {save_mode} = true
100
- -t or --test → {test_mode} = true
101
89
  -e or --economy → {economy_mode} = true
90
+ -b or --branch → {branch_mode} = true
102
91
 
103
92
  Disable flags (UPPERCASE - turn OFF):
104
93
  -A or --no-auto → {auto_mode} = false
105
- -X or --no-examine → {examine_mode} = false
106
94
  -S or --no-save → {save_mode} = false
107
- -T or --no-test → {test_mode} = false
108
95
  -E or --no-economy → {economy_mode} = false
109
96
  -B or --no-branch → {branch_mode} = false
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
119
-
120
- Branch/PR flags:
121
- -b or --branch → {branch_mode} = true
122
- -pr or --pull-request → {pr_mode} = true, {branch_mode} = true
123
97
 
124
98
  Interactive:
125
99
  -i or --interactive → {interactive_mode} = true
@@ -190,14 +164,39 @@ IF {branch_mode} = true:
190
164
  IF {economy_mode} = true:
191
165
  → Load steps/step-00b-economy.md
192
166
  → Apply economy overrides
167
+ ```
168
+
169
+ ### 4. Create Output Structure (if save_mode)
193
170
 
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
171
+ **If `{save_mode}` = true:**
172
+
173
+ Run the template setup script to initialize all output files:
174
+
175
+ ```bash
176
+ bash {skill_dir}/scripts/setup-templates.sh \
177
+ "{feature_name}" \
178
+ "{task_description}" \
179
+ "{auto_mode}" \
180
+ "{save_mode}" \
181
+ "{economy_mode}" \
182
+ "{branch_mode}" \
183
+ "{interactive_mode}" \
184
+ "{branch_name}" \
185
+ "{original_input}"
198
186
  ```
199
187
 
200
- ### 4. Initialize and Proceed
188
+ **Note:** Pass `{feature_name}` (without number prefix), NOT `{task_id}`.
189
+ The script auto-detects the next available number from existing folders.
190
+
191
+ This script:
192
+
193
+ - Auto-generates `{task_id}` = `NN-{feature_name}` (next available number)
194
+ - Creates `.claude/output/apex/{task_id}/` directory
195
+ - Initializes `00-context.md` with configuration and progress table
196
+ - Pre-creates all step files from templates (01-analyze.md, 02-plan.md, etc.)
197
+ - Outputs the generated `{task_id}` for use in subsequent steps
198
+
199
+ ### 5. Initialize and Proceed
201
200
 
202
201
  **Always (regardless of auto_mode):**
203
202
 
@@ -210,14 +209,9 @@ Show COMPACT initialization summary (one table, then proceed immediately):
210
209
  |----------|-------|
211
210
  | `{task_id}` | 01-kebab-name |
212
211
  | `{auto_mode}` | true/false |
213
- | `{examine_mode}` | true/false |
214
212
  | `{save_mode}` | true/false |
215
- | `{test_mode}` | true/false |
216
213
  | `{economy_mode}` | true/false |
217
214
  | `{branch_mode}` | true/false |
218
- | `{pr_mode}` | true/false |
219
- | `{tasks_mode}` | true/false |
220
- | `{teams_mode}` | true/false |
221
215
 
222
216
  → Analyzing...
223
217
  ```
@@ -45,7 +45,6 @@ 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 |
49
48
  ```
50
49
 
51
50
  ### 2. Ask for Flag Changes
@@ -81,8 +80,6 @@ questions:
81
80
  description: "{branch_mode ? 'Disable' : 'Enable'} - verify/create git branch"
82
81
  - label: "PR mode"
83
82
  description: "{pr_mode ? 'Disable' : 'Enable'} - create pull request at end"
84
- - label: "Teams mode"
85
- description: "{teams_mode ? 'Disable' : 'Enable'} - Agent Teams parallel execution"
86
83
  - label: "Done - keep current"
87
84
  description: "No more changes, proceed with workflow"
88
85
  multiSelect: true
@@ -99,17 +96,9 @@ IF "Test mode" selected → {test_mode} = !{test_mode}
99
96
  IF "Economy mode" selected → {economy_mode} = !{economy_mode}
100
97
  IF "Branch mode" selected → {branch_mode} = !{branch_mode}
101
98
  IF "PR mode" selected → {pr_mode} = !{pr_mode}
102
- IF "Teams mode" selected → {teams_mode} = !{teams_mode}
103
99
  ```
104
100
 
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:
101
+ **Special rule:** If PR mode enabled, auto-enable branch mode:
113
102
  ```
114
103
  IF {pr_mode} = true → {branch_mode} = true
115
104
  ```
@@ -129,7 +118,6 @@ Display updated configuration:
129
118
  | Economy | {economy_mode ? "✓ ON" : "✗ OFF"} |
130
119
  | Branch | {branch_mode ? "✓ ON" : "✗ OFF"} |
131
120
  | PR | {pr_mode ? "✓ ON" : "✗ OFF"} |
132
- | Teams | {teams_mode ? "✓ ON" : "✗ OFF"} |
133
121
  ```
134
122
 
135
123
  ### 6. Return