claude-code-workflow 7.2.23 → 7.2.25

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 (212) hide show
  1. package/.ccw/workflows/cli-tools-usage.md +123 -521
  2. package/.claude/skills/brainstorm/SKILL.md +408 -408
  3. package/.claude/skills/review-cycle/SKILL.md +132 -132
  4. package/.claude/skills/spec-generator/SKILL.md +1 -1
  5. package/.claude/skills/team-designer/phases/02-scaffold-generation.md +1 -1
  6. package/.claude/skills/team-lifecycle-v4/SKILL.md +1 -1
  7. package/.claude/skills/team-review/SKILL.md +1 -1
  8. package/.claude/skills/team-ultra-analyze/SKILL.md +1 -1
  9. package/.claude/skills/workflow-multi-cli-plan/SKILL.md +1 -1
  10. package/.claude/skills/workflow-plan/SKILL.md +1 -1
  11. package/.claude/skills/workflow-test-fix/SKILL.md +1 -1
  12. package/.codex/skills/analyze-with-file/SKILL.md +966 -966
  13. package/.codex/skills/issue-discover/SKILL.md +361 -361
  14. package/.codex/skills/review-cycle/SKILL.md +1 -1
  15. package/.codex/skills/roadmap-with-file/SKILL.md +901 -901
  16. package/.codex/skills/spec-generator/SKILL.md +425 -425
  17. package/.codex/skills/spec-setup/SKILL.md +669 -669
  18. package/.codex/skills/team-arch-opt/SKILL.md +242 -175
  19. package/.codex/skills/team-arch-opt/roles/analyzer/role.md +78 -78
  20. package/.codex/skills/team-arch-opt/roles/coordinator/commands/analyze.md +57 -57
  21. package/.codex/skills/team-arch-opt/roles/coordinator/commands/monitor.md +246 -204
  22. package/.codex/skills/team-arch-opt/roles/coordinator/role.md +196 -184
  23. package/.codex/skills/team-arch-opt/roles/designer/role.md +115 -115
  24. package/.codex/skills/team-arch-opt/roles/refactorer/role.md +102 -102
  25. package/.codex/skills/team-arch-opt/roles/reviewer/role.md +111 -111
  26. package/.codex/skills/team-arch-opt/roles/validator/role.md +115 -115
  27. package/.codex/skills/team-arch-opt/specs/pipelines.md +102 -102
  28. package/.codex/skills/team-brainstorm/SKILL.md +72 -4
  29. package/.codex/skills/team-brainstorm/roles/challenger/role.md +61 -61
  30. package/.codex/skills/team-brainstorm/roles/coordinator/commands/analyze.md +58 -58
  31. package/.codex/skills/team-brainstorm/roles/coordinator/commands/monitor.md +212 -171
  32. package/.codex/skills/team-brainstorm/roles/coordinator/role.md +172 -160
  33. package/.codex/skills/team-brainstorm/roles/evaluator/role.md +56 -56
  34. package/.codex/skills/team-brainstorm/roles/ideator/role.md +69 -69
  35. package/.codex/skills/team-brainstorm/roles/synthesizer/role.md +57 -57
  36. package/.codex/skills/team-brainstorm/specs/pipelines.md +72 -72
  37. package/.codex/skills/team-coordinate/SKILL.md +71 -3
  38. package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +45 -5
  39. package/.codex/skills/team-coordinate/roles/coordinator/role.md +402 -389
  40. package/.codex/skills/team-coordinate/specs/knowledge-transfer.md +111 -111
  41. package/.codex/skills/team-coordinate/specs/pipelines.md +97 -97
  42. package/.codex/skills/team-coordinate/specs/quality-gates.md +112 -112
  43. package/.codex/skills/team-designer/SKILL.md +153 -153
  44. package/.codex/skills/team-designer/phases/01-requirements-analysis.md +250 -250
  45. package/.codex/skills/team-designer/phases/02-scaffold-generation.md +228 -228
  46. package/.codex/skills/team-designer/phases/03-content-generation.md +330 -330
  47. package/.codex/skills/team-designer/phases/04-validation.md +320 -320
  48. package/.codex/skills/team-executor/SKILL.md +29 -2
  49. package/.codex/skills/team-executor/roles/executor/commands/monitor.md +23 -15
  50. package/.codex/skills/team-frontend/SKILL.md +77 -3
  51. package/.codex/skills/team-frontend/roles/analyst/role.md +92 -92
  52. package/.codex/skills/team-frontend/roles/architect/role.md +86 -86
  53. package/.codex/skills/team-frontend/roles/coordinator/commands/analyze.md +52 -52
  54. package/.codex/skills/team-frontend/roles/coordinator/commands/monitor.md +222 -188
  55. package/.codex/skills/team-frontend/roles/coordinator/role.md +189 -177
  56. package/.codex/skills/team-frontend/roles/developer/role.md +93 -93
  57. package/.codex/skills/team-frontend/roles/qa/role.md +79 -79
  58. package/.codex/skills/team-frontend/specs/pipelines.md +76 -76
  59. package/.codex/skills/team-frontend-debug/SKILL.md +66 -3
  60. package/.codex/skills/team-frontend-debug/roles/analyzer/role.md +208 -208
  61. package/.codex/skills/team-frontend-debug/roles/coordinator/commands/analyze.md +174 -174
  62. package/.codex/skills/team-frontend-debug/roles/coordinator/commands/dispatch.md +198 -198
  63. package/.codex/skills/team-frontend-debug/roles/coordinator/commands/monitor.md +177 -143
  64. package/.codex/skills/team-frontend-debug/roles/coordinator/role.md +164 -152
  65. package/.codex/skills/team-frontend-debug/roles/fixer/role.md +147 -147
  66. package/.codex/skills/team-frontend-debug/roles/reproducer/role.md +147 -147
  67. package/.codex/skills/team-frontend-debug/roles/tester/role.md +231 -231
  68. package/.codex/skills/team-frontend-debug/roles/verifier/role.md +172 -172
  69. package/.codex/skills/team-frontend-debug/specs/debug-tools.md +215 -215
  70. package/.codex/skills/team-frontend-debug/specs/pipelines.md +94 -94
  71. package/.codex/skills/team-issue/SKILL.md +83 -4
  72. package/.codex/skills/team-issue/roles/coordinator/commands/analyze.md +64 -64
  73. package/.codex/skills/team-issue/roles/coordinator/commands/dispatch.md +273 -273
  74. package/.codex/skills/team-issue/roles/coordinator/commands/monitor.md +235 -194
  75. package/.codex/skills/team-issue/roles/coordinator/role.md +206 -194
  76. package/.codex/skills/team-issue/roles/explorer/role.md +94 -94
  77. package/.codex/skills/team-issue/roles/implementer/role.md +87 -87
  78. package/.codex/skills/team-issue/roles/integrator/role.md +84 -84
  79. package/.codex/skills/team-issue/roles/planner/role.md +81 -81
  80. package/.codex/skills/team-issue/roles/reviewer/role.md +86 -86
  81. package/.codex/skills/team-issue/specs/pipelines.md +124 -124
  82. package/.codex/skills/team-lifecycle-v4/MIGRATION-PLAN.md +6 -6
  83. package/.codex/skills/team-lifecycle-v4/SKILL.md +305 -242
  84. package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +1 -1
  85. package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +66 -24
  86. package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +13 -1
  87. package/.codex/skills/team-lifecycle-v4/roles/supervisor/role.md +1 -1
  88. package/.codex/skills/team-lifecycle-v4/templates/architecture.md +254 -254
  89. package/.codex/skills/team-lifecycle-v4/templates/epics.md +196 -196
  90. package/.codex/skills/team-lifecycle-v4/templates/product-brief.md +133 -133
  91. package/.codex/skills/team-lifecycle-v4/templates/requirements.md +224 -224
  92. package/.codex/skills/team-perf-opt/SKILL.md +68 -3
  93. package/.codex/skills/team-perf-opt/roles/benchmarker/role.md +89 -89
  94. package/.codex/skills/team-perf-opt/roles/coordinator/commands/analyze.md +61 -61
  95. package/.codex/skills/team-perf-opt/roles/coordinator/commands/monitor.md +35 -1
  96. package/.codex/skills/team-perf-opt/roles/coordinator/role.md +179 -167
  97. package/.codex/skills/team-perf-opt/roles/optimizer/role.md +97 -97
  98. package/.codex/skills/team-perf-opt/roles/profiler/role.md +73 -73
  99. package/.codex/skills/team-perf-opt/roles/reviewer/role.md +75 -75
  100. package/.codex/skills/team-perf-opt/roles/strategist/role.md +94 -94
  101. package/.codex/skills/team-perf-opt/specs/pipelines.md +65 -65
  102. package/.codex/skills/team-planex/SKILL.md +65 -3
  103. package/.codex/skills/team-planex/roles/coordinator/commands/analyze.md +52 -52
  104. package/.codex/skills/team-planex/roles/coordinator/commands/monitor.md +210 -164
  105. package/.codex/skills/team-planex/roles/coordinator/role.md +171 -159
  106. package/.codex/skills/team-planex/roles/executor/role.md +91 -91
  107. package/.codex/skills/team-planex/roles/planner/role.md +112 -112
  108. package/.codex/skills/team-planex/specs/pipelines.md +93 -93
  109. package/.codex/skills/team-quality-assurance/SKILL.md +60 -3
  110. package/.codex/skills/team-quality-assurance/roles/analyst/role.md +80 -80
  111. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +72 -72
  112. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +108 -108
  113. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +243 -209
  114. package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +176 -164
  115. package/.codex/skills/team-quality-assurance/roles/executor/role.md +66 -66
  116. package/.codex/skills/team-quality-assurance/roles/generator/role.md +68 -68
  117. package/.codex/skills/team-quality-assurance/roles/scout/role.md +67 -67
  118. package/.codex/skills/team-quality-assurance/roles/strategist/role.md +71 -71
  119. package/.codex/skills/team-quality-assurance/specs/pipelines.md +115 -115
  120. package/.codex/skills/team-review/SKILL.md +58 -3
  121. package/.codex/skills/team-review/roles/coordinator/commands/analyze.md +71 -71
  122. package/.codex/skills/team-review/roles/coordinator/commands/dispatch.md +90 -90
  123. package/.codex/skills/team-review/roles/coordinator/commands/monitor.md +225 -185
  124. package/.codex/skills/team-review/roles/coordinator/role.md +175 -163
  125. package/.codex/skills/team-review/roles/fixer/role.md +76 -76
  126. package/.codex/skills/team-review/roles/reviewer/role.md +68 -68
  127. package/.codex/skills/team-review/roles/scanner/role.md +71 -71
  128. package/.codex/skills/team-review/specs/pipelines.md +102 -102
  129. package/.codex/skills/team-roadmap-dev/SKILL.md +55 -3
  130. package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/analyze.md +61 -61
  131. package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/monitor.md +502 -468
  132. package/.codex/skills/team-roadmap-dev/roles/coordinator/role.md +335 -322
  133. package/.codex/skills/team-roadmap-dev/roles/executor/role.md +71 -71
  134. package/.codex/skills/team-roadmap-dev/roles/planner/role.md +76 -76
  135. package/.codex/skills/team-roadmap-dev/roles/verifier/role.md +74 -74
  136. package/.codex/skills/team-roadmap-dev/specs/pipelines.md +93 -93
  137. package/.codex/skills/team-tech-debt/SKILL.md +56 -3
  138. package/.codex/skills/team-tech-debt/roles/assessor/role.md +69 -69
  139. package/.codex/skills/team-tech-debt/roles/coordinator/commands/analyze.md +47 -47
  140. package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +272 -231
  141. package/.codex/skills/team-tech-debt/roles/coordinator/role.md +172 -160
  142. package/.codex/skills/team-tech-debt/roles/executor/role.md +76 -76
  143. package/.codex/skills/team-tech-debt/roles/planner/role.md +69 -69
  144. package/.codex/skills/team-tech-debt/roles/scanner/role.md +82 -82
  145. package/.codex/skills/team-tech-debt/roles/validator/role.md +75 -75
  146. package/.codex/skills/team-tech-debt/specs/pipelines.md +47 -47
  147. package/.codex/skills/team-testing/SKILL.md +72 -3
  148. package/.codex/skills/team-testing/roles/analyst/role.md +95 -95
  149. package/.codex/skills/team-testing/roles/coordinator/commands/analyze.md +70 -70
  150. package/.codex/skills/team-testing/roles/coordinator/commands/dispatch.md +106 -106
  151. package/.codex/skills/team-testing/roles/coordinator/commands/monitor.md +283 -242
  152. package/.codex/skills/team-testing/roles/coordinator/role.md +184 -172
  153. package/.codex/skills/team-testing/roles/executor/role.md +96 -96
  154. package/.codex/skills/team-testing/roles/generator/role.md +95 -95
  155. package/.codex/skills/team-testing/roles/strategist/role.md +83 -83
  156. package/.codex/skills/team-testing/specs/pipelines.md +101 -101
  157. package/.codex/skills/team-uidesign/SKILL.md +65 -3
  158. package/.codex/skills/team-uidesign/roles/coordinator/commands/analyze.md +59 -59
  159. package/.codex/skills/team-uidesign/roles/coordinator/commands/dispatch.md +156 -156
  160. package/.codex/skills/team-uidesign/roles/coordinator/commands/monitor.md +234 -194
  161. package/.codex/skills/team-uidesign/roles/coordinator/role.md +211 -199
  162. package/.codex/skills/team-uidesign/roles/designer/role.md +69 -69
  163. package/.codex/skills/team-uidesign/roles/implementer/role.md +72 -72
  164. package/.codex/skills/team-uidesign/roles/researcher/role.md +82 -82
  165. package/.codex/skills/team-uidesign/roles/reviewer/role.md +67 -67
  166. package/.codex/skills/team-uidesign/specs/pipelines.md +76 -76
  167. package/.codex/skills/team-ultra-analyze/SKILL.md +73 -3
  168. package/.codex/skills/team-ultra-analyze/roles/analyst/role.md +90 -90
  169. package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/analyze.md +73 -73
  170. package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +50 -9
  171. package/.codex/skills/team-ultra-analyze/roles/coordinator/role.md +255 -243
  172. package/.codex/skills/team-ultra-analyze/roles/discussant/role.md +104 -104
  173. package/.codex/skills/team-ultra-analyze/roles/explorer/role.md +74 -74
  174. package/.codex/skills/team-ultra-analyze/roles/synthesizer/role.md +78 -78
  175. package/.codex/skills/team-ultra-analyze/specs/pipelines.md +64 -64
  176. package/.codex/skills/team-ux-improve/SKILL.md +64 -3
  177. package/.codex/skills/team-ux-improve/roles/coordinator/commands/analyze.md +62 -62
  178. package/.codex/skills/team-ux-improve/roles/coordinator/commands/dispatch.md +233 -233
  179. package/.codex/skills/team-ux-improve/roles/coordinator/commands/monitor.md +195 -160
  180. package/.codex/skills/team-ux-improve/roles/coordinator/role.md +170 -158
  181. package/.codex/skills/team-ux-improve/roles/designer/role.md +122 -122
  182. package/.codex/skills/team-ux-improve/roles/diagnoser/role.md +93 -93
  183. package/.codex/skills/team-ux-improve/roles/explorer/role.md +77 -77
  184. package/.codex/skills/team-ux-improve/roles/implementer/role.md +102 -102
  185. package/.codex/skills/team-ux-improve/roles/scanner/role.md +93 -93
  186. package/.codex/skills/team-ux-improve/roles/tester/role.md +84 -84
  187. package/.codex/skills/team-ux-improve/specs/pipelines.md +54 -54
  188. package/.codex/skills/workflow-test-fix-cycle/SKILL.md +402 -402
  189. package/README.md +1 -0
  190. package/package.json +1 -1
  191. package/.claude/skills/team-iterdev/SKILL.md +0 -127
  192. package/.claude/skills/team-iterdev/roles/architect/role.md +0 -65
  193. package/.claude/skills/team-iterdev/roles/coordinator/commands/analyze.md +0 -62
  194. package/.claude/skills/team-iterdev/roles/coordinator/commands/dispatch.md +0 -234
  195. package/.claude/skills/team-iterdev/roles/coordinator/commands/monitor.md +0 -182
  196. package/.claude/skills/team-iterdev/roles/coordinator/role.md +0 -153
  197. package/.claude/skills/team-iterdev/roles/developer/role.md +0 -74
  198. package/.claude/skills/team-iterdev/roles/reviewer/role.md +0 -66
  199. package/.claude/skills/team-iterdev/roles/tester/role.md +0 -88
  200. package/.claude/skills/team-iterdev/specs/pipelines.md +0 -94
  201. package/.claude/skills/team-iterdev/specs/team-config.json +0 -172
  202. package/.codex/skills/team-iterdev/SKILL.md +0 -158
  203. package/.codex/skills/team-iterdev/roles/architect/role.md +0 -65
  204. package/.codex/skills/team-iterdev/roles/coordinator/commands/analyze.md +0 -62
  205. package/.codex/skills/team-iterdev/roles/coordinator/commands/dispatch.md +0 -187
  206. package/.codex/skills/team-iterdev/roles/coordinator/commands/monitor.md +0 -186
  207. package/.codex/skills/team-iterdev/roles/coordinator/role.md +0 -181
  208. package/.codex/skills/team-iterdev/roles/developer/role.md +0 -74
  209. package/.codex/skills/team-iterdev/roles/reviewer/role.md +0 -66
  210. package/.codex/skills/team-iterdev/roles/tester/role.md +0 -88
  211. package/.codex/skills/team-iterdev/specs/pipelines.md +0 -94
  212. package/.codex/skills/team-iterdev/specs/team-config.json +0 -172
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: team-planex
3
3
  description: Unified team skill for plan-and-execute pipeline. Pure router — coordinator always. Beat model is coordinator-only in monitor.md. Triggers on "team planex".
