aiblueprint-cli 1.4.99 → 1.4.100

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 (96) hide show
  1. package/agents-config/skills/agents-manager/SKILL.md +2 -2
  2. package/agents-config/skills/agents-manager/agents/openai.yaml +7 -0
  3. package/agents-config/skills/agents-manager/assets/codex-icon.svg +20 -0
  4. package/agents-config/skills/apex/SKILL.md +120 -118
  5. package/agents-config/skills/apex/agents/openai.yaml +10 -0
  6. package/agents-config/skills/apex/assets/codex-icon.svg +15 -0
  7. package/agents-config/skills/apex/scripts/apex-state.py +740 -0
  8. package/agents-config/skills/apex/scripts/setup-templates.sh +27 -145
  9. package/agents-config/skills/apex/scripts/test_apex_state.py +413 -0
  10. package/agents-config/skills/apex/scripts/update-progress.sh +17 -73
  11. package/agents-config/skills/apex/steps/step-00-init.md +85 -231
  12. package/agents-config/skills/apex/steps/step-00b-branch.md +10 -118
  13. package/agents-config/skills/apex/steps/step-00b-economy.md +12 -239
  14. package/agents-config/skills/apex/steps/step-00b-interactive.md +13 -162
  15. package/agents-config/skills/apex/steps/step-00b-save.md +13 -114
  16. package/agents-config/skills/apex/steps/step-01-analyze.md +40 -361
  17. package/agents-config/skills/apex/steps/step-02-plan.md +55 -562
  18. package/agents-config/skills/apex/steps/step-02b-tasks.md +15 -291
  19. package/agents-config/skills/apex/steps/step-03-execute-teams.md +47 -267
  20. package/agents-config/skills/apex/steps/step-03-execute.md +32 -212
  21. package/agents-config/skills/apex/steps/step-04-validate.md +42 -246
  22. package/agents-config/skills/apex/steps/step-05-examine.md +47 -371
  23. package/agents-config/skills/apex/steps/step-06-resolve.md +19 -221
  24. package/agents-config/skills/apex/steps/step-07-tests.md +19 -234
  25. package/agents-config/skills/apex/steps/step-08-run-tests.md +13 -300
  26. package/agents-config/skills/apex/steps/step-09-finish.md +36 -200
  27. package/agents-config/skills/apex/steps/step-10-verify.md +46 -264
  28. package/agents-config/skills/appstore-connect/agents/openai.yaml +7 -0
  29. package/agents-config/skills/appstore-connect/assets/codex-icon.svg +17 -0
  30. package/agents-config/skills/commit/agents/openai.yaml +10 -0
  31. package/agents-config/skills/commit/assets/codex-icon.svg +17 -0
  32. package/agents-config/skills/create-pr/agents/openai.yaml +10 -0
  33. package/agents-config/skills/create-pr/assets/codex-icon.svg +17 -0
  34. package/agents-config/skills/environments-manager/SKILL.md +1 -1
  35. package/agents-config/skills/environments-manager/agents/openai.yaml +7 -0
  36. package/agents-config/skills/environments-manager/assets/codex-icon.svg +16 -0
  37. package/agents-config/skills/environments-manager/examples/scripts/claude-worktree-remove.sh +19 -3
  38. package/agents-config/skills/environments-manager/examples/scripts/worktree-up.sh +1 -1
  39. package/agents-config/skills/environments-manager/references/claude.md +1 -1
  40. package/agents-config/skills/fix-pr-comments/agents/openai.yaml +10 -0
  41. package/agents-config/skills/fix-pr-comments/assets/codex-icon.svg +17 -0
  42. package/agents-config/skills/grill-me/SKILL.md +25 -4
  43. package/agents-config/skills/grill-me/agents/openai.yaml +8 -0
  44. package/agents-config/skills/grill-me/assets/codex-icon.svg +16 -0
  45. package/agents-config/skills/hooks-manager/SKILL.md +19 -9
  46. package/agents-config/skills/hooks-manager/assets/codex-icon.svg +15 -4
  47. package/agents-config/skills/hooks-manager/references/claude-code.md +32 -0
  48. package/agents-config/skills/hooks-manager/references/codex.md +23 -0
  49. package/agents-config/skills/hooks-manager/references/cursor.md +18 -0
  50. package/agents-config/skills/hooks-manager/references/hook-types.md +5 -3
  51. package/agents-config/skills/hooks-manager/references/input-output-schemas.md +2 -2
  52. package/agents-config/skills/hooks-manager/references/research-sources.md +25 -0
  53. package/agents-config/skills/hooks-manager/references/router.md +32 -0
  54. package/agents-config/skills/hooks-manager/references/troubleshooting.md +3 -3
  55. package/agents-config/skills/merge/agents/openai.yaml +10 -0
  56. package/agents-config/skills/merge/assets/codex-icon.svg +17 -0
  57. package/agents-config/skills/oneshot/SKILL.md +4 -0
  58. package/agents-config/skills/oneshot/agents/openai.yaml +10 -0
  59. package/agents-config/skills/oneshot/assets/codex-icon.svg +18 -0
  60. package/agents-config/skills/prompt-creator/agents/openai.yaml +7 -0
  61. package/agents-config/skills/prompt-creator/assets/codex-icon.svg +16 -0
  62. package/agents-config/skills/rules-manager/agents/openai.yaml +7 -0
  63. package/agents-config/skills/rules-manager/assets/codex-icon.svg +23 -0
  64. package/agents-config/skills/skill-manager/SKILL.md +45 -3
  65. package/agents-config/skills/skill-manager/agents/openai.yaml +7 -0
  66. package/agents-config/skills/skill-manager/assets/codex-icon.svg +23 -0
  67. package/agents-config/skills/skill-manager/references/skill-writing-glossary.md +201 -0
  68. package/agents-config/skills/skill-manager/scripts/setup-codex-icons.ts +143 -0
  69. package/agents-config/skills/ultrathink/agents/openai.yaml +10 -0
  70. package/agents-config/skills/ultrathink/assets/codex-icon.svg +20 -0
  71. package/agents-config/skills/use-artifacts/SKILL.md +102 -51
  72. package/agents-config/skills/use-artifacts/assets/local-runtime.js +299 -0
  73. package/agents-config/skills/use-artifacts/scripts/create_artifact.py +1 -1
  74. package/agents-config/skills/use-delegate/SKILL.md +4 -0
  75. package/agents-config/skills/use-delegate/agents/openai.yaml +10 -0
  76. package/agents-config/skills/use-delegate/assets/codex-icon.svg +20 -0
  77. package/agents-config/skills/use-goal/SKILL.md +70 -9
  78. package/agents-config/skills/use-goal/agents/openai.yaml +1 -1
  79. package/agents-config/skills/use-goal/assets/codex-icon.svg +17 -3
  80. package/agents-config/skills/use-goal/references/claude-code-goal.md +54 -6
  81. package/agents-config/skills/use-goal/references/codex-goal.md +59 -4
  82. package/agents-config/skills/use-goal/references/verification-harnesses.md +104 -3
  83. package/package.json +1 -1
  84. package/agents-config/skills/apex/templates/00-context.md +0 -55
  85. package/agents-config/skills/apex/templates/01-analyze.md +0 -10
  86. package/agents-config/skills/apex/templates/02-plan.md +0 -10
  87. package/agents-config/skills/apex/templates/03-execute.md +0 -10
  88. package/agents-config/skills/apex/templates/04-validate.md +0 -10
  89. package/agents-config/skills/apex/templates/05-examine.md +0 -10
  90. package/agents-config/skills/apex/templates/06-resolve.md +0 -10
  91. package/agents-config/skills/apex/templates/07-tests.md +0 -10
  92. package/agents-config/skills/apex/templates/08-run-tests.md +0 -10
  93. package/agents-config/skills/apex/templates/09-finish.md +0 -10
  94. package/agents-config/skills/apex/templates/10-verify.md +0 -9
  95. package/agents-config/skills/apex/templates/README.md +0 -195
  96. package/agents-config/skills/apex/templates/step-complete.md +0 -7
