claude-code-workflow 7.2.23 → 7.2.24

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 (181) hide show
  1. package/.codex/skills/team-arch-opt/SKILL.md +242 -175
  2. package/.codex/skills/team-arch-opt/roles/analyzer/role.md +78 -78
  3. package/.codex/skills/team-arch-opt/roles/coordinator/commands/analyze.md +57 -57
  4. package/.codex/skills/team-arch-opt/roles/coordinator/commands/monitor.md +246 -204
  5. package/.codex/skills/team-arch-opt/roles/coordinator/role.md +196 -184
  6. package/.codex/skills/team-arch-opt/roles/designer/role.md +115 -115
  7. package/.codex/skills/team-arch-opt/roles/refactorer/role.md +102 -102
  8. package/.codex/skills/team-arch-opt/roles/reviewer/role.md +111 -111
  9. package/.codex/skills/team-arch-opt/roles/validator/role.md +115 -115
  10. package/.codex/skills/team-arch-opt/specs/pipelines.md +102 -102
  11. package/.codex/skills/team-brainstorm/SKILL.md +72 -4
  12. package/.codex/skills/team-brainstorm/roles/challenger/role.md +61 -61
  13. package/.codex/skills/team-brainstorm/roles/coordinator/commands/analyze.md +58 -58
  14. package/.codex/skills/team-brainstorm/roles/coordinator/commands/monitor.md +212 -171
  15. package/.codex/skills/team-brainstorm/roles/coordinator/role.md +172 -160
  16. package/.codex/skills/team-brainstorm/roles/evaluator/role.md +56 -56
  17. package/.codex/skills/team-brainstorm/roles/ideator/role.md +69 -69
  18. package/.codex/skills/team-brainstorm/roles/synthesizer/role.md +57 -57
  19. package/.codex/skills/team-brainstorm/specs/pipelines.md +72 -72
  20. package/.codex/skills/team-coordinate/SKILL.md +71 -3
  21. package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +45 -5
  22. package/.codex/skills/team-coordinate/roles/coordinator/role.md +402 -389
  23. package/.codex/skills/team-coordinate/specs/knowledge-transfer.md +111 -111
  24. package/.codex/skills/team-coordinate/specs/pipelines.md +97 -97
  25. package/.codex/skills/team-coordinate/specs/quality-gates.md +112 -112
  26. package/.codex/skills/team-designer/SKILL.md +153 -153
  27. package/.codex/skills/team-designer/phases/01-requirements-analysis.md +250 -250
  28. package/.codex/skills/team-designer/phases/02-scaffold-generation.md +228 -228
  29. package/.codex/skills/team-designer/phases/03-content-generation.md +330 -330
  30. package/.codex/skills/team-designer/phases/04-validation.md +320 -320
  31. package/.codex/skills/team-executor/SKILL.md +29 -2
  32. package/.codex/skills/team-executor/roles/executor/commands/monitor.md +23 -15
  33. package/.codex/skills/team-frontend/SKILL.md +77 -3
  34. package/.codex/skills/team-frontend/roles/analyst/role.md +92 -92
  35. package/.codex/skills/team-frontend/roles/architect/role.md +86 -86
  36. package/.codex/skills/team-frontend/roles/coordinator/commands/analyze.md +52 -52
  37. package/.codex/skills/team-frontend/roles/coordinator/commands/monitor.md +222 -188
  38. package/.codex/skills/team-frontend/roles/coordinator/role.md +189 -177
  39. package/.codex/skills/team-frontend/roles/developer/role.md +93 -93
  40. package/.codex/skills/team-frontend/roles/qa/role.md +79 -79
  41. package/.codex/skills/team-frontend/specs/pipelines.md +76 -76
  42. package/.codex/skills/team-frontend-debug/SKILL.md +66 -3
  43. package/.codex/skills/team-frontend-debug/roles/analyzer/role.md +208 -208
  44. package/.codex/skills/team-frontend-debug/roles/coordinator/commands/analyze.md +174 -174
  45. package/.codex/skills/team-frontend-debug/roles/coordinator/commands/dispatch.md +198 -198
  46. package/.codex/skills/team-frontend-debug/roles/coordinator/commands/monitor.md +177 -143
  47. package/.codex/skills/team-frontend-debug/roles/coordinator/role.md +164 -152
  48. package/.codex/skills/team-frontend-debug/roles/fixer/role.md +147 -147
  49. package/.codex/skills/team-frontend-debug/roles/reproducer/role.md +147 -147
  50. package/.codex/skills/team-frontend-debug/roles/tester/role.md +231 -231
  51. package/.codex/skills/team-frontend-debug/roles/verifier/role.md +172 -172
  52. package/.codex/skills/team-frontend-debug/specs/debug-tools.md +215 -215
  53. package/.codex/skills/team-frontend-debug/specs/pipelines.md +94 -94
  54. package/.codex/skills/team-issue/SKILL.md +83 -4
  55. package/.codex/skills/team-issue/roles/coordinator/commands/analyze.md +64 -64
  56. package/.codex/skills/team-issue/roles/coordinator/commands/dispatch.md +273 -273
  57. package/.codex/skills/team-issue/roles/coordinator/commands/monitor.md +235 -194
  58. package/.codex/skills/team-issue/roles/coordinator/role.md +206 -194
  59. package/.codex/skills/team-issue/roles/explorer/role.md +94 -94
  60. package/.codex/skills/team-issue/roles/implementer/role.md +87 -87
  61. package/.codex/skills/team-issue/roles/integrator/role.md +84 -84
  62. package/.codex/skills/team-issue/roles/planner/role.md +81 -81
  63. package/.codex/skills/team-issue/roles/reviewer/role.md +86 -86
  64. package/.codex/skills/team-issue/specs/pipelines.md +124 -124
  65. package/.codex/skills/team-iterdev/SKILL.md +64 -3
  66. package/.codex/skills/team-iterdev/roles/architect/role.md +65 -65
  67. package/.codex/skills/team-iterdev/roles/coordinator/commands/analyze.md +62 -62
  68. package/.codex/skills/team-iterdev/roles/coordinator/commands/monitor.md +227 -186
  69. package/.codex/skills/team-iterdev/roles/coordinator/role.md +193 -181
  70. package/.codex/skills/team-iterdev/roles/developer/role.md +74 -74
  71. package/.codex/skills/team-iterdev/roles/reviewer/role.md +66 -66
  72. package/.codex/skills/team-iterdev/roles/tester/role.md +88 -88
  73. package/.codex/skills/team-iterdev/specs/pipelines.md +94 -94
  74. package/.codex/skills/team-lifecycle-v4/MIGRATION-PLAN.md +6 -6
  75. package/.codex/skills/team-lifecycle-v4/SKILL.md +305 -242
  76. package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +1 -1
  77. package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +66 -24
  78. package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +13 -1
  79. package/.codex/skills/team-lifecycle-v4/roles/supervisor/role.md +1 -1
  80. package/.codex/skills/team-lifecycle-v4/templates/architecture.md +254 -254
  81. package/.codex/skills/team-lifecycle-v4/templates/epics.md +196 -196
  82. package/.codex/skills/team-lifecycle-v4/templates/product-brief.md +133 -133
  83. package/.codex/skills/team-lifecycle-v4/templates/requirements.md +224 -224
  84. package/.codex/skills/team-perf-opt/SKILL.md +68 -3
  85. package/.codex/skills/team-perf-opt/roles/benchmarker/role.md +89 -89
  86. package/.codex/skills/team-perf-opt/roles/coordinator/commands/analyze.md +61 -61
  87. package/.codex/skills/team-perf-opt/roles/coordinator/commands/monitor.md +35 -1
  88. package/.codex/skills/team-perf-opt/roles/coordinator/role.md +179 -167
  89. package/.codex/skills/team-perf-opt/roles/optimizer/role.md +97 -97
  90. package/.codex/skills/team-perf-opt/roles/profiler/role.md +73 -73
  91. package/.codex/skills/team-perf-opt/roles/reviewer/role.md +75 -75
  92. package/.codex/skills/team-perf-opt/roles/strategist/role.md +94 -94
  93. package/.codex/skills/team-perf-opt/specs/pipelines.md +65 -65
  94. package/.codex/skills/team-planex/SKILL.md +65 -3
  95. package/.codex/skills/team-planex/roles/coordinator/commands/analyze.md +52 -52
  96. package/.codex/skills/team-planex/roles/coordinator/commands/monitor.md +210 -164
  97. package/.codex/skills/team-planex/roles/coordinator/role.md +171 -159
  98. package/.codex/skills/team-planex/roles/executor/role.md +91 -91
  99. package/.codex/skills/team-planex/roles/planner/role.md +112 -112
  100. package/.codex/skills/team-planex/specs/pipelines.md +93 -93
  101. package/.codex/skills/team-quality-assurance/SKILL.md +60 -3
  102. package/.codex/skills/team-quality-assurance/roles/analyst/role.md +80 -80
  103. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +72 -72
  104. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +108 -108
  105. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +243 -209
  106. package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +176 -164
  107. package/.codex/skills/team-quality-assurance/roles/executor/role.md +66 -66
  108. package/.codex/skills/team-quality-assurance/roles/generator/role.md +68 -68
  109. package/.codex/skills/team-quality-assurance/roles/scout/role.md +67 -67
  110. package/.codex/skills/team-quality-assurance/roles/strategist/role.md +71 -71
  111. package/.codex/skills/team-quality-assurance/specs/pipelines.md +115 -115
  112. package/.codex/skills/team-review/SKILL.md +58 -3
  113. package/.codex/skills/team-review/roles/coordinator/commands/analyze.md +71 -71
  114. package/.codex/skills/team-review/roles/coordinator/commands/dispatch.md +90 -90
  115. package/.codex/skills/team-review/roles/coordinator/commands/monitor.md +225 -185
  116. package/.codex/skills/team-review/roles/coordinator/role.md +175 -163
  117. package/.codex/skills/team-review/roles/fixer/role.md +76 -76
  118. package/.codex/skills/team-review/roles/reviewer/role.md +68 -68
  119. package/.codex/skills/team-review/roles/scanner/role.md +71 -71
  120. package/.codex/skills/team-review/specs/pipelines.md +102 -102
  121. package/.codex/skills/team-roadmap-dev/SKILL.md +55 -3
  122. package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/analyze.md +61 -61
  123. package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/monitor.md +502 -468
  124. package/.codex/skills/team-roadmap-dev/roles/coordinator/role.md +335 -322
  125. package/.codex/skills/team-roadmap-dev/roles/executor/role.md +71 -71
  126. package/.codex/skills/team-roadmap-dev/roles/planner/role.md +76 -76
  127. package/.codex/skills/team-roadmap-dev/roles/verifier/role.md +74 -74
  128. package/.codex/skills/team-roadmap-dev/specs/pipelines.md +93 -93
  129. package/.codex/skills/team-tech-debt/SKILL.md +56 -3
  130. package/.codex/skills/team-tech-debt/roles/assessor/role.md +69 -69
  131. package/.codex/skills/team-tech-debt/roles/coordinator/commands/analyze.md +47 -47
  132. package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +272 -231
  133. package/.codex/skills/team-tech-debt/roles/coordinator/role.md +172 -160
  134. package/.codex/skills/team-tech-debt/roles/executor/role.md +76 -76
  135. package/.codex/skills/team-tech-debt/roles/planner/role.md +69 -69
  136. package/.codex/skills/team-tech-debt/roles/scanner/role.md +82 -82
  137. package/.codex/skills/team-tech-debt/roles/validator/role.md +75 -75
  138. package/.codex/skills/team-tech-debt/specs/pipelines.md +47 -47
  139. package/.codex/skills/team-testing/SKILL.md +72 -3
  140. package/.codex/skills/team-testing/roles/analyst/role.md +95 -95
  141. package/.codex/skills/team-testing/roles/coordinator/commands/analyze.md +70 -70
  142. package/.codex/skills/team-testing/roles/coordinator/commands/dispatch.md +106 -106
  143. package/.codex/skills/team-testing/roles/coordinator/commands/monitor.md +283 -242
  144. package/.codex/skills/team-testing/roles/coordinator/role.md +184 -172
  145. package/.codex/skills/team-testing/roles/executor/role.md +96 -96
  146. package/.codex/skills/team-testing/roles/generator/role.md +95 -95
  147. package/.codex/skills/team-testing/roles/strategist/role.md +83 -83
  148. package/.codex/skills/team-testing/specs/pipelines.md +101 -101
  149. package/.codex/skills/team-uidesign/SKILL.md +65 -3
  150. package/.codex/skills/team-uidesign/roles/coordinator/commands/analyze.md +59 -59
  151. package/.codex/skills/team-uidesign/roles/coordinator/commands/dispatch.md +156 -156
  152. package/.codex/skills/team-uidesign/roles/coordinator/commands/monitor.md +234 -194
  153. package/.codex/skills/team-uidesign/roles/coordinator/role.md +211 -199
  154. package/.codex/skills/team-uidesign/roles/designer/role.md +69 -69
  155. package/.codex/skills/team-uidesign/roles/implementer/role.md +72 -72
  156. package/.codex/skills/team-uidesign/roles/researcher/role.md +82 -82
  157. package/.codex/skills/team-uidesign/roles/reviewer/role.md +67 -67
  158. package/.codex/skills/team-uidesign/specs/pipelines.md +76 -76
  159. package/.codex/skills/team-ultra-analyze/SKILL.md +73 -3
  160. package/.codex/skills/team-ultra-analyze/roles/analyst/role.md +90 -90
  161. package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/analyze.md +73 -73
  162. package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +50 -9
  163. package/.codex/skills/team-ultra-analyze/roles/coordinator/role.md +255 -243
  164. package/.codex/skills/team-ultra-analyze/roles/discussant/role.md +104 -104
  165. package/.codex/skills/team-ultra-analyze/roles/explorer/role.md +74 -74
  166. package/.codex/skills/team-ultra-analyze/roles/synthesizer/role.md +78 -78
  167. package/.codex/skills/team-ultra-analyze/specs/pipelines.md +64 -64
  168. package/.codex/skills/team-ux-improve/SKILL.md +64 -3
  169. package/.codex/skills/team-ux-improve/roles/coordinator/commands/analyze.md +62 -62
  170. package/.codex/skills/team-ux-improve/roles/coordinator/commands/dispatch.md +233 -233
  171. package/.codex/skills/team-ux-improve/roles/coordinator/commands/monitor.md +195 -160
  172. package/.codex/skills/team-ux-improve/roles/coordinator/role.md +170 -158
  173. package/.codex/skills/team-ux-improve/roles/designer/role.md +122 -122
  174. package/.codex/skills/team-ux-improve/roles/diagnoser/role.md +93 -93
  175. package/.codex/skills/team-ux-improve/roles/explorer/role.md +77 -77
  176. package/.codex/skills/team-ux-improve/roles/implementer/role.md +102 -102
  177. package/.codex/skills/team-ux-improve/roles/scanner/role.md +93 -93
  178. package/.codex/skills/team-ux-improve/roles/tester/role.md +84 -84
  179. package/.codex/skills/team-ux-improve/specs/pipelines.md +54 -54
  180. package/README.md +1 -0
  181. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: team-ultra-analyze