4
- allowed-tools: spawn_agent(*), wait_agent(*), send_input(*), close_agent(*), report_agent_job_result(*), request_user_input(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*), mcp__ccw-tools__team_msg(*)
4
+ allowed-tools: spawn_agent(*), wait_agent(*), send_message(*), assign_task(*), close_agent(*), list_agents(*), report_agent_job_result(*), request_user_input(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*), mcp__ccw-tools__team_msg(*)
5
5
  ---
6
6
 
7
7
  # Team PlanEx
@@ -53,7 +53,8 @@ Before calling ANY tool, apply this check:
53
53
 
54
54
  | Tool Call | Verdict | Reason |
55
55
  |-----------|---------|--------|
56
- | `spawn_agent`, `wait_agent`, `close_agent`, `send_input` | ALLOWED | Orchestration |
56
+ | `spawn_agent`, `wait_agent`, `close_agent`, `send_message`, `assign_task` | ALLOWED | Orchestration |
57
+ | `list_agents` | ALLOWED | Agent health check |
57
58
  | `request_user_input` | ALLOWED | User interaction |
58
59
  | `mcp__ccw-tools__team_msg` | ALLOWED | Message bus |
59
60
  | `Read/Write` on `.workflow/.team/` files | ALLOWED | Session state |
@@ -83,6 +84,8 @@ Coordinator spawns workers using this template:
83
84
  ```
84
85
  spawn_agent({
85
86
  agent_type: "team_worker",
87
+ task_name: "<task-id>",
88
+ fork_context: false,
86
89
  items: [
87
90
  { type: "text", text: `## Role Assignment
