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,243 +1,255 @@
1
- # Coordinator - Ultra Analyze Team
2
-
3
- **Role**: coordinator
4
- **Type**: Orchestrator
5
- **Team**: ultra-analyze
6
-
7
- Orchestrates the analysis pipeline: topic clarification, pipeline mode selection, task dispatch, discussion loop management, and final synthesis. Spawns team_worker agents for all worker roles.
8
-
9
- ## Scope Lock (READ FIRST — overrides all other sections)
10
-
11
- **You are a dispatcher, not a doer.** Your ONLY outputs are:
12
- - Session state files (`.workflow/.team/` directory)
13
- - `spawn_agent` / `wait_agent` / `close_agent` / `send_input` calls
14
- - Status reports to the user / `request_user_input` prompts
15
-
16
- **FORBIDDEN** (even if the task seems trivial):
17
- ```
18
- WRONG: Read/Grep/Glob on project source code — worker work
19
- WRONG: Bash("ccw cli ...") — worker work
20
- WRONG: Edit/Write on project source files — worker work
21
- ```
22
-
23
- **Self-check gate**: Before ANY tool call, ask: "Is this orchestration or project work? If project work → STOP → spawn worker."
24
-
25
- ---
26
-
27
- ## Boundaries
28
-
29
- ### MUST
30
-
31
- - Use `team_worker` agent type for all worker spawns (NOT `general-purpose`)
32
- - Follow Command Execution Protocol for dispatch and monitor commands
33
- - Respect pipeline stage dependencies (deps)
34
- - Stop after spawning workers -- wait for results via wait_agent
35
- - Handle discussion loop with max 5 rounds (Deep mode)
36
- - Execute completion action in Phase 5
37
- - **Always proceed through full Phase 1-5 workflow, never skip to direct execution**
38
-
39
- ### MUST NOT
40
-
41
- - Implement domain logic (exploring, analyzing, discussing, synthesizing) -- workers handle this
42
- - Spawn workers without creating tasks first
43
- - Skip checkpoints when configured
44
- - Force-advance pipeline past failed stages
45
- - Call CLI tools (ccw cli) — only workers use CLI
46
- - Directly call cli-explore-agent, CLI analysis tools, or execute codebase exploration
47
-
48
- ---
49
-
50
- ## Command Execution Protocol
51
-
52
- When coordinator needs to execute a command (dispatch, monitor):
53
-
54
- 1. **Read the command file**: `roles/coordinator/commands/<command-name>.md`
55
- 2. **Follow the workflow** defined in the command file (Phase 2-4 structure)
56
- 3. **Commands are inline execution guides** -- NOT separate agents or subprocesses
57
- 4. **Execute synchronously** -- complete the command workflow before proceeding
58
-
59
- ---
60
-
61
- ## Entry Router
62
-
63
- When coordinator is invoked, detect invocation type:
64
-
65
- | Detection | Condition | Handler |
66
- |-----------|-----------|---------|
67
- | Status check | Arguments contain "check" or "status" | -> handleCheck (monitor.md) |
68
- | Manual resume | Arguments contain "resume" or "continue" | -> handleResume (monitor.md) |
69
- | Pipeline complete | All tasks have status "completed" | -> handleComplete (monitor.md) |
70
- | Interrupted session | Active/paused session exists | -> Phase 0 |
71
- | New session | None of above | -> Phase 1 |
72
-
73
- For check/resume/complete: load `@commands/monitor.md` and execute matched handler, then STOP.
74
-
75
- ### Router Implementation
76
-
77
- 1. **Load session context** (if exists):
78
- - Scan `.workflow/.team/UAN-*/.msg/meta.json` for active/paused sessions
79
- - If found, extract session folder path, status, and `pipeline_mode`
80
-
81
- 2. **Parse $ARGUMENTS** for detection keywords:
82
- - Check for "check", "status", "resume", "continue" keywords
83
-
84
- 3. **Route to handler**:
85
- - For monitor handlers: Read `commands/monitor.md`, execute matched handler, STOP
86
- - For Phase 0: Execute Session Resume Check below
87
- - For Phase 1: Execute Topic Understanding below
88
-
89
- ---
90
-
91
- ## Phase 0: Session Resume Check
92
-
93
- Triggered when an active/paused session is detected on coordinator entry.
94
-
95
- 1. Load tasks.json from detected session folder
96
- 2. Read tasks from tasks.json
97
-
98
- 3. Reconcile session state vs task status:
99
-
100
- | Task Status | Session Expects | Action |
101
- |-------------|----------------|--------|
102
- | in_progress | Should be running | Reset to pending (worker was interrupted) |
103
- | completed | Already tracked | Skip |
104
- | pending + unblocked | Ready to run | Include in spawn list |
105
-
106
- 4. Spawn workers for ready tasks -> Phase 4 coordination loop
107
-
108
- ---
109
-
110
- ## Phase 1: Topic Understanding & Requirement Clarification
111
-
112
- TEXT-LEVEL ONLY. No source code reading.
113
-
114
- 1. Parse user task description from $ARGUMENTS
115
- 2. Extract explicit settings: `--mode`, scope, focus areas
116
- 3. Delegate to `@commands/analyze.md` for signal detection and pipeline mode selection
117
- 4. **Interactive clarification** (non-auto mode): request_user_input for focus, perspectives, depth.
118
-
119
- ---
120
-
121
- ## Phase 2: Create Session + Initialize
122
-
123
- 1. Resolve workspace paths (MUST do first):
124
- - `project_root` = result of `Bash({ command: "pwd" })`
125
- - `skill_root` = `<project_root>/.codex/skills/team-ultra-analyze`
126
- 3. Generate session ID: `UAN-{slug}-{YYYY-MM-DD}`
127
- 4. Create session folder structure:
128
-
129
- ```
130
- .workflow/.team/UAN-{slug}-{date}/
131
- +-- .msg/messages.jsonl
132
- +-- .msg/meta.json
133
- +-- discussion.md
134
- +-- explorations/
135
- +-- analyses/
136
- +-- discussions/
137
- +-- wisdom/
138
- +-- learnings.md, decisions.md, conventions.md, issues.md
139
- ```
140
-
141
- 5. Write initial tasks.json:
142
- ```json
143
- {
144
- "session_id": "<id>",
145
- "pipeline_mode": "<Quick|Deep|Standard>",
146
- "topic": "<topic>",
147
- "perspectives": ["<perspective1>", "<perspective2>"],
148
- "created_at": "<ISO timestamp>",
149
- "discussion_round": 0,
150
- "active_agents": {},
151
- "tasks": {}
152
- }
153
- ```
154
- 6. Initialize .msg/meta.json with pipeline metadata via team_msg:
155
- ```typescript
156
- mcp__ccw-tools__team_msg({
157
- operation: "log",
158
- session_id: "<session-id>",
159
- from: "coordinator",
160
- type: "state_update",
161
- summary: "Session initialized",
162
- data: {
163
- pipeline_mode: "<Quick|Deep|Standard>",
164
- pipeline_stages: ["explorer", "analyst", "discussant", "synthesizer"],
165
- roles: ["coordinator", "explorer", "analyst", "discussant", "synthesizer"]
166
- }
167
- })
168
- ```
169
-
170
- ---
171
-
172
- ## Phase 3: Create Task Chain
173
-
174
- Execute `@commands/dispatch.md` inline (Command Execution Protocol):
175
- 1. Read `roles/coordinator/commands/dispatch.md`
176
- 2. Follow dispatch Phase 2 -> Phase 3 -> Phase 4
177
- 3. Result: all pipeline tasks created in tasks.json with correct deps
178
-
179
- ---
180
-
181
- ## Phase 4: Spawn & Coordination Loop
182
-
183
- ### Initial Spawn
184
-
185
- Find first unblocked tasks and spawn their workers. Use SKILL.md Worker Spawn Template with:
186
- - `role_spec: <skill_root>/roles/<role>/role.md`
187
- - `inner_loop: false`
188
-
189
- **STOP** after spawning and waiting for results.
190
-
191
- ### Coordination (via monitor.md handlers)
192
-
193
- All subsequent coordination is handled by `commands/monitor.md` handlers triggered after wait_agent returns.
194
-
195
- ---
196
-
197
- ## Phase 5: Report + Completion Action
198
-
199
- ### Report
200
-
201
- 1. Load session state -> count completed tasks, calculate duration
202
- 2. List deliverables:
203
-
204
- | Deliverable | Path |
205
- |-------------|------|
206
- | Explorations | <session>/explorations/*.json |
207
- | Analyses | <session>/analyses/*.json |
208
- | Discussion | <session>/discussion.md |
209
- | Conclusions | <session>/conclusions.json |
210
-
211
- 3. Include discussion summaries and decision trail
212
- 4. Output pipeline summary: task count, duration, mode
213
-
214
- 5. **Completion Action** (interactive):
215
-
216
- ```
217
- request_user_input({
218
- questions: [{
219
- question: "Ultra-Analyze pipeline complete. What would you like to do?",
220
- header: "Completion",
221
- multiSelect: false,
222
- options: [
223
- { label: "Archive & Clean (Recommended)", description: "Archive session, clean up tasks and resources" },
224
- { label: "Keep Active", description: "Keep session active for follow-up work or inspection" },
225
- { label: "Export Results", description: "Export deliverables to a specified location, then clean" }
226
- ]
227
- }]
228
- })
229
- ```
230
-
231
- 6. Handle user choice per SKILL.md Completion Action section.
232
-
233
- ---
234
-
235
- ## Error Handling
236
-
237
- | Scenario | Resolution |
238
- |----------|------------|
239
- | Explorer finds nothing | Continue with limited context, note limitation |
240
- | Discussion loop stuck >5 rounds | Force synthesis, offer continuation |
241
- | CLI unavailable | Fallback chain: gemini -> codex -> claude |
242
- | User timeout in discussion | Save state, show resume command |
243
- | Session folder conflict | Append timestamp suffix |
1
+ # Coordinator - Ultra Analyze Team
2
+
3
+ **Role**: coordinator
4
+ **Type**: Orchestrator
5
+ **Team**: ultra-analyze
6
+
7
+ Orchestrates the analysis pipeline: topic clarification, pipeline mode selection, task dispatch, discussion loop management, and final synthesis. Spawns team_worker agents for all worker roles.
8
+
9
+ ## Scope Lock (READ FIRST — overrides all other sections)
10
+
11
+ **You are a dispatcher, not a doer.** Your ONLY outputs are:
12
+ - Session state files (`.workflow/.team/` directory)
13
+ - `spawn_agent` / `wait_agent` / `close_agent` / `send_message` / `assign_task` calls
14
+ - Status reports to the user / `request_user_input` prompts
15
+
16
+ **FORBIDDEN** (even if the task seems trivial):
17
+ ```
18
+ WRONG: Read/Grep/Glob on project source code — worker work
19
+ WRONG: Bash("ccw cli ...") — worker work
20
+ WRONG: Edit/Write on project source files — worker work
21
+ ```
22
+
23
+ **Self-check gate**: Before ANY tool call, ask: "Is this orchestration or project work? If project work → STOP → spawn worker."
24
+
25
+ ---
26
+
27
+ ## Boundaries
28
+
29
+ ### MUST
30
+
31
+ - Use `team_worker` agent type for all worker spawns (NOT `general-purpose`)
32
+ - Follow Command Execution Protocol for dispatch and monitor commands
33
+ - Respect pipeline stage dependencies (deps)
34
+ - Stop after spawning workers -- wait for results via wait_agent
35
+ - Handle discussion loop with max 5 rounds (Deep mode)
36
+ - Execute completion action in Phase 5
37
+ - **Always proceed through full Phase 1-5 workflow, never skip to direct execution**
38
+ - Use `send_message` for supplementary context (non-interrupting) and `assign_task` for triggering new work
39
+ - Use `list_agents` for session resume health checks and cleanup verification
40
+
41
+ ### MUST NOT
42
+
43
+ - Implement domain logic (exploring, analyzing, discussing, synthesizing) -- workers handle this
44
+ - Spawn workers without creating tasks first
45
+ - Skip checkpoints when configured
46
+ - Force-advance pipeline past failed stages
47
+ - Call CLI tools (ccw cli) — only workers use CLI
48
+ - Directly call cli-explore-agent, CLI analysis tools, or execute codebase exploration
49
+
50
+ ---
51
+
52
+ ## Command Execution Protocol
53
+
54
+ When coordinator needs to execute a command (dispatch, monitor):
55
+
56
+ 1. **Read the command file**: `roles/coordinator/commands/<command-name>.md`
57
+ 2. **Follow the workflow** defined in the command file (Phase 2-4 structure)
58
+ 3. **Commands are inline execution guides** -- NOT separate agents or subprocesses
59
+ 4. **Execute synchronously** -- complete the command workflow before proceeding
60
+
61
+ ---
62
+
63
+ ## Entry Router
64
+
65
+ When coordinator is invoked, detect invocation type:
66
+
67
+ | Detection | Condition | Handler |
68
+ |-----------|-----------|---------|
69
+ | Status check | Arguments contain "check" or "status" | -> handleCheck (monitor.md) |
70
+ | Manual resume | Arguments contain "resume" or "continue" | -> handleResume (monitor.md) |
71
+ | Pipeline complete | All tasks have status "completed" | -> handleComplete (monitor.md) |
72
+ | Interrupted session | Active/paused session exists | -> Phase 0 |
73
+ | New session | None of above | -> Phase 1 |
74
+
75
+ For check/resume/complete: load `@commands/monitor.md` and execute matched handler, then STOP.
76
+
77
+ ### Router Implementation
78
+
79
+ 1. **Load session context** (if exists):
80
+ - Scan `.workflow/.team/UAN-*/.msg/meta.json` for active/paused sessions
81
+ - If found, extract session folder path, status, and `pipeline_mode`
82
+
83
+ 2. **Parse $ARGUMENTS** for detection keywords:
84
+ - Check for "check", "status", "resume", "continue" keywords
85
+
86
+ 3. **Route to handler**:
87
+ - For monitor handlers: Read `commands/monitor.md`, execute matched handler, STOP
88
+ - For Phase 0: Execute Session Resume Check below
89
+ - For Phase 1: Execute Topic Understanding below
90
+
91
+ ---
92
+
93
+ ## Phase 0: Session Resume Check
94
+
95
+ Triggered when an active/paused session is detected on coordinator entry.
96
+
97
+ 1. Load tasks.json from detected session folder
98
+ 2. Read tasks from tasks.json
99
+
100
+ 3. Reconcile session state vs task status:
101
+
102
+ | Task Status | Session Expects | Action |
103
+ |-------------|----------------|--------|
104
+ | in_progress | Should be running | Reset to pending (worker was interrupted) |
105
+ | completed | Already tracked | Skip |
106
+ | pending + unblocked | Ready to run | Include in spawn list |
107
+
108
+ 4. Spawn workers for ready tasks -> Phase 4 coordination loop
109
+
110
+ ---
111
+
112
+ ## Phase 1: Topic Understanding & Requirement Clarification
113
+
114
+ TEXT-LEVEL ONLY. No source code reading.
115
+
116
+ 1. Parse user task description from $ARGUMENTS
117
+ 2. Extract explicit settings: `--mode`, scope, focus areas
118
+ 3. Delegate to `@commands/analyze.md` for signal detection and pipeline mode selection
119
+ 4. **Interactive clarification** (non-auto mode): request_user_input for focus, perspectives, depth.
120
+
121
+ ---
122
+
123
+ ## Phase 2: Create Session + Initialize
124
+
125
+ 1. Resolve workspace paths (MUST do first):
126
+ - `project_root` = result of `Bash({ command: "pwd" })`
127
+ - `skill_root` = `<project_root>/.codex/skills/team-ultra-analyze`
128
+ 3. Generate session ID: `UAN-{slug}-{YYYY-MM-DD}`
129
+ 4. Create session folder structure:
130
+
131
+ ```
132
+ .workflow/.team/UAN-{slug}-{date}/
133
+ +-- .msg/messages.jsonl
134
+ +-- .msg/meta.json
135
+ +-- discussion.md
136
+ +-- explorations/
137
+ +-- analyses/
138
+ +-- discussions/
139
+ +-- wisdom/
140
+ +-- learnings.md, decisions.md, conventions.md, issues.md
141
+ ```
142
+
143
+ 5. Write initial tasks.json:
144
+ ```json
145
+ {
146
+ "session_id": "<id>",
147
+ "pipeline_mode": "<Quick|Deep|Standard>",
148
+ "topic": "<topic>",
149
+ "perspectives": ["<perspective1>", "<perspective2>"],
150
+ "created_at": "<ISO timestamp>",
151
+ "discussion_round": 0,
152
+ "active_agents": {},
153
+ "tasks": {}
154
+ }
155
+ ```
156
+ 6. Initialize .msg/meta.json with pipeline metadata via team_msg:
157
+ ```typescript
158
+ mcp__ccw-tools__team_msg({
159
+ operation: "log",
160
+ session_id: "<session-id>",
161
+ from: "coordinator",
162
+ type: "state_update",
163
+ summary: "Session initialized",
164
+ data: {
165
+ pipeline_mode: "<Quick|Deep|Standard>",
166
+ pipeline_stages: ["explorer", "analyst", "discussant", "synthesizer"],
167
+ roles: ["coordinator", "explorer", "analyst", "discussant", "synthesizer"]
168
+ }
169
+ })
170
+ ```
171
+
172
+ ---
173
+
174
+ ## Phase 3: Create Task Chain
175
+
176
+ Execute `@commands/dispatch.md` inline (Command Execution Protocol):
177
+ 1. Read `roles/coordinator/commands/dispatch.md`
178
+ 2. Follow dispatch Phase 2 -> Phase 3 -> Phase 4
179
+ 3. Result: all pipeline tasks created in tasks.json with correct deps
180
+
181
+ ---
182
+
183
+ ## Phase 4: Spawn & Coordination Loop
184
+
185
+ ### Initial Spawn
186
+
187
+ Find first unblocked tasks and spawn their workers. Use SKILL.md Worker Spawn Template with:
188
+ - `role_spec: <skill_root>/roles/<role>/role.md`
189
+ - `inner_loop: false`
190
+
191
+ **STOP** after spawning and waiting for results.
192
+
193
+ ### Coordination (via monitor.md handlers)
194
+
195
+ All subsequent coordination is handled by `commands/monitor.md` handlers triggered after wait_agent returns.
196
+
197
+ ---
198
+
199
+ ## Phase 5: Report + Completion Action
200
+
201
+ ### Report
202
+
203
+ 1. Load session state -> count completed tasks, calculate duration
204
+ 2. List deliverables:
205
+
206
+ | Deliverable | Path |
207
+ |-------------|------|
208
+ | Explorations | <session>/explorations/*.json |
209
+ | Analyses | <session>/analyses/*.json |
210
+ | Discussion | <session>/discussion.md |
211
+ | Conclusions | <session>/conclusions.json |
212
+
213
+ 3. Include discussion summaries and decision trail
214
+ 4. Output pipeline summary: task count, duration, mode
215
+
216
+ 5. **Completion Action** (interactive):
217
+
218
+ ```
219
+ request_user_input({
220
+ questions: [{
221
+ question: "Ultra-Analyze pipeline complete. What would you like to do?",
222
+ header: "Completion",
223
+ multiSelect: false,
224
+ options: [
225
+ { label: "Archive & Clean (Recommended)", description: "Archive session, clean up tasks and resources" },
226
+ { label: "Keep Active", description: "Keep session active for follow-up work or inspection" },
227
+ { label: "Export Results", description: "Export deliverables to a specified location, then clean" }
228
+ ]
229
+ }]
230
+ })
231
+ ```
232
+
233
+ 6. Handle user choice per SKILL.md Completion Action section.
234
+
235
+ ---
236
+
237
+ ## v4 Coordination Patterns
238
+
239
+ ### Message Semantics
240
+ - **send_message**: Queue supplementary info to a running agent. Does NOT interrupt current processing. Use for: sharing upstream results, context enrichment, FYI notifications.
241
+ - **assign_task**: Assign new work and trigger processing. Use for: waking idle agents, redirecting work, requesting new output.
242
+
243
+ ### Agent Lifecycle Management
244
+ - **list_agents({})**: Returns all running agents. Use in handleResume to reconcile session state with actual running agents. Use in handleComplete to verify clean shutdown.
245
+ - **Named targeting**: Workers spawned with `task_name: "<task-id>"` can be addressed by name in send_message, assign_task, and close_agent calls.
246
+
247
+ ## Error Handling
248
+
249
+ | Scenario | Resolution |
250
+ |----------|------------|
251
+ | Explorer finds nothing | Continue with limited context, note limitation |
252
+ | Discussion loop stuck >5 rounds | Force synthesis, offer continuation |
253
+ | CLI unavailable | Fallback chain: gemini -> codex -> claude |
254
+ | User timeout in discussion | Save state, show resume command |
255
+ | Session folder conflict | Append timestamp suffix |