3
3
  description: Deep collaborative analysis team skill. All roles route via this SKILL.md. Beat model is coordinator-only (monitor.md). Structure is roles/ + specs/. Triggers on "team ultra-analyze", "team analyze".
4
- allowed-tools: spawn_agent(*), wait_agent(*), send_input(*), close_agent(*), report_agent_job_result(*), request_user_input(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*)
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(*)
5
5
  ---
6
6
 
7
7
  # Team Ultra Analyze
@@ -62,7 +62,8 @@ Before calling ANY tool, apply this check:
62
62
 
63
63
  | Tool Call | Verdict | Reason |
64
64
  |-----------|---------|--------|
65
- | `spawn_agent`, `wait_agent`, `close_agent`, `send_input` | ALLOWED | Orchestration |
65
+ | `spawn_agent`, `wait_agent`, `close_agent`, `send_message`, `assign_task` | ALLOWED | Orchestration |
66
+ | `list_agents` | ALLOWED | Agent health check |
66
67
  | `request_user_input` | ALLOWED | User interaction |
67
68
  | `mcp__ccw-tools__team_msg` | ALLOWED | Message bus |
68
69
  | `Read/Write` on `.workflow/.team/` files | ALLOWED | Session state |
@@ -93,6 +94,8 @@ Coordinator spawns workers using this template:
93
94
  ```
94
95
  spawn_agent({
95
96
  agent_type: "team_worker",
97
+ task_name: "<task-id>",
98
+ fork_context: false,
96
99
  items: [
97
100
  { type: "text", text: `## Role Assignment