@@ -1,301 +1,25 @@
1
1
  ---
2
2
  name: step-02b-tasks
3
- description: Generate task breakdown with dependencies from the implementation plan
4
- prev_step: steps/step-02-plan.md
5
- next_step: steps/step-03-execute.md
3
+ description: Expand the APEX task graph into durable task packets for complex or delegated execution.
6
4
  ---
7
5
 
8
- # Step 2b: Task Breakdown
6
+ # Step 2b: Expanded task packets
9
7
 
10
- ## MANDATORY EXECUTION RULES (READ FIRST):
8
+ Use only when the task is complex, resumable, delegated, or explicitly requests expanded task artifacts.
11
9
 
12
- - 🛑 NEVER start implementing - that's step 3
13
- - 🛑 NEVER write or modify code in this step
14
- - ✅ ALWAYS create individual task files with clear structure
15
- - ✅ ALWAYS include dependencies between tasks
16
- - ✅ ALWAYS create a README.md explaining the task graph
17
- - 📋 YOU ARE A TASK ARCHITECT, not an implementer
18
- - 💬 FOCUS on breaking down the plan into executable tasks
19
- - 🚫 FORBIDDEN to use Edit, Write (except for task files), or Bash tools
10
+ For each node in `{run_dir}/tasks.json`, create `{run_dir}/tasks/<id>.md` containing:
20
11
 