88
91
  role: <role>
@@ -107,7 +110,27 @@ pipeline_phase: <pipeline-phase>` },
107
110
  })
108
111
  ```
109
112
 
110
- After spawning, use `wait_agent({ ids: [...], timeout_ms: 900000 })` to collect results, then `close_agent({ id })` each worker.
113
+ After spawning, use `wait_agent({ targets: [...], timeout_ms: 900000 })` to collect results, then `close_agent({ target })` each worker.
114
+
115
+
116
+ ### Model Selection Guide
117
+
118
+ | Role | model | reasoning_effort | Rationale |
119
+ |------|-------|-------------------|-----------|
120
+ | Planner (PLAN-*) | (default) | high | Solution planning requires deep code analysis |
121
+ | Executor (EXEC-*) | (default) | high | Code implementation needs precision |
122
+
123
+ Override model/reasoning_effort in spawn_agent when cost optimization is needed:
124
+ ```
125
+ spawn_agent({
126
+ agent_type: "team_worker",
127
+ task_name: "<task-id>",
128
+ fork_context: false,
129
+ model: "<model-override>",
130
+ reasoning_effort: "<effort-level>",
131
+ items: [...]
132
+ })
133
+ ```
111
134
 
112
135
  ## User Commands
113
136
 
@@ -140,6 +163,45 @@ After spawning, use `wait_agent({ ids: [...], timeout_ms: 900000 })` to collect
140
163
 