98
101
  role: <role>
@@ -116,7 +119,29 @@ pipeline_phase: <pipeline-phase>` },
116
119
  })
117
120
  ```
118
121
 
119
- After spawning, use `wait_agent({ ids: [...], timeout_ms: 900000 })` to collect results, then `close_agent({ id })` each worker.
122
+ After spawning, use `wait_agent({ targets: [...], timeout_ms: 900000 })` to collect results, then `close_agent({ target })` each worker.
123
+
124
+
125
+ ### Model Selection Guide
126
+
127
+ | Role | model | reasoning_effort | Rationale |
128
+ |------|-------|-------------------|-----------|
129
+ | Explorer (EXPLORE-*) | (default) | medium | File reading and pattern scanning, less reasoning needed |
130
+ | Analyst (ANALYZE-*) | (default) | high | Deep analysis requires full reasoning |
131
+ | Discussant (DISCUSS-*) | (default) | high | Synthesis of multiple viewpoints, dialectic reasoning |
132
+ | Synthesizer (SYNTH-*) | (default) | medium | Aggregation and summary over generation |
133
+
134
+ Override model/reasoning_effort in spawn_agent when cost optimization is needed:
135
+ ```
136
+ spawn_agent({
137
+ agent_type: "team_worker",
138
+ task_name: "<task-id>",
139
+ fork_context: false,
140
+ model: "<model-override>",
141
+ reasoning_effort: "<effort-level>",
142
+ items: [...]
143
+ })
144
+ ```
120
145
 