21
- ## EXECUTION PROTOCOLS:
12
+ - objective and non-goals;
13
+ - verified context and relevant paths;
14
+ - dependencies and dependency artifacts;
15
+ - allowed read and write boundaries;
16
+ - side effects and exclusive resources;
17
+ - implementation guidance without hidden scope expansion;
18
+ - validation commands and evidence contract;
19
+ - stop condition and escalation path.
22
20
 
23
- - 🎯 Analyze the plan from step-02 before creating tasks
24
- - 💾 Create `tasks/` folder inside output directory (if save_mode)
25
- - 📖 Reference the implementation plan structure
26
- - 🚫 FORBIDDEN to proceed until all tasks are created
21
+ Keep one owner per write boundary at a time. Dependent tasks consume explicit artifacts or committed interface decisions, not assumptions about another worker's unfinished state.
27
22
 
28
- ## CONTEXT BOUNDARIES:
23
+ Validate that the graph has no missing IDs, circular dependencies, orphaned acceptance criteria, or overlapping mutating ownership.
29
24
 
30
- - Context from step-01 (analysis) and step-02 (plan) is available
31
- - Implementation has NOT started
32
- - Tasks should map directly to plan sections
33
- - Each task is self-contained with all context needed
34
-
35
- ## YOUR TASK:
36
-
37
- Transform the implementation plan into individual task files with clear dependencies, enabling parallel execution where possible.
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
- | `{tasks_mode}` | Generate task breakdown (should be true) |
52
- | `{output_dir}` | Path to output (if save_mode) |
53
- | Plan | Full implementation plan from step-02 |
54
- </available_state>
55
-
56
- ---
57
-
58
- ## EXECUTION SEQUENCE:
59
-
60
- ### 1. Create Tasks Directory
61
-
62
- **If `{save_mode}` = true:**
63
-
64
- ```bash
65
- mkdir -p {output_dir}/tasks
66
- ```
67
-
68
- ### 2. Analyze Plan and Identify Tasks
69
-
70
- From the implementation plan, identify:
71
-
72
- - **Independent tasks** - Can run in parallel (no dependencies)
73
- - **Sequential tasks** - Must wait for other tasks to complete
74
- - **File-grouped tasks** - Changes to same file that could be combined
75
-
76
- **Task sizing guidelines:**
77
-
78
- - Each task should be completable in one focused session
79
- - Tasks should modify 1-3 files maximum
80
- - Complex file changes can be split into multiple tasks
81
-
82
- ### 3. Create Individual Task Files
83
-
84
- For each task, create a file: `{output_dir}/tasks/task-NN-{name}.md`
85
-
86
- **Task file structure:**
87
-
88
- ```markdown
89
- ---
90
- id: task-NN
91
- name: {short-descriptive-name}
92
- status: pending
93
- priority: {high|medium|low}
94
- depends_on: [task-XX, task-YY] # Empty array if no dependencies
95
- blocks: [task-ZZ] # Tasks waiting for this one
96
- estimated_files:
97
- - path/to/file1.ts
98
- - path/to/file2.ts
99
- ---
100
-
101
- # Task NN: {Descriptive Title}
102
-
103
- ## Objective
104
-
105
- {One sentence describing what this task accomplishes}
106
-
107
- ## Context
108
-
109
- {2-3 sentences providing background needed to complete the task}
110
-
111
- ## Plan
112
-
113
- {Specific implementation steps, referencing line numbers and patterns}
114
-
115
- 1. Step one
116
- 2. Step two
117
- 3. Step three
118
-
119
- ## Files to Modify
120
-
121
- | File | Action | Changes |
122
- |------|--------|---------|
123
- | `path/to/file.ts` | Modify | Add function X, update Y |
124
-
125
- ## Acceptance Criteria
126
-
127
- - [ ] AC1: {Specific testable criterion}
128
- - [ ] AC2: {Specific testable criterion}
129
-
130
- ## Dependencies
131
-
132
- **Depends on:**
133
- - `task-XX`: {Why this dependency exists}
134
-
135
- **Blocks:**
136
- - `task-ZZ`: {Why this blocks other tasks}
137
-
138
- ## Notes
139
-
140
- {Any additional context, gotchas, or considerations}
141
- ```
142
-
143
- ### 4. Build Dependency Graph
144
-
145
- Analyze task relationships:
146
-
147
- ```
148
- task-01 ──┬──► task-02 ──► task-04
149
- │
150
- └──► task-03 ──► task-05
151
- ▲
152
- │
153
- task-06 ─────────────┘
154
- ```
155
-
156
- Identify:
157
- - **Critical path** - Longest chain of dependencies
158
- - **Parallel groups** - Tasks that can run simultaneously
159
- - **Bottlenecks** - Tasks blocking many others
160
-
161
- ### 5. Create README.md
162
-
163
- Create `{output_dir}/tasks/README.md`:
164
-
165
- ```markdown
166
- # Task Breakdown: {task_description}
167
-
168
- **Generated:** {timestamp}
169
- **Total Tasks:** {count}
170
- **Parallel Groups:** {count}
171
-
172
- ## Overview
173
-
174
- {1-2 sentences summarizing the task breakdown}
175
-
176
- ## Dependency Graph
177
-
178
- ```
179
- [Visual representation of task dependencies]
180
- ```
181
-
182
- ## Task Summary
183
-
184
- | ID | Name | Status | Depends On | Priority |
185
- |----|------|--------|------------|----------|
186
- | 01 | {name} | pending | - | high |
187
- | 02 | {name} | pending | 01 | medium |
188
-
189
- ## Parallel Execution Groups
190
-
191
- **Group 1 (Start immediately):**
192
- - task-01: {name}
193
- - task-06: {name}
194
-
195
- **Group 2 (After Group 1):**
196
- - task-02: {name} (after task-01)
197
- - task-03: {name} (after task-01, task-06)
198
-
199
- **Group 3 (After Group 2):**
200
- - task-04: {name} (after task-02)
201
- - task-05: {name} (after task-03)
202
-
203
- ## Critical Path
204
-
205
- task-01 → task-02 → task-04
206
-
207
- ## Notes
208
-
209
- {Any additional context about the task breakdown}
210
- ```
211
-
212
- ### 6. Validate Task Breakdown
213
-
214
- Checklist:
215
- - [ ] All plan sections have corresponding tasks
216
- - [ ] No circular dependencies
217
- - [ ] Each task has clear acceptance criteria
218
- - [ ] Dependencies are logical and minimal
219
- - [ ] Parallel opportunities maximized
220
- - [ ] README accurately describes the graph
221
-
222
- ### 7. Present Summary
223
-
224
- ```
225
- **Task Breakdown Complete**
226
-
227
- **Total tasks:** {count}
228
- **Independent (can start now):** {count}
229
- **Sequential chains:** {count}
230
-
231
- **Files created:**
232
- - tasks/README.md
233
- - tasks/task-01-{name}.md
234
- - tasks/task-02-{name}.md
235
- - ...
236
- ```
237
-
238
- **If `{auto_mode}` = true:**
239
- → Skip confirmation, proceed to execution
240
-
241
- **If `{auto_mode}` = false:**
242
-
243
- ```yaml
244
- questions:
245
- - header: "Tasks"
246
- question: "Task breakdown complete. Ready to proceed to implementation?"
247
- options:
248
- - label: "Continue to execution (Recommended)"
249
- description: "Start implementing tasks in order"
250
- - label: "Review tasks first"
251
- description: "I want to examine the task files"
252
- - label: "Adjust breakdown"
253
- description: "Modify the task structure"
254
- multiSelect: false
255
- ```
256
-
257
- ---
258
-
259
- ## SUCCESS METRICS:
260
-
261
- ✅ Tasks directory created with all task files
262
- ✅ Each task has clear dependencies documented
263
- ✅ README.md provides complete overview
264
- ✅ Dependency graph has no cycles
265
- ✅ Parallel groups identified
266
- ✅ Critical path documented
267
- ✅ NO code written or modified
268
-
269
- ## FAILURE MODES:
270
-
271
- ❌ Creating tasks without clear dependencies
272
- ❌ Missing README.md
273
- ❌ Circular dependencies in graph
274
- ❌ Tasks too large or too granular
275
- ❌ Starting to write code (that's step 3!)
276
- ❌ **CRITICAL**: Not using AskUserQuestion for confirmation
277
-
278
- ## TASK BREAKDOWN PROTOCOLS:
279
-
280
- - Each task must be self-contained with all needed context
281
- - Dependencies should be minimal and justified
282
- - Maximize parallel execution opportunities
283
- - Task files follow consistent structure
284
- - README provides birds-eye view
285
-
286
- ---
287
-
288
- ## NEXT STEP:
289
-
290
- After user confirms via AskUserQuestion (or auto-proceed):
291
-
292
- **If `{teams_mode}` = true:**
293
- → Load `./step-03-execute-teams.md` for Agent Team parallel execution
294
-
295
- **Otherwise:**
296
- → Load `./step-03-execute.md` to start implementation
297
-
298
- <critical>
299
- Remember: This step ONLY creates task documentation - save all implementation for step-03!
300
- The tasks folder gives a clear roadmap of what to implement and in what order.
301
- </critical>
25
+ Record completion and load the exact `{execution_step}` persisted by `step-02-plan.md`. If it is missing or no longer compatible with current capabilities, return to planning and record a re-plan event instead of guessing.
@@ -1,296 +1,76 @@
1
1
  ---
2
2
  name: step-03-execute-teams
3
- description: Execute implementation using Claude Code Agent Teams for parallel task execution
4
- prev_step: steps/step-02b-tasks.md
5
- next_step: steps/step-04-validate.md
3
+ description: Coordinate bounded APEX subagents using the capabilities available in the current harness.
4
+ next_step: step-04-validate.md
6
5
  ---
7
6
 
8
- # Step 3t: Execute with Agent Teams
7
+ # Step 3: Coordinated execution
9
8
 
10
- ## MANDATORY EXECUTION RULES (READ FIRST):
9
+ Use when the plan contains multiple independent units and the current harness exposes a suitable subagent lifecycle.
11
10
 
12
- - 🛑 NEVER implement code yourself - you are the TEAM LEAD
13
- - 🛑 NEVER use Edit, Write tools for implementation
14
- - ✅ ALWAYS delegate implementation to teammates
15
- - ✅ ALWAYS use delegate mode (Shift+Tab) to stay coordination-only
16
- - ✅ ALWAYS keep the team alive after tasks complete
17
- - 📋 YOU ARE A COORDINATOR, not an implementer
18
- - 💬 FOCUS on assigning tasks, monitoring progress, resolving blockers
19
- - 🚫 FORBIDDEN to write any implementation code
11
+ ## Coordinator responsibilities
20
12
 
21
- ## EXECUTION PROTOCOLS:
13
+ The coordinator owns:
22
14
 
23
- - 🎯 Create team, assign tasks, monitor completion
24
- - 💾 Log progress to output (if save_mode)
25
- - 📖 Each teammate gets full task context
26
- - 🚫 FORBIDDEN to implement anything yourself
15
+ - the task graph and all re-planning;
16
+ - assignment and write-boundary exclusivity;
17
+ - dependency and resource scheduling;
18
+ - inspection of returned diffs and artifacts;
19
+ - integration, conflict resolution, evidence acceptance, and completion.
27
20
 
28
- ## CONTEXT BOUNDARIES:
21
+ Workers own only their assigned packet. They do not approve plan changes or finish the APEX run.
29
22
 
30
- - Task breakdown from step-02b is available
31
- - TaskList has all tasks with dependencies
32
- - You have the plan from step-02
33
- - Implementation has NOT started
34
- - **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.
23
+ ## 1. Capability preflight
35
24
 
36
- ## YOUR TASK:
25
+ Discover the actual spawn, message, status, wait, and shutdown operations available. Use their documented schemas. If coordinated agents are unavailable, return to `step-03-execute.md` without degrading the task contract.
37
26
 
38
- Coordinate a team of Claude Code agents to implement all tasks in parallel, acting purely as team lead.
27
+ ## 2. Schedule from the graph
39
28
 
40
- ---
41
-
42
- <available_state>
43
- From previous steps:
44
-
45
- | Variable | Description |
46
- |----------|-------------|
47
- | `{task_description}` | What to implement |
48
- | `{task_id}` | Kebab-case identifier |
49
- | `{auto_mode}` | Skip confirmations |
50
- | `{save_mode}` | Save outputs to files |
51
- | `{teams_mode}` | Should be true |
52
- | `{tasks_mode}` | Should be true |
53
- | `{output_dir}` | Path to output (if save_mode) |
54
- | TaskList | All tasks with dependencies from step-02 |
55
- | Task files | Individual task files from step-02b (if save_mode) |
56
- </available_state>
57
-
58
- ---
59
-
60
- ## EXECUTION SEQUENCE:
61
-
62
- ### 1. Initialize Save Output (if save_mode)
63
-
64
- **If `{save_mode}` = true:**
65
-
66
- ```bash
67
- bash {skill_dir}/scripts/update-progress.sh "{task_id}" "03" "execute-teams" "in_progress"
68
- ```
69
-
70
- ### 2. Analyze Tasks for Team Sizing
71
-
72
- Review TaskList and determine team size:
73
-
74
- | Tasks | Teammates | Rationale |
75
- |-------|-----------|-----------|
76
- | 1-2 | 1 | Sequential is fine |
77
- | 3-4 | 2 | Small parallel benefit |
78
- | 5-8 | 3-4 | Good parallelism |
79
- | 9+ | 4-6 | Max parallel benefit |
80
-
81
- <critical>
82
- NEVER create more than 6 teammates. Group related tasks if needed.
83
- Cap at the number of independent task groups, not total tasks.
84
- </critical>
85
-
86
- ### 3. Map Skills to Tasks
87
-
88
- For each task, check if a matching skill should be suggested:
89
-
90
- | Task Type | Suggested Skill |
91
- |-----------|----------------|
92
- | UI/Frontend components | `/frontend-design` |
93
- | API endpoints | - |
94
- | Database/schema | - |
95
- | Tests | - |
96
- | Documentation | - |
97
-
98
- Add `skill_hint` to task assignments when relevant.
99
-
100
- ### 4. Use Existing Team (created in step-02-plan)
101
-
102
- <critical>
103
- IMPORTANT: Claude Code Agent Teams is an EXPERIMENTAL feature.
104
- Ensure CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 is set in settings.json.
105
-
106
- The team "apex-{feature_name}" was ALREADY created in step-02-plan BEFORE the TaskList.
107
- Do NOT call TeamCreate again - it would reset the task list and lose all tasks.
108
- </critical>
109
-
110
- **Spawn teammates as sub-agents with the `implementer` profile/type:**
111
-
112
- <critical>
113
- MANDATORY: Always use the `implementer` sub-agent profile/type for ALL teammates.
114
- The `implementer` agent is the dedicated APEX executor - it knows how to:
115
- - Claim tasks from TaskList via TaskUpdate
116
- - Stay within its assigned file boundaries
117
- - Report via SendMessage (not plain text)
118
- - Handle shutdown requests gracefully
119
- NEVER use `general-purpose` or other agent types.
120
- </critical>
121
-
122
- For each teammate, launch a sub-agent with the harness-equivalent of:
123
- - sub-agent profile/type: `"implementer"` (MANDATORY)
124
- - `team_name`: `"apex-{feature_name}"`
125
- - `name`: `"impl-{group-name}"` (e.g., `impl-backend`, `impl-frontend`)
126
- - `mode`: `"bypassPermissions"`
127
- - `prompt`: Full task context (see template below)
128
-
129
- ### 5. Spawn Teammates with Assignments
130
-
131
- **Spawn template (one teammate sub-agent):**
132
-
133
- ```
134
- Sub-agent:
135
- profile/type: "implementer"
136
- team_name: "apex-{feature_name}"
137
- name: "impl-{group-name}"
138
- mode: "bypassPermissions"
139
- prompt: |
140
- You are impl-{group-name} in team apex-{feature_name}.
141
-
142
- ## Your Assignment
143
-
144
- **Task:** {task-id} - {task-title}
145
-
146
- ### Objective
147
- {objective from task file}
148
-
149
- ### Plan
150
- {implementation steps from task file}
29
+ Choose concurrency from:
151
30
 
152
- ### Files to Modify (YOUR boundary - only touch these)
153
- {file list from task file}
31
+ - dependency readiness;
32
+ - overlapping read/write boundaries;
33
+ - shared generated files and Git index access;
34
+ - exclusive services, devices, ports, accounts, or fixtures;
35
+ - expected context-transfer and integration cost;
36
+ - current budget policy.
154
37
 
155
- ### Acceptance Criteria
156
- {criteria from task file}
38
+ Task count alone is not a sizing signal. Prefer a small number of high-value workers. Run mutating assignments sequentially whenever the harness cannot guarantee safe coordination of disjoint boundaries in the shared checkout.
157
39
 
158
- ### Patterns to Follow
159
- {relevant patterns from step-01 analysis}
40
+ ## 3. Send bounded packets
160
41
 
161
- ### Skill Hint
162
- {skill to invoke, if applicable - e.g., "Use /frontend-design for UI components"}
163
-
164
- ### Dependencies
165
- {list of completed dependencies and their outputs}
166
-
167
- IMPORTANT: Check TaskList, claim your task, implement, then report via SendMessage.
168
- ```
169
-
170
- **Spawn rules:**
171
- - Spawn all INDEPENDENT teammates in PARALLEL (single message, multiple sub-agent launches)
172
- - Each teammate gets ALL context (they can't see your conversation)
173
- - Use `mode: "bypassPermissions"` to avoid permission prompt interruptions
174
- - As tasks with dependencies complete, spawn teammates for dependent tasks
175
- - 2-4 teammates for most tasks - more adds overhead, not speed
176
-
177
- ### 6. Monitor Progress
178
-
179
- **While tasks are running:**
180
-
181
- Messages from teammates arrive AUTOMATICALLY - no need to poll or check periodically.
182
-
183
- 1. Wait for teammate messages (completion reports or blocker reports)
184
- 2. If a teammate reports a blocker:
185
- - Analyze the blocker
186
- - Send guidance via SendMessage
187
- - If blocker requires another task's output, check TaskList for its status
188
- 3. If a teammate reports completion, verify via TaskList that the task is marked `completed`
189
- (The `implementer` agent marks its own tasks complete - you don't need to do it)
190
- 4. As tasks complete, spawn teammates for newly-unblocked dependent tasks
191
-
192
- ### 7. Handle Completion
193
-
194
- **When ALL tasks are complete:**
195
-
196
- <critical>
197
- NEVER clean up or dismiss the team here.
198
- The team MUST stay alive through validation (step-04), examine (step-05), resolve (step-06), and finish (step-09).
199
- Team shutdown happens ONLY in step-09-finish.md - the very last step of the APEX workflow.
200
- </critical>
201
-
202
- **If `{auto_mode}` = true:**
203
- → Proceed directly to step-04-validate.md
204
-
205
- **If `{auto_mode}` = false:**
206
-
207
- ```yaml
208
- questions:
209
- - header: "Team Status"
210
- question: "All tasks complete. What would you like to do?"
211
- options:
212
- - label: "Proceed to validation (Recommended)"
213
- description: "Run typecheck, lint, and verify acceptance criteria"
214
- - label: "Assign additional tasks"
215
- description: "Give more work to the team"
216
- - label: "Message a teammate"
217
- description: "Send follow-up instructions to a specific teammate"
218
- multiSelect: false
219
- ```
220
-
221
- ### 8. Complete Save Output (if save_mode)
222
-
223
- **If `{save_mode}` = true:**
224
-
225
- Append to `{output_dir}/03-execute.md`:
42
+ Each worker receives:
226
43
 
227
44
  ```markdown
228
- ## Execution Mode: Agent Teams
229
-
230
- **Team size:** {count} teammates
231
- **Tasks completed:** {count}/{total}
232
-
233
- ### Task Results
234
- | Task | Teammate | Status | Files Changed |
235
- |------|----------|--------|---------------|
236
- | task-01 | impl-backend | ✓ | file1.ts, file2.ts |
237
- | task-02 | impl-frontend | ✓ | file3.ts |
238
-
239
- **Team Status:** Active (kept alive for follow-up)
240
-
241
- ---
242
-
243
- ## Step Complete
244
-
245
- **Status:** ✓ Complete
246
- **Next:** step-04-validate.md
247
- **Timestamp:** {ISO timestamp}
248
- ```
249
-
250
- ```bash
251
- bash {skill_dir}/scripts/update-progress.sh "{task_id}" "03" "execute-teams" "complete"
45
+ Objective:
46
+ Non-goals:
47
+ Dependencies and artifacts:
48
+ Allowed paths:
49
+ Forbidden scope:
50
+ Relevant project rules:
51
+ Expected output:
52
+ Validation and evidence:
53
+ Stop condition:
252
54
  ```
253
55
 
254
- ---
56
+ Use a role appropriate to the unit when the harness provides one. Let local policy or the harness select the model unless the task has an evidence-backed need for a different route.
255
57
 
256
- ## SUCCESS METRICS:
58
+ ## 4. Keep local progress moving
257
59
 
258
- ✅ All tasks assigned to teammates
259
- ✅ All tasks completed successfully
260
- ✅ TaskList updated with completion status
261
- ✅ Team kept alive (NOT cleaned up)
262
- ✅ NO implementation code written by team lead
263
- ✅ Output saved (if save_mode)
60
+ After dispatching non-blocking sidecars, continue useful non-overlapping critical-path work. Wait only when a returned result is required for the next action. Do not duplicate delegated investigations or edits.
264
61
 
265
- ## FAILURE MODES:
62
+ ## 5. Inspect every return
266
63
 
267
- ❌ Team lead writing implementation code
268
- ❌ Cleaning up or dismissing the team
269
- ❌ **CRITICAL**: Calling TeamCreate again (team already exists from step-02-plan - re-creating resets TaskList!)
270
- ❌ Using any agent type other than `implementer` for teammates
271
- ❌ Not providing enough context to teammates
272
- ❌ Assigning tasks with unmet dependencies
273
- ❌ Not monitoring for blockers
64
+ For each result:
274
65
 
275
- ## BEST PRACTICES:
276
-
277
- - Give each teammate ALL context they need (they can't see your conversation)
278
- - Avoid assigning tasks that modify the same files to different teammates
279
- - Size tasks appropriately - not too large, not too small
280
- - Monitor actively and resolve blockers quickly
281
-
282
- ---
66
+ 1. Verify the reported files against the declared boundary.
67
+ 2. Inspect the actual diff and repository state.
68
+ 3. Re-run or validate decisive evidence.
69
+ 4. Reject noise, unrelated changes, and unsupported claims.
70
+ 5. Record completion, rework, or a re-plan event.
283
71
 
284
- ## NEXT STEP:
72
+ If a worker crosses scope, preserve user work, isolate the relevant diff logically, and reassign or repair only after understanding the overlap.
285
73
 
286
- After all tasks complete, load `./step-04-validate.md`
74
+ ## 6. Finish coordination
287
75
 
288
- <critical>
289
- Remember:
290
- - You are the TEAM LEAD - NEVER implement code yourself
291
- - ALWAYS use the `implementer` sub-agent profile/type when spawning teammates
292
- - Keep the team ALIVE - shutdown happens ONLY in step-09-finish.md
293
- - NEVER send shutdown_request to teammates in this step
294
- - Each teammate needs FULL context (plan, patterns, file references)
295
- - The `implementer` agent handles TaskList claiming, SendMessage reporting, and file boundaries automatically
296
- </critical>
76
+ Close workers when their task and any follow-up are complete. The coordinator then performs one integrated diff review and proceeds to `step-04-validate.md`.