141
164
  - [specs/pipelines.md](specs/pipelines.md) — Pipeline definitions, task metadata registry, execution method selection
142
165
 
166
+ ## v4 Agent Coordination
167
+
168
+ ### Message Semantics
169
+
170
+ | Intent | API | Example |
171
+ |--------|-----|---------|
172
+ | Send plan updates to running executor | `send_message` | Queue planner solution details to EXEC-* workers |
173
+ | Not used in this skill | `assign_task` | No resident agents -- planner and executor are one-shot |
174
+ | Check running agents | `list_agents` | Verify planner/executor health during resume |
175
+
176
+ ### Two-Phase Pipeline Pattern
177
+
178
+ Plan-and-execute is a **Two-Phase pattern**: planner creates solution plans (PLAN-*), then coordinator spawns executors (EXEC-*) for each planned issue. The planner may dynamically create EXEC-* task entries in tasks.json.
179
+
180
+ ```
181
+ // Phase 1: Planner runs, creates EXEC-* tasks in tasks.json
182
+ spawn_agent({ agent_type: "team_worker", task_name: "PLAN-001", ... })
183
+ wait_agent({ targets: ["PLAN-001"], timeout_ms: 900000 })
184
+ // Phase 2: Executors run per-issue, may run in sequence or parallel
185
+ // Inner loop: planner/executor handle multiple tasks internally
186
+ ```
187
+
188
+ ### Agent Health Check
189
+
190
+ Use `list_agents({})` in handleResume and handleComplete:
191
+
192
+ ```
193
+ // Reconcile session state with actual running agents
194
+ const running = list_agents({})
195
+ // Compare with tasks.json active_agents
196
+ // Reset orphaned tasks (in_progress but agent gone) to pending
197
+ ```
198
+
199
+ ### Named Agent Targeting
200
+
201
+ Workers are spawned with `task_name: "<task-id>"` enabling direct addressing:
202
+ - `send_message({ target: "EXEC-001", items: [...] })` -- queue plan solution to running executor
203
+ - `close_agent({ target: "PLAN-001" })` -- cleanup by name after completion
204
+
143
205
  ## Error Handling