121
146
  ## User Commands
122
147
 
@@ -148,6 +173,51 @@ After spawning, use `wait_agent({ ids: [...], timeout_ms: 900000 })` to collect
148
173
  | +-- issues.md
149
174
  ```
150
175
 
176
+ ## v4 Agent Coordination
177
+
178
+ ### Message Semantics
179
+
180
+ | Intent | API | Example |
181
+ |--------|-----|---------|
182
+ | Send exploration findings to running analysts | `send_message` | Queue upstream context without interrupting ANALYZE-* workers |
183
+ | Not used in this skill | `assign_task` | No resident agents -- all workers are one-shot |
184
+ | Check running agents | `list_agents` | Verify parallel explorer/analyst health during resume |
185
+
186
+ ### Parallel Phase Coordination
187
+
188
+ Standard/Deep modes spawn N parallel agents in EXPLORE and ANALYZE phases. Use batch spawn + wait:
189
+
190
+ ```
191
+ // EXPLORE phase: spawn N explorers in parallel
192
+ const explorerNames = ["EXPLORE-001", "EXPLORE-002", ..., "EXPLORE-00N"]
193
+ for (const name of explorerNames) {
194
+ spawn_agent({ agent_type: "team_worker", task_name: name, ... })
195
+ }
196
+ wait_agent({ targets: explorerNames, timeout_ms: 900000 })
197
+ // Collect all results, then spawn ANALYZE phase
198
+
199
+ // ANALYZE phase: send exploration context to analysts via items (not send_message)
200
+ // since analysts are spawned AFTER explorers complete
201
+ ```
202
+
203
+ ### Agent Health Check
204
+
205
+ Use `list_agents({})` in handleResume and handleComplete:
206
+
207
+ ```
208
+ // Reconcile session state with actual running agents
209
+ const running = list_agents({})
210
+ // Compare with tasks.json active_agents
211
+ // Reset orphaned tasks (in_progress but agent gone) to pending
212
+ // Critical for parallel phases -- multiple agents may crash independently
213
+ ```
214
+
215
+ ### Named Agent Targeting
216
+
217
+ Workers are spawned with `task_name: "<task-id>"` enabling direct addressing:
218
+ - `send_message({ target: "ANALYZE-001", items: [...] })` -- queue supplementary exploration findings
219
+ - `close_agent({ target: "EXPLORE-001" })` -- cleanup by name after wait_agent returns
220
+
151
221
  ## Completion Action
152
222
 
153
223
  When pipeline completes, coordinator presents:
@@ -1,90 +1,90 @@
1
- ---
2
- role: analyst
3
- prefix: ANALYZE
4
- inner_loop: false
5
- additional_prefixes: [ANALYZE-fix]
6
- message_types:
7
- success: analysis_ready
8
- error: error
9
- ---
10
-
11
- # Deep Analyst
12
-
13
- Perform deep multi-perspective analysis on exploration results via CLI tools. Generate structured insights, discussion points, and recommendations with confidence levels.
14
-
15
- ## Phase 2: Context Loading
16
-
17
- | Input | Source | Required |
18
- |-------|--------|----------|
19
- | Task description | From task subject/description | Yes |
20
- | Session path | Extracted from task description | Yes |
21
- | Exploration results | `<session>/explorations/*.json` | Yes |
22
-
23
- 1. Extract session path, topic, perspective, dimensions from task description
24
- 2. Detect direction-fix mode: `type:\s*direction-fix` with `adjusted_focus:\s*(.+)`
25
- 3. Load corresponding exploration results:
26
-
27
- | Condition | Source |
28
- |-----------|--------|
29
- | Direction fix | Read ALL exploration files, merge context |
30
- | Normal ANALYZE-N | Read exploration matching number N |
31
- | Fallback | Read first available exploration file |
32
-
33
- 4. Select CLI tool by perspective:
34
-
35
- | Perspective | CLI Tool | Rule Template |
36
- |-------------|----------|---------------|
37
- | technical | gemini | analysis-analyze-code-patterns |
38
- | architectural | claude | analysis-review-architecture |
39
- | business | codex | analysis-analyze-code-patterns |
40
- | domain_expert | gemini | analysis-analyze-code-patterns |
41
- | direction-fix (any) | gemini | analysis-diagnose-bug-root-cause |
42
-
43
- ## Phase 3: Deep Analysis via CLI
44
-
45
- Build analysis prompt with exploration context:
46
-
47
- ```
48
- PURPOSE: <Normal: "Deep analysis of '<topic>' from <perspective> perspective">
49
- <Fix: "Supplementary analysis with adjusted focus on '<adjusted_focus>'">
50
- Success: Actionable insights with confidence levels and evidence references
51
-
52
- PRIOR EXPLORATION CONTEXT:
53
- - Key files: <top 5-8 files from exploration>
54
- - Patterns found: <top 3-5 patterns>
55
- - Key findings: <top 3-5 findings>
56
-
57
- TASK:
58
- - <perspective-specific analysis tasks>
59
- - Generate structured findings with confidence levels (high/medium/low)
60
- - Identify discussion points requiring user input
61
- - List open questions needing further exploration
62
-
63
- MODE: analysis
64
- CONTEXT: @**/* | Topic: <topic>
65
- EXPECTED: Structured analysis with: key_insights, key_findings, discussion_points, open_questions, recommendations
66
- CONSTRAINTS: Focus on <perspective> perspective | <dimensions>
67
- ```
68
-
69
- Execute: `ccw cli -p "<prompt>" --tool <cli-tool> --mode analysis --rule <rule>`
70
-
71
- ## Phase 4: Result Aggregation
72
-
73
- Write analysis output to `<session>/analyses/analysis-<num>.json`:
74
-
75
- ```json
76
- {
77
- "perspective": "<perspective>",
78
- "dimensions": ["<dim1>", "<dim2>"],
79
- "is_direction_fix": false,
80
- "key_insights": [{"insight": "...", "confidence": "high", "evidence": "file:line"}],
81
- "key_findings": [{"finding": "...", "file_ref": "...", "impact": "..."}],
82
- "discussion_points": ["..."],
83
- "open_questions": ["..."],
84
- "recommendations": [{"action": "...", "rationale": "...", "priority": "high"}],
85
- "_metadata": {"cli_tool": "...", "cli_rule": "...", "perspective": "...", "timestamp": "..."}
86
- }
87
- ```
88
-
89
- Update `<session>/wisdom/.msg/meta.json` under `analyst` namespace:
90
- - Read existing -> merge `{ "analyst": { perspective, insight_count, finding_count, is_direction_fix } }` -> write back
1
+ ---
2
+ role: analyst
3
+ prefix: ANALYZE
4
+ inner_loop: false
5
+ additional_prefixes: [ANALYZE-fix]
6
+ message_types:
7
+ success: analysis_ready
8
+ error: error
9
+ ---
10
+
11
+ # Deep Analyst
12
+
13
+ Perform deep multi-perspective analysis on exploration results via CLI tools. Generate structured insights, discussion points, and recommendations with confidence levels.
14
+
15
+ ## Phase 2: Context Loading
16
+
17
+ | Input | Source | Required |
18
+ |-------|--------|----------|
19
+ | Task description | From task subject/description | Yes |
20
+ | Session path | Extracted from task description | Yes |
21
+ | Exploration results | `<session>/explorations/*.json` | Yes |
22
+
23
+ 1. Extract session path, topic, perspective, dimensions from task description
24
+ 2. Detect direction-fix mode: `type:\s*direction-fix` with `adjusted_focus:\s*(.+)`
25
+ 3. Load corresponding exploration results:
26
+
27
+ | Condition | Source |
28
+ |-----------|--------|
29
+ | Direction fix | Read ALL exploration files, merge context |
30
+ | Normal ANALYZE-N | Read exploration matching number N |
31
+ | Fallback | Read first available exploration file |
32
+
33
+ 4. Select CLI tool by perspective:
34
+
35
+ | Perspective | CLI Tool | Rule Template |
36
+ |-------------|----------|---------------|
37
+ | technical | gemini | analysis-analyze-code-patterns |
38
+ | architectural | claude | analysis-review-architecture |
39
+ | business | codex | analysis-analyze-code-patterns |
40
+ | domain_expert | gemini | analysis-analyze-code-patterns |
41
+ | direction-fix (any) | gemini | analysis-diagnose-bug-root-cause |
42
+
43
+ ## Phase 3: Deep Analysis via CLI
44
+
45
+ Build analysis prompt with exploration context:
46
+
47
+ ```
48
+ PURPOSE: <Normal: "Deep analysis of '<topic>' from <perspective> perspective">
49
+ <Fix: "Supplementary analysis with adjusted focus on '<adjusted_focus>'">
50
+ Success: Actionable insights with confidence levels and evidence references
51
+
52
+ PRIOR EXPLORATION CONTEXT:
53
+ - Key files: <top 5-8 files from exploration>
54
+ - Patterns found: <top 3-5 patterns>
55
+ - Key findings: <top 3-5 findings>
56
+
57
+ TASK:
58
+ - <perspective-specific analysis tasks>
59
+ - Generate structured findings with confidence levels (high/medium/low)
60
+ - Identify discussion points requiring user input
61
+ - List open questions needing further exploration
62
+
63
+ MODE: analysis
64
+ CONTEXT: @**/* | Topic: <topic>
65
+ EXPECTED: Structured analysis with: key_insights, key_findings, discussion_points, open_questions, recommendations
66
+ CONSTRAINTS: Focus on <perspective> perspective | <dimensions>
67
+ ```
68
+
69
+ Execute: `ccw cli -p "<prompt>" --tool <cli-tool> --mode analysis --rule <rule>`
70
+
71
+ ## Phase 4: Result Aggregation
72
+
73
+ Write analysis output to `<session>/analyses/analysis-<num>.json`:
74
+
75
+ ```json
76
+ {
77
+ "perspective": "<perspective>",
78
+ "dimensions": ["<dim1>", "<dim2>"],
79
+ "is_direction_fix": false,
80
+ "key_insights": [{"insight": "...", "confidence": "high", "evidence": "file:line"}],
81
+ "key_findings": [{"finding": "...", "file_ref": "...", "impact": "..."}],
82
+ "discussion_points": ["..."],
83
+ "open_questions": ["..."],
84
+ "recommendations": [{"action": "...", "rationale": "...", "priority": "high"}],
85
+ "_metadata": {"cli_tool": "...", "cli_rule": "...", "perspective": "...", "timestamp": "..."}
86
+ }
87
+ ```
88
+
89
+ Update `<session>/wisdom/.msg/meta.json` under `analyst` namespace:
90
+ - Read existing -> merge `{ "analyst": { perspective, insight_count, finding_count, is_direction_fix } }` -> write back
@@ -1,73 +1,73 @@
1
- # Analyze Task
2
-
3
- Parse topic -> detect pipeline mode and perspectives -> output analysis config.
4
-
5
- **CONSTRAINT**: Text-level analysis only. NO source code reading, NO codebase exploration.
6
-
7
- ## Signal Detection
8
-
9
- ### Pipeline Mode Detection
10
-
11
- Parse `--mode` from arguments first. If not specified, auto-detect from topic description:
12
-
13
- | Condition | Mode | Depth |
14
- |-----------|------|-------|
15
- | `--mode=quick` or topic contains "quick/overview/fast" | Quick | 1 |
16
- | `--mode=deep` or topic contains "deep/thorough/detailed/comprehensive" | Deep | N (from perspectives) |
17
- | Default (no match) | Standard | N (from perspectives) |
18
-
19
- ### Dimension Detection
20
-
21
- Scan topic keywords to select analysis perspectives:
22
-
23
- | Dimension | Keywords |
24
- |-----------|----------|
25
- | architecture | architecture, design, structure |
26
- | implementation | implement, code, source |
27
- | performance | performance, optimize, speed |
28
- | security | security, auth, vulnerability |
29
- | concept | concept, theory, principle |
30
- | comparison | compare, vs, difference |
31
- | decision | decision, choice, tradeoff |
32
-
33
- **Depth** = number of selected perspectives. Quick mode always uses depth=1.
34
-
35
- ## Pipeline Mode Rules
36
-
37
- | Mode | Task Structure |
38
- |------|----------------|
39
- | quick | EXPLORE-001 -> ANALYZE-001 -> SYNTH-001 (serial, depth=1) |
40
- | standard | EXPLORE-001..N (parallel) -> ANALYZE-001..N (parallel) -> DISCUSS-001 -> SYNTH-001 |
41
- | deep | Same as standard but SYNTH-001 omitted (created dynamically after discussion loop) |
42
-
43
- ## Output
44
-
45
- Write analysis config to coordinator state (not a file), to be used by dispatch.md:
46
-
47
- ```json
48
- {
49
- "pipeline_mode": "<quick|standard|deep>",
50
- "depth": <number>,
51
- "perspectives": ["<perspective1>", "<perspective2>"],
52
- "topic": "<original topic>",
53
- "dimensions": ["<dim1>", "<dim2>"]
54
- }
55
- ```
56
-
57
- ## Complexity Scoring
58
-
59
- | Factor | Points |
60
- |--------|--------|
61
- | Per perspective | +1 |
62
- | Deep mode | +2 |
63
- | Cross-domain (3+ perspectives) | +1 |
64
-
65
- Results: 1-3 Quick, 4-6 Standard, 7+ Deep (if not explicitly set)
66
-
67
- ## Discussion Loop Configuration
68
-
69
- | Mode | Max Discussion Rounds |
70
- |------|----------------------|
71
- | quick | 0 |
72
- | standard | 1 |
73
- | deep | 5 |
1
+ # Analyze Task
2
+
3
+ Parse topic -> detect pipeline mode and perspectives -> output analysis config.
4
+
5
+ **CONSTRAINT**: Text-level analysis only. NO source code reading, NO codebase exploration.
6
+
7
+ ## Signal Detection
8
+
9
+ ### Pipeline Mode Detection
10
+
11
+ Parse `--mode` from arguments first. If not specified, auto-detect from topic description:
12
+
13
+ | Condition | Mode | Depth |
14
+ |-----------|------|-------|
15
+ | `--mode=quick` or topic contains "quick/overview/fast" | Quick | 1 |
16
+ | `--mode=deep` or topic contains "deep/thorough/detailed/comprehensive" | Deep | N (from perspectives) |
17
+ | Default (no match) | Standard | N (from perspectives) |
18
+
19
+ ### Dimension Detection
20
+
21
+ Scan topic keywords to select analysis perspectives:
22
+
23
+ | Dimension | Keywords |
24
+ |-----------|----------|
25
+ | architecture | architecture, design, structure |
26
+ | implementation | implement, code, source |
27
+ | performance | performance, optimize, speed |
28
+ | security | security, auth, vulnerability |
29
+ | concept | concept, theory, principle |
30
+ | comparison | compare, vs, difference |
31
+ | decision | decision, choice, tradeoff |
32
+
33
+ **Depth** = number of selected perspectives. Quick mode always uses depth=1.
34
+
35
+ ## Pipeline Mode Rules
36
+
37
+ | Mode | Task Structure |
38
+ |------|----------------|
39
+ | quick | EXPLORE-001 -> ANALYZE-001 -> SYNTH-001 (serial, depth=1) |
40
+ | standard | EXPLORE-001..N (parallel) -> ANALYZE-001..N (parallel) -> DISCUSS-001 -> SYNTH-001 |
41
+ | deep | Same as standard but SYNTH-001 omitted (created dynamically after discussion loop) |
42
+
43
+ ## Output
44
+
45
+ Write analysis config to coordinator state (not a file), to be used by dispatch.md:
46
+
47
+ ```json
48
+ {
49
+ "pipeline_mode": "<quick|standard|deep>",
50
+ "depth": <number>,
51
+ "perspectives": ["<perspective1>", "<perspective2>"],
52
+ "topic": "<original topic>",
53
+ "dimensions": ["<dim1>", "<dim2>"]
54
+ }
55
+ ```
56
+
57
+ ## Complexity Scoring
58
+
59
+ | Factor | Points |
60
+ |--------|--------|
61
+ | Per perspective | +1 |
62
+ | Deep mode | +2 |
63
+ | Cross-domain (3+ perspectives) | +1 |
64
+
65
+ Results: 1-3 Quick, 4-6 Standard, 7+ Deep (if not explicitly set)
66
+
67
+ ## Discussion Loop Configuration
68
+
69
+ | Mode | Max Discussion Rounds |
70
+ |------|----------------------|
71
+ | quick | 0 |
72
+ | standard | 1 |
73
+ | deep | 5 |
@@ -210,6 +210,7 @@ state.tasks[taskId].status = 'in_progress'
210
210
  // 2) Spawn worker
211
211
  const agentId = spawn_agent({
212
212
  agent_type: "team_worker",
213
+ task_name: taskId, // e.g., "EXPLORE-001" — enables named targeting
213
214
  items: [
214
215
  { type: "text", text: `## Role Assignment
215
216
  role: ${role}
@@ -236,15 +237,22 @@ state.active_agents[taskId] = { agentId, role, started_at: now }
236
237
  After spawning all ready tasks:
237
238
 
238
239
  ```javascript
239
- // 4) Batch wait for all spawned workers
240
- const agentIds = Object.values(state.active_agents)
241
- .map(a => a.agentId)
242
- wait_agent({ ids: agentIds })
243
-
244
- // 5) Collect results and update tasks.json
245
- for (const [taskId, agent] of Object.entries(state.active_agents)) {
246
- state.tasks[taskId].status = 'completed'
247
- delete state.active_agents[taskId]
240
+ // 4) Batch wait — use task_name for stable targeting (v4)
241
+ const taskNames = Object.keys(state.active_agents)
242
+ const waitResult = wait_agent({ targets: taskNames, timeout_ms: 900000 })
243
+ if (waitResult.timed_out) {
244
+ for (const taskId of taskNames) {
245
+ state.tasks[taskId].status = 'timed_out'
246
+ close_agent({ target: taskId })
247
+ delete state.active_agents[taskId]
248
+ }
249
+ } else {
250
+ // 5) Collect results and update tasks.json
251
+ for (const [taskId, agent] of Object.entries(state.active_agents)) {
252
+ state.tasks[taskId].status = 'completed'
253
+ close_agent({ target: taskId }) // Use task_name, not agentId
254
+ delete state.active_agents[taskId]
255
+ }
248
256
  }
249
257
  ```