144
206
 
145
207
  | Scenario | Resolution |
@@ -1,52 +1,52 @@
1
- # Analyze Task
2
-
3
- Parse plan-and-execute input -> detect input type -> determine execution method -> assess scope.
4
-
5
- **CONSTRAINT**: Text-level analysis only. NO source code reading, NO codebase exploration.
6
-
7
- ## Signal Detection
8
-
9
- | Input Pattern | Type | Action |
10
- |--------------|------|--------|
11
- | `ISS-\d{8}-\d{6}` pattern | Issue IDs | Use directly |
12
- | `--text '...'` flag | Text requirement | Create issues via CLI |
13
- | `--plan <path>` flag | Plan file | Read file, parse phases |
14
-
15
- ## Execution Method Selection
16
-
17
- | Condition | Execution Method |
18
- |-----------|-----------------|
19
- | `--exec=codex` specified | Codex |
20
- | `--exec=gemini` specified | Gemini |
21
- | `-y` or `--yes` flag present | Auto (default Gemini) |
22
- | No flags (interactive) | request_user_input -> user choice |
23
- | Auto + task_count <= 3 | Gemini |
24
- | Auto + task_count > 3 | Codex |
25
-
26
- ## Scope Assessment
27
-
28
- | Factor | Complexity |
29
- |--------|------------|
30
- | Issue count 1-3 | Low |
31
- | Issue count 4-10 | Medium |
32
- | Issue count > 10 | High |
33
- | Cross-cutting concern | +1 level |
34
-
35
- ## Output
36
-
37
- Write <session>/task-analysis.json:
38
- ```json
39
- {
40
- "task_description": "<original>",
41
- "input_type": "<issues|text|plan>",
42
- "raw_input": "<original input>",
43
- "execution_method": "<codex|gemini>",
44
- "issue_count_estimate": 0,
45
- "complexity": { "score": 0, "level": "Low|Medium|High" },
46
- "pipeline_type": "plan-execute",
47
- "roles": [
48
- { "name": "planner", "prefix": "PLAN", "inner_loop": true },
49
- { "name": "executor", "prefix": "EXEC", "inner_loop": true }
50
- ]
51
- }
52
- ```
1
+ # Analyze Task
2
+
3
+ Parse plan-and-execute input -> detect input type -> determine execution method -> assess scope.
4
+
5
+ **CONSTRAINT**: Text-level analysis only. NO source code reading, NO codebase exploration.
6
+
7
+ ## Signal Detection
8
+
9
+ | Input Pattern | Type | Action |
10
+ |--------------|------|--------|
11
+ | `ISS-\d{8}-\d{6}` pattern | Issue IDs | Use directly |
12
+ | `--text '...'` flag | Text requirement | Create issues via CLI |
13
+ | `--plan <path>` flag | Plan file | Read file, parse phases |
14
+
15
+ ## Execution Method Selection
16
+
17
+ | Condition | Execution Method |
18
+ |-----------|-----------------|
19
+ | `--exec=codex` specified | Codex |
20
+ | `--exec=gemini` specified | Gemini |
21
+ | `-y` or `--yes` flag present | Auto (default Gemini) |
22
+ | No flags (interactive) | request_user_input -> user choice |
23
+ | Auto + task_count <= 3 | Gemini |
24
+ | Auto + task_count > 3 | Codex |
25
+
26
+ ## Scope Assessment
27
+
28
+ | Factor | Complexity |
29
+ |--------|------------|
30
+ | Issue count 1-3 | Low |
31
+ | Issue count 4-10 | Medium |
32
+ | Issue count > 10 | High |
33
+ | Cross-cutting concern | +1 level |
34
+
35
+ ## Output
36
+
37
+ Write <session>/task-analysis.json:
38
+ ```json
39
+ {
40
+ "task_description": "<original>",
41
+ "input_type": "<issues|text|plan>",
42
+ "raw_input": "<original input>",
43
+ "execution_method": "<codex|gemini>",
44
+ "issue_count_estimate": 0,
45
+ "complexity": { "score": 0, "level": "Low|Medium|High" },
46
+ "pipeline_type": "plan-execute",
47
+ "roles": [
48
+ { "name": "planner", "prefix": "PLAN", "inner_loop": true },
49
+ { "name": "executor", "prefix": "EXEC", "inner_loop": true }
50
+ ]
51
+ }
52
+ ```
@@ -1,164 +1,210 @@
1
- # Command: monitor
2
-
3
- ## Purpose
4
-
5
- Event-driven pipeline coordination with Spawn-and-Stop pattern. Three wake-up sources: worker results, user `check`, user `resume`.
6
-
7
- ## Constants
8
-
9
- | Constant | Value | Description |
10
- |----------|-------|-------------|
11
- | SPAWN_MODE | spawn_agent | All workers spawned via `spawn_agent` |
12
- | ONE_STEP_PER_INVOCATION | true | Coordinator does one operation then STOPS |
13
- | WORKER_AGENT | team_worker | All workers are team_worker agents |
14
-
15
- ## Phase 2: Context Loading
16
-
17
- | Input | Source | Required |
18
- |-------|--------|----------|
19
- | Session file | `<session-folder>/.msg/meta.json` | Yes |
20
- | Task list | Read tasks.json | Yes |
21
- | Active workers | session.active_workers[] | Yes |
22
-
23
- ## Phase 3: Handler Routing
24
-
25
- ### Wake-up Source Detection
26
-
27
- | Priority | Condition | Handler |
28
- |----------|-----------|---------|
29
- | 1 | Message contains `[planner]` or `[executor]` tag | handleCallback |
30
- | 2 | Contains "check" or "status" | handleCheck |
31
- | 3 | Contains "resume", "continue", or "next" | handleResume |
32
- | 4 | None of the above (initial spawn) | handleSpawnNext |
33
-
34
- ---
35
-
36
- ### Handler: handleCallback
37
-
38
- ```
39
- Receive result from wait_agent for [<role>]
40
- +- Match role: planner or executor
41
- +- Progress update (not final)?
42
- | +- YES -> Update session -> STOP
43
- +- Task status = completed?
44
- | +- YES -> remove from active_workers -> update session
45
- | | +- Close agent: close_agent({ id: <agentId> })
46
- | | +- role = planner?
47
- | | | +- Check for new EXEC-* tasks in tasks.json (planner creates them)
48
- | | | +- -> handleSpawnNext (spawn executor for new EXEC-* tasks)
49
- | | +- role = executor?
50
- | | +- Mark issue done
51
- | | +- -> handleSpawnNext (check for more EXEC-* tasks)
52
- | +- NO -> progress message -> STOP
53
- +- No matching worker found
54
- +- Scan all active workers for completed tasks
55
- +- Found completed -> process -> handleSpawnNext
56
- +- None completed -> STOP
57
- ```
58
-
59
- ---
60
-
61
- ### Handler: handleCheck
62
-
63
- Read-only status report. No advancement.
64
-
65
- ```
66
- [coordinator] PlanEx Pipeline Status
67
- [coordinator] Progress: <completed>/<total> (<percent>%)
68
-
69
- [coordinator] Task Graph:
70
- PLAN-001: <status-icon> <summary>
71
- EXEC-001: <status-icon> <issue-title>
72
- EXEC-002: <status-icon> <issue-title>
73
- ...
74
-
75
- done=completed >>>=running o=pending
76
-
77
- [coordinator] Active Workers:
78
- > <subject> (<role>) - running <elapsed>
79
-
80
- [coordinator] Ready to spawn: <subjects>
81
- [coordinator] Commands: 'resume' to advance | 'check' to refresh
82
- ```
83
-
84
- Then STOP.
85
-
86
- ---
87
-
88
- ### Handler: handleResume
89
-
90
- ```
91
- Load active_workers
92
- +- No active workers -> handleSpawnNext
93
- +- Has active workers -> check each:
94
- +- completed -> mark done, log
95
- +- in_progress -> still running
96
- +- other -> worker failure -> reset to pending
97
- After:
98
- +- Some completed -> handleSpawnNext
99
- +- All running -> report status -> STOP
100
- +- All failed -> handleSpawnNext (retry)
101
- ```
102
-
103
- ---
104
-
105
- ### Handler: handleSpawnNext
106
-
107
- ```
108
- Collect task states from tasks.json
109
- +- Filter tasks: PLAN-* and EXEC-* prefixes
110
- +- readySubjects: pending + not blocked (no deps or all deps completed)
111
- +- NONE ready + work in progress -> report waiting -> STOP
112
- +- NONE ready + nothing running -> PIPELINE_COMPLETE -> Phase 5
113
- +- HAS ready tasks -> for each:
114
- +- Inner Loop role AND already has active_worker for that role?
115
- | +- YES -> SKIP spawn (existing worker picks up via inner loop)
116
- | +- NO -> spawn below
117
- +- Determine role from task prefix:
118
- | +- PLAN-* -> planner
119
- | +- EXEC-* -> executor
120
- +- Spawn team_worker:
121
- const agentId = spawn_agent({
122
- agent_type: "team_worker",
123
- items: [{ type: "text", text: `## Role Assignment
124
- role: <role>
125
- role_spec: ~ or <project>/.codex/skills/team-planex/roles/<role>/role.md
126
- session: <session-folder>
127
- session_id: <session-id>
128
- team_name: <team-name>
129
- requirement: <task-description>
130
- inner_loop: true
131
- execution_method: <method>` }]
132
- })
133
- // Collect results:
134
- const result = wait_agent({ ids: [agentId], timeout_ms: 900000 })
135
- // Process result, update tasks.json
136
- close_agent({ id: agentId })
137
- +- Add to session.active_workers
138
- Update session -> output summary -> STOP
139
- ```
140
-
141
- ---
142
-
143
- ## Phase 4: Validation
144
-
145
- | Check | Criteria |
146
- |-------|----------|
147
- | Session state consistent | active_workers matches in_progress tasks |
148
- | No orphaned tasks | Every in_progress has active_worker |
149
- | Pipeline completeness | All expected EXEC-* tasks accounted for |
150
-
151
- ## Worker Failure Handling
152
-
153
- 1. Reset task -> pending in tasks.json
154
- 2. Log via team_msg (type: error)
155
- 3. Report to user
156
-
157
- ## Error Handling
158
-
159
- | Scenario | Resolution |
160
- |----------|------------|
161
- | Session file not found | Error, suggest re-initialization |
162
- | Unknown role callback | Log, scan for other completions |
163
- | All workers running on resume | Report status, suggest check later |
164
- | Pipeline stall (no ready + no running + has pending) | Check deps chains, report |
1
+ # Command: monitor
2
+
3
+ ## Purpose
4
+
5
+ Event-driven pipeline coordination with Spawn-and-Stop pattern. Three wake-up sources: worker results, user `check`, user `resume`.
6
+
7
+ ## Constants
8
+
9
+ | Constant | Value | Description |
10
+ |----------|-------|-------------|
11
+ | SPAWN_MODE | spawn_agent | All workers spawned via `spawn_agent` |
12
+ | ONE_STEP_PER_INVOCATION | true | Coordinator does one operation then STOPS |
13
+ | WORKER_AGENT | team_worker | All workers are team_worker agents |
14
+
15
+ ## Phase 2: Context Loading
16
+
17
+ | Input | Source | Required |
18
+ |-------|--------|----------|
19
+ | Session file | `<session-folder>/.msg/meta.json` | Yes |
20
+ | Task list | Read tasks.json | Yes |
21
+ | Active workers | session.active_workers[] | Yes |
22
+
23
+ ## Phase 3: Handler Routing
24
+
25
+ ### Wake-up Source Detection
26
+
27
+ | Priority | Condition | Handler |
28
+ |----------|-----------|---------|
29
+ | 1 | Message contains `[planner]` or `[executor]` tag | handleCallback |
30
+ | 2 | Contains "check" or "status" | handleCheck |
31
+ | 3 | Contains "resume", "continue", or "next" | handleResume |
32
+ | 4 | None of the above (initial spawn) | handleSpawnNext |
33
+
34
+ ---
35
+
36
+ ### Handler: handleCallback
37
+
38
+ ```
39
+ Receive result from wait_agent for [<role>]
40
+ +- Match role: planner or executor
41
+ +- Progress update (not final)?
42
+ | +- YES -> Update session -> STOP
43
+ +- Task status = completed?
44
+ | +- YES -> remove from active_workers -> update session
45
+ | | +- Close agent: close_agent({ target: <agentId> })
46
+ | | +- role = planner?
47
+ | | | +- Check for new EXEC-* tasks in tasks.json (planner creates them)
48
+ | | | +- -> handleSpawnNext (spawn executor for new EXEC-* tasks)
49
+ | | +- role = executor?
50
+ | | +- Mark issue done
51
+ | | +- -> handleSpawnNext (check for more EXEC-* tasks)
52
+ | +- NO -> progress message -> STOP
53
+ +- No matching worker found
54
+ +- Scan all active workers for completed tasks
55
+ +- Found completed -> process -> handleSpawnNext
56
+ +- None completed -> STOP
57
+ ```
58
+
59
+ ---
60
+
61
+ ### Handler: handleCheck
62
+
63
+ Read-only status report. No advancement.
64
+
65
+ ```
66
+ [coordinator] PlanEx Pipeline Status
67
+ [coordinator] Progress: <completed>/<total> (<percent>%)
68
+
69
+ [coordinator] Task Graph:
70
+ PLAN-001: <status-icon> <summary>
71
+ EXEC-001: <status-icon> <issue-title>
72
+ EXEC-002: <status-icon> <issue-title>
73
+ ...
74
+
75
+ done=completed >>>=running o=pending
76
+
77
+ [coordinator] Active Workers:
78
+ > <subject> (<role>) - running <elapsed>
79
+
80
+ [coordinator] Ready to spawn: <subjects>
81
+ [coordinator] Commands: 'resume' to advance | 'check' to refresh
82
+ ```
83
+
84
+ Then STOP.
85
+
86
+ ---
87
+
88
+ ### Handler: handleResume
89
+
90
+ **Agent Health Check** (v4):
91
+ ```
92
+ // Verify actual running agents match session state
93
+ const runningAgents = list_agents({})
94
+ // For each active_agent in tasks.json:
95
+ // - If agent NOT in runningAgents -> agent crashed
96
+ // - Reset that task to pending, remove from active_agents
97
+ // This prevents stale agent references from blocking the pipeline
98
+ ```
99
+
100
+ ```
101
+ Load active_workers
102
+ +- No active workers -> handleSpawnNext
103
+ +- Has active workers -> check each:
104
+ +- completed -> mark done, log
105
+ +- in_progress -> still running
106
+ +- other -> worker failure -> reset to pending
107
+ After:
108
+ +- Some completed -> handleSpawnNext
109
+ +- All running -> report status -> STOP
110
+ +- All failed -> handleSpawnNext (retry)
111
+ ```
112
+
113
+ ---
114
+
115
+ ### Handler: handleSpawnNext
116
+
117
+ ```
118
+ Collect task states from tasks.json
119
+ +- Filter tasks: PLAN-* and EXEC-* prefixes
120
+ +- readySubjects: pending + not blocked (no deps or all deps completed)
121
+ +- NONE ready + work in progress -> report waiting -> STOP
122
+ +- NONE ready + nothing running -> PIPELINE_COMPLETE -> Phase 5
123
+ +- HAS ready tasks -> for each:
124
+ +- Inner Loop role AND already has active_worker for that role?
125
+ | +- YES -> SKIP spawn (existing worker picks up via inner loop)
126
+ | +- NO -> spawn below
127
+ +- Determine role from task prefix:
128
+ | +- PLAN-* -> planner
129
+ | +- EXEC-* -> executor
130
+ +- Spawn team_worker:
131
+ const agentId = spawn_agent({
132
+ agent_type: "team_worker",
133
+ task_name: taskId, // e.g., "PLAN-001" — enables named targeting
134
+ items: [{ type: "text", text: `## Role Assignment
135
+ role: <role>
136
+ role_spec: ~ or <project>/.codex/skills/team-planex/roles/<role>/role.md
137
+ session: <session-folder>
138
+ session_id: <session-id>
139
+ team_name: <team-name>
140
+ requirement: <task-description>
141
+ inner_loop: true
142
+ execution_method: <method>` }]
143
+ })
144
+ // Collect results — use task_name for stable targeting (v4):
145
+ const result = wait_agent({ targets: [taskId], timeout_ms: 900000 })
146
+ if (result.timed_out) {
147
+ state.tasks[taskId].status = 'timed_out'
148
+ close_agent({ target: taskId })
149
+ // Report timeout, STOP
150
+ } else {
151
+ // Process result, update tasks.json
152
+ close_agent({ target: taskId }) // Use task_name, not agentId
153
+ }
154
+ +- Add to session.active_workers
155
+ Update session -> output summary -> STOP
156
+ ```
157
+
158
+ **Cross-Agent Supplementary Context** (v4):
159
+
160
+ When spawning workers in a later pipeline phase, send upstream results as supplementary context to already-running workers:
161
+
162
+ ```
163
+ // Example: Send planning results to running executors
164
+ send_message({
165
+ target: "<running-agent-task-name>",
166
+ items: [{ type: "text", text: `## Supplementary Context\n${upstreamFindings}` }]
167
+ })
168
+ // Note: send_message queues info without interrupting the agent's current work
169
+ ```
170
+
171
+ Use `send_message` (not `assign_task`) for supplementary info that enriches but doesn't redirect the agent's current task.
172
+
173
+ ---
174
+
175
+ ### Pipeline Complete (PIPELINE_COMPLETE -> Phase 5)
176
+
177
+ **Cleanup Verification** (v4):
178
+ ```
179
+ // Verify all agents are properly closed
180
+ const remaining = list_agents({})
181
+ // If any team agents still running -> close_agent each
182
+ // Ensures clean session shutdown
183
+ ```
184
+
185
+ When all tasks are completed (no pending, no in_progress), transition to coordinator Phase 5.
186
+
187
+ ---
188
+
189
+ ## Phase 4: Validation
190
+
191
+ | Check | Criteria |
192
+ |-------|----------|
193
+ | Session state consistent | active_workers matches in_progress tasks |
194
+ | No orphaned tasks | Every in_progress has active_worker |
195
+ | Pipeline completeness | All expected EXEC-* tasks accounted for |
196
+
197
+ ## Worker Failure Handling
198
+
199
+ 1. Reset task -> pending in tasks.json
200
+ 2. Log via team_msg (type: error)
201
+ 3. Report to user
202
+
203
+ ## Error Handling
204
+
205
+ | Scenario | Resolution |
206
+ |----------|------------|
207
+ | Session file not found | Error, suggest re-initialization |
208
+ | Unknown role callback | Log, scan for other completions |
209
+ | All workers running on resume | Report status, suggest check later |
210
+ | Pipeline stall (no ready + no running + has pending) | Check deps chains, report |