250
258
 
@@ -258,6 +266,21 @@ for (const [taskId, agent] of Object.entries(state.active_agents)) {
258
266
  | all | DISCUSS phase | One discussant at a time |
259
267
  | all | SYNTH phase | One synthesizer |
260
268
 
269
+ **Cross-Agent Supplementary Context** (v4):
270
+
271
+ When spawning workers in a later pipeline phase, send upstream results as supplementary context to already-running workers:
272
+
273
+ ```
274
+ // Example: Send exploration results to running analysts
275
+ send_message({
276
+ target: "<running-agent-task-name>",
277
+ items: [{ type: "text", text: `## Supplementary Context\n${upstreamFindings}` }]
278
+ })
279
+ // Note: send_message queues info without interrupting the agent's current work
280
+ ```
281
+
282
+ Use `send_message` (not `assign_task`) for supplementary info that enriches but doesn't redirect the agent's current task.
283
+
261
284
  5. **STOP** after processing -- wait for next event
262
285
 
263
286
  ### handleCheck
@@ -282,6 +305,16 @@ Output status -- do NOT advance pipeline.
282
305
 
283
306
  ### handleResume
284
307
 
308
+ **Agent Health Check** (v4):
309
+ ```
310
+ // Verify actual running agents match session state
311
+ const runningAgents = list_agents({})
312
+ // For each active_agent in tasks.json:
313
+ // - If agent NOT in runningAgents -> agent crashed
314
+ // - Reset that task to pending, remove from active_agents
315
+ // This prevents stale agent references from blocking the pipeline
316
+ ```
317
+
285
318
  Resume pipeline after user pause or interruption.
286
319
 
287
320
  1. Audit tasks.json for inconsistencies:
@@ -291,6 +324,14 @@ Resume pipeline after user pause or interruption.
291
324
 
292
325
  ### handleComplete
293
326
 
327
+ **Cleanup Verification** (v4):
328
+ ```
329
+ // Verify all agents are properly closed
330
+ const remaining = list_agents({})
331
+ // If any team agents still running -> close_agent each
332
+ // Ensures clean session shutdown
333
+ ```
334
+
294
335
  Triggered when all pipeline tasks are completed.
295
336
 
296
337
  **Completion check**: