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,330 +1,330 @@
1
- # Phase 3: Content Generation
2
-
3
- Generate all role files, specs, and templates based on `teamConfig` and the generated SKILL.md.
4
-
5
- ## Objective
6
-
7
- - Generate coordinator role.md + commands/ (analyze, dispatch, monitor)
8
- - Generate each worker role.md (inline or with commands/)
9
- - Generate specs/ files (pipelines.md + domain specs)
10
- - Generate templates/ if needed
11
- - Follow team-lifecycle-v4 golden sample patterns
12
-
13
- ## Golden Sample Reference
14
-
15
- Read the golden sample at `~ or <project>/.claude/skills/team-lifecycle-v4/` for each file type before generating. This ensures pattern fidelity.
16
-
17
- ## Step 3.1: Generate Coordinator
18
-
19
- The coordinator is the most complex role. It always has 3 commands.
20
-
21
- ### coordinator/role.md
22
-
23
- ```markdown
24
- ---
25
- role: coordinator
26
- ---
27
-
28
- # Coordinator — ${teamConfig.title}
29
-
30
- ## Identity
31
-
32
- You are the coordinator for ${teamConfig.title}. You orchestrate the ${teamConfig.domain} pipeline by analyzing requirements, dispatching tasks, and monitoring worker progress.
33
-
34
- ## Boundaries
35
-
36
- - **DO**: Analyze, dispatch, monitor, reconcile, report
37
- - **DO NOT**: Implement domain work directly — delegate to workers
38
-
39
- ## Command Execution Protocol
40
-
41
- Read command file → Execute ALL steps sequentially → Return to entry router.
42
- Commands: `commands/analyze.md`, `commands/dispatch.md`, `commands/monitor.md`.
43
-
44
- ## Entry Router
45
-
46
- On each invocation, detect current state and route:
47
-
48
- | Condition | Handler |
49
- |-----------|---------|
50
- | First invocation (no session) | → Phase 1: Requirement Clarification |
51
- | Session exists, no team | → Phase 2: Team Setup |
52
- | Team exists, no tasks | → Phase 3: Dispatch (analyze.md → dispatch.md) |
53
- | Tasks exist, none started | → Phase 4: Spawn First (monitor.md → handleSpawnNext) |
54
- | Callback received | → monitor.md → handleCallback |
55
- | User says "check"/"status" | → monitor.md → handleCheck |
56
- | User says "resume"/"continue" | → monitor.md → handleResume |
57
- | All tasks completed | → Phase 5: Report & Completion |
58
-
59
- ## Phase 0: Session Resume
60
-
61
- If `.workflow/.team/${teamConfig.sessionPrefix}-*/team-session.json` exists:
62
- - Load session state, verify team, reconcile task status
63
- - Route to appropriate handler based on current state
64
-
65
- ## Phase 1: Requirement Clarification
66
-
67
- - Parse user's task description at TEXT LEVEL
68
- - Use request_user_input if requirements are ambiguous
69
- - Execute `commands/analyze.md` for signal detection + complexity scoring
70
-
71
- ## Phase 2: Team Setup
72
-
73
- - Session folder creation with session ID: `${teamConfig.sessionPrefix}-<slug>-<date>`
74
- - Initialize team_msg message bus
75
- - Create session directory structure
76
-
77
- ## Phase 3: Dispatch
78
-
79
- - Execute `commands/dispatch.md`
80
- - Creates task entries in tasks.json with blockedBy dependencies
81
-
82
- ## Phase 4: Spawn & Monitor
83
-
84
- - Execute `commands/monitor.md` → handleSpawnNext
85
- - Spawn ready workers as team_worker agents via spawn_agent()
86
- - **STOP after spawning** — wait for callback
87
-
88
- ## Phase 5: Report & Completion
89
-
90
- - Aggregate all task artifacts
91
- - Present completion action to user
92
- ```
93
-
94
- ### coordinator/commands/analyze.md
95
-
96
- Template based on golden sample — includes:
97
- - Signal detection (keywords → capabilities)
98
- - Dependency graph construction (tiers)
99
- - Complexity scoring (1-3 Low, 4-6 Medium, 7+ High)
100
- - Role minimization (cap at 5)
101
- - Output: task-analysis.json
102
-
103
- ```markdown
104
- # Command: Analyze
105
-
106
- ## Signal Detection
107
-
108
- Scan requirement text for capability signals:
109
- ${teamConfig.roles.filter(r => r.name !== 'coordinator').map(r =>
110
- `- **${r.name}**: [domain-specific keywords]`
111
- ).join('\n')}
112
-
113
- ## Dependency Graph
114
-
115
- Build 4-tier dependency graph:
116
- - Tier 0: Independent tasks (can run in parallel)
117
- - Tier 1: Depends on Tier 0
118
- - Tier 2: Depends on Tier 1
119
- - Tier 3: Depends on Tier 2
120
-
121
- ## Complexity Scoring
122
-
123
- | Score | Level | Strategy |
124
- |-------|-------|----------|
125
- | 1-3 | Low | Direct implementation, skip deep planning |
126
- | 4-6 | Medium | Standard pipeline with planning |
127
- | 7+ | High | Full spec → plan → implement cycle |
128
-
129
- ## Output
130
-
131
- Write `task-analysis.json` to session directory:
132
- \```json
133
- {
134
- "signals": [...],
135
- "roles_needed": [...],
136
- "dependency_tiers": [...],
137
- "complexity": { "score": N, "level": "Low|Medium|High" },
138
- "pipeline": "${teamConfig.pipelines[0].name}"
139
- }
140
- \```
141
- ```
142
-
143
- ### coordinator/commands/dispatch.md
144
-
145
- Template — includes:
146
- - Topological sort from dependency graph
147
- - tasks.json entries with blockedBy for dependencies
148
- - Task description template (PURPOSE/TASK/CONTEXT/EXPECTED/CONSTRAINTS)
149
-
150
- ### coordinator/commands/monitor.md
151
-
152
- Template — includes:
153
- - Beat model constants (ONE_STEP_PER_INVOCATION, SPAWN_MODE: spawn-and-stop)
154
- - 6 handlers: handleCallback, handleCheck, handleResume, handleSpawnNext, handleComplete, handleAdapt
155
- - Checkpoint detection for quality gates
156
- - Fast-advance reconciliation
157
-
158
- **Critical**: This is the ONLY file that contains beat model logic.
159
-
160
- ## Step 3.2: Generate Worker Roles
161
-
162
- For each worker role in `teamConfig.roles`:
163
-
164
- ### Inline Role Template (no commands/)
165
-
166
- ```markdown
167
- ---
168
- role: ${role.name}
169
- prefix: ${role.prefix}
170
- inner_loop: ${role.inner_loop}
171
- message_types: [${role.message_types.join(', ')}]
172
- ---
173
-
174
- # ${capitalize(role.name)} — ${teamConfig.title}
175
-
176
- ## Identity
177
-
178
- You are the ${role.name} for ${teamConfig.title}.
179
- Task prefix: `${role.prefix}-*`
180
-
181
- ## Phase 2: Context Loading
182
-
183
- - Read task description from tasks.json (find by id)
184
- - Load relevant session artifacts from session directory
185
- - Load specs from `specs/` as needed
186
-
187
- ## Phase 3: Domain Execution
188
-
189
- [Domain-specific execution logic for this role]
190
-
191
- ### Execution Steps
192
-
193
- 1. [Step 1 based on role's domain]
194
- 2. [Step 2]
195
- 3. [Step 3]
196
-
197
- ### Tools Available
198
-
199
- - CLI tools: `ccw cli --mode analysis|write`
200
- - Direct tools: Read, Write, Edit, Bash, Grep, Glob
201
- - Message bus: `mcp__ccw-tools__team_msg`
202
- - **Cannot use spawn_agent()** — workers must use CLI or direct tools
203
-
204
- ## Phase 4: Output & Report
205
-
206
- - Write artifacts to session directory
207
- - Log state_update via team_msg
208
- - Publish wisdom if cross-task knowledge discovered
209
- ```
210
-
211
- ### Command-Based Role Template (has commands/)
212
-
213
- ```markdown
214
- ---
215
- role: ${role.name}
216
- prefix: ${role.prefix}
217
- inner_loop: ${role.inner_loop}
218
- message_types: [${role.message_types.join(', ')}]
219
- ---
220
-
221
- # ${capitalize(role.name)} — ${teamConfig.title}
222
-
223
- ## Identity
224
-
225
- You are the ${role.name} for ${teamConfig.title}.
226
- Task prefix: `${role.prefix}-*`
227
-
228
- ## Phase 2: Context Loading
229
-
230
- Load task description, detect mode/command.
231
-
232
- ## Phase 3: Command Router
233
-
234
- | Condition | Command |
235
- |-----------|---------|
236
- ${role.commands.map(cmd =>
237
- `| [condition for ${cmd}] | → commands/${cmd}.md |`
238
- ).join('\n')}
239
-
240
- Read command file → Execute ALL steps → Return to Phase 4.
241
-
242
- ## Phase 4: Output & Report
243
-
244
- Write artifacts, log state_update.
245
- ```
246
-
247
- Then generate each `commands/<cmd>.md` with domain-specific logic.
248
-
249
- ## Step 3.3: Generate Specs
250
-
251
- ### specs/pipelines.md
252
-
253
- ```markdown
254
- # Pipeline Definitions
255
-
256
- ## Available Pipelines
257
-
258
- ${teamConfig.pipelines.map(p => `
259
- ### ${p.name}
260
-
261
- | Task ID | Role | Name | Depends On | Checkpoint |
262
- |---------|------|------|------------|------------|
263
- ${p.tasks.map(t =>
264
- `| ${t.id} | ${t.role} | ${t.name} | ${t.dependsOn.join(', ') || '—'} | ${t.isCheckpoint ? '✓' : '—'} |`
265
- ).join('\n')}
266
- `).join('\n')}
267
-
268
- ## Task Metadata Registry
269
-
270
- Standard task description template:
271
-
272
- \```
273
- PURPOSE: [goal]
274
- TASK: [steps]
275
- CONTEXT: [session artifacts + specs]
276
- EXPECTED: [deliverable format]
277
- CONSTRAINTS: [scope limits]
278
- \```
279
-
280
- ## Conditional Routing
281
-
282
- ${teamConfig.conditionalRouting ? `
283
- PLAN-001 complexity assessment routes to:
284
- - Low (1-3): Direct implementation
285
- - Medium (4-6): Standard planning
286
- - High (7+): Full spec → plan → implement
287
- ` : 'No conditional routing in this pipeline.'}
288
-
289
- ## Dynamic Specialist Injection
290
-
291
- ${teamConfig.dynamicSpecialists.length > 0 ?
292
- teamConfig.dynamicSpecialists.map(s => `- ${s}: Injected when domain keywords detected`).join('\n') :
293
- 'No dynamic specialists configured.'
294
- }
295
- ```
296
-
297
- ### Additional Specs
298
-
299
- For each additional spec in `teamConfig.specs` (beyond pipelines), generate domain-appropriate content:
300
-
301
- - **quality-gates.md**: Thresholds (Pass≥80%, Review 60-79%, Fail<60%), scoring dimensions, per-phase gates
302
- - **knowledge-transfer.md**: 5 transfer channels, Phase 2 loading protocol, Phase 4 publishing protocol
303
-
304
- ## Step 3.4: Generate Templates
305
-
306
- For each template in `teamConfig.templates`:
307
-
308
- 1. Check if golden sample has matching template at `~ or <project>/.claude/skills/team-lifecycle-v4/templates/`
309
- 2. If exists: copy and adapt for new domain
310
- 3. If not: generate domain-appropriate template structure
311
-
312
- ## Step 3.5: Generation Order
313
-
314
- Execute in this order (respects dependencies):
315
-
316
- 1. **specs/** — needed by roles for reference
317
- 2. **coordinator/** — role.md + commands/ (3 files)
318
- 3. **workers/** — each role.md (+ optional commands/)
319
- 4. **templates/** — independent, generate last
320
-
321
- For each file:
322
- 1. Read golden sample equivalent (if exists)
323
- 2. Adapt content for current teamConfig
324
- 3. Write file
325
- 4. Verify file exists
326
-
327
- ## Output
328
-
329
- - **Files**: All role.md, commands/*.md, specs/*.md, templates/*.md
330
- - **Next**: Phase 4 - Validation
1
+ # Phase 3: Content Generation
2
+
3
+ Generate all role files, specs, and templates based on `teamConfig` and the generated SKILL.md.
4
+
5
+ ## Objective
6
+
7
+ - Generate coordinator role.md + commands/ (analyze, dispatch, monitor)
8
+ - Generate each worker role.md (inline or with commands/)
9
+ - Generate specs/ files (pipelines.md + domain specs)
10
+ - Generate templates/ if needed
11
+ - Follow team-lifecycle-v4 golden sample patterns
12
+
13
+ ## Golden Sample Reference
14
+
15
+ Read the golden sample at `~ or <project>/.claude/skills/team-lifecycle-v4/` for each file type before generating. This ensures pattern fidelity.
16
+
17
+ ## Step 3.1: Generate Coordinator
18
+
19
+ The coordinator is the most complex role. It always has 3 commands.
20
+
21
+ ### coordinator/role.md
22
+
23
+ ```markdown
24
+ ---
25
+ role: coordinator
26
+ ---
27
+
28
+ # Coordinator — ${teamConfig.title}
29
+
30
+ ## Identity
31
+
32
+ You are the coordinator for ${teamConfig.title}. You orchestrate the ${teamConfig.domain} pipeline by analyzing requirements, dispatching tasks, and monitoring worker progress.
33
+
34
+ ## Boundaries
35
+
36
+ - **DO**: Analyze, dispatch, monitor, reconcile, report
37
+ - **DO NOT**: Implement domain work directly — delegate to workers
38
+
39
+ ## Command Execution Protocol
40
+
41
+ Read command file → Execute ALL steps sequentially → Return to entry router.
42
+ Commands: `commands/analyze.md`, `commands/dispatch.md`, `commands/monitor.md`.
43
+
44
+ ## Entry Router
45
+
46
+ On each invocation, detect current state and route:
47
+
48
+ | Condition | Handler |
49
+ |-----------|---------|
50
+ | First invocation (no session) | → Phase 1: Requirement Clarification |
51
+ | Session exists, no team | → Phase 2: Team Setup |
52
+ | Team exists, no tasks | → Phase 3: Dispatch (analyze.md → dispatch.md) |
53
+ | Tasks exist, none started | → Phase 4: Spawn First (monitor.md → handleSpawnNext) |
54
+ | Callback received | → monitor.md → handleCallback |
55
+ | User says "check"/"status" | → monitor.md → handleCheck |
56
+ | User says "resume"/"continue" | → monitor.md → handleResume |
57
+ | All tasks completed | → Phase 5: Report & Completion |
58
+
59
+ ## Phase 0: Session Resume
60
+
61
+ If `.workflow/.team/${teamConfig.sessionPrefix}-*/team-session.json` exists:
62
+ - Load session state, verify team, reconcile task status
63
+ - Route to appropriate handler based on current state
64
+
65
+ ## Phase 1: Requirement Clarification
66
+
67
+ - Parse user's task description at TEXT LEVEL
68
+ - Use request_user_input if requirements are ambiguous
69
+ - Execute `commands/analyze.md` for signal detection + complexity scoring
70
+
71
+ ## Phase 2: Team Setup
72
+
73
+ - Session folder creation with session ID: `${teamConfig.sessionPrefix}-<slug>-<date>`
74
+ - Initialize team_msg message bus
75
+ - Create session directory structure
76
+
77
+ ## Phase 3: Dispatch
78
+
79
+ - Execute `commands/dispatch.md`
80
+ - Creates task entries in tasks.json with blockedBy dependencies
81
+
82
+ ## Phase 4: Spawn & Monitor
83
+
84
+ - Execute `commands/monitor.md` → handleSpawnNext
85
+ - Spawn ready workers as team_worker agents via spawn_agent()
86
+ - **STOP after spawning** — wait for callback
87
+
88
+ ## Phase 5: Report & Completion
89
+
90
+ - Aggregate all task artifacts
91
+ - Present completion action to user
92
+ ```
93
+
94
+ ### coordinator/commands/analyze.md
95
+
96
+ Template based on golden sample — includes:
97
+ - Signal detection (keywords → capabilities)
98
+ - Dependency graph construction (tiers)
99
+ - Complexity scoring (1-3 Low, 4-6 Medium, 7+ High)
100
+ - Role minimization (cap at 5)
101
+ - Output: task-analysis.json
102
+
103
+ ```markdown
104
+ # Command: Analyze
105
+
106
+ ## Signal Detection
107
+
108
+ Scan requirement text for capability signals:
109
+ ${teamConfig.roles.filter(r => r.name !== 'coordinator').map(r =>
110
+ `- **${r.name}**: [domain-specific keywords]`
111
+ ).join('\n')}
112
+
113
+ ## Dependency Graph
114
+
115
+ Build 4-tier dependency graph:
116
+ - Tier 0: Independent tasks (can run in parallel)
117
+ - Tier 1: Depends on Tier 0
118
+ - Tier 2: Depends on Tier 1
119
+ - Tier 3: Depends on Tier 2
120
+
121
+ ## Complexity Scoring
122
+
123
+ | Score | Level | Strategy |
124
+ |-------|-------|----------|
125
+ | 1-3 | Low | Direct implementation, skip deep planning |
126
+ | 4-6 | Medium | Standard pipeline with planning |
127
+ | 7+ | High | Full spec → plan → implement cycle |
128
+
129
+ ## Output
130
+
131
+ Write `task-analysis.json` to session directory:
132
+ \```json
133
+ {
134
+ "signals": [...],
135
+ "roles_needed": [...],
136
+ "dependency_tiers": [...],
137
+ "complexity": { "score": N, "level": "Low|Medium|High" },
138
+ "pipeline": "${teamConfig.pipelines[0].name}"
139
+ }
140
+ \```
141
+ ```
142
+
143
+ ### coordinator/commands/dispatch.md
144
+
145
+ Template — includes:
146
+ - Topological sort from dependency graph
147
+ - tasks.json entries with blockedBy for dependencies
148
+ - Task description template (PURPOSE/TASK/CONTEXT/EXPECTED/CONSTRAINTS)
149
+
150
+ ### coordinator/commands/monitor.md
151
+
152
+ Template — includes:
153
+ - Beat model constants (ONE_STEP_PER_INVOCATION, SPAWN_MODE: spawn-and-stop)
154
+ - 6 handlers: handleCallback, handleCheck, handleResume, handleSpawnNext, handleComplete, handleAdapt
155
+ - Checkpoint detection for quality gates
156
+ - Fast-advance reconciliation
157
+
158
+ **Critical**: This is the ONLY file that contains beat model logic.
159
+
160
+ ## Step 3.2: Generate Worker Roles
161
+
162
+ For each worker role in `teamConfig.roles`:
163
+
164
+ ### Inline Role Template (no commands/)
165
+
166
+ ```markdown
167
+ ---
168
+ role: ${role.name}
169
+ prefix: ${role.prefix}
170
+ inner_loop: ${role.inner_loop}
171
+ message_types: [${role.message_types.join(', ')}]
172
+ ---
173
+
174
+ # ${capitalize(role.name)} — ${teamConfig.title}
175
+
176
+ ## Identity
177
+
178
+ You are the ${role.name} for ${teamConfig.title}.
179
+ Task prefix: `${role.prefix}-*`
180
+
181
+ ## Phase 2: Context Loading
182
+
183
+ - Read task description from tasks.json (find by id)
184
+ - Load relevant session artifacts from session directory
185
+ - Load specs from `specs/` as needed
186
+
187
+ ## Phase 3: Domain Execution
188
+
189
+ [Domain-specific execution logic for this role]
190
+
191
+ ### Execution Steps
192
+
193
+ 1. [Step 1 based on role's domain]
194
+ 2. [Step 2]
195
+ 3. [Step 3]
196
+
197
+ ### Tools Available
198
+
199
+ - CLI tools: `ccw cli --mode analysis|write`
200
+ - Direct tools: Read, Write, Edit, Bash, Grep, Glob
201
+ - Message bus: `mcp__ccw-tools__team_msg`
202
+ - **Cannot use spawn_agent()** — workers must use CLI or direct tools
203
+
204
+ ## Phase 4: Output & Report
205
+
206
+ - Write artifacts to session directory
207
+ - Log state_update via team_msg
208
+ - Publish wisdom if cross-task knowledge discovered
209
+ ```
210
+
211
+ ### Command-Based Role Template (has commands/)
212
+
213
+ ```markdown
214
+ ---
215
+ role: ${role.name}
216
+ prefix: ${role.prefix}
217
+ inner_loop: ${role.inner_loop}
218
+ message_types: [${role.message_types.join(', ')}]
219
+ ---
220
+
221
+ # ${capitalize(role.name)} — ${teamConfig.title}
222
+
223
+ ## Identity
224
+
225
+ You are the ${role.name} for ${teamConfig.title}.
226
+ Task prefix: `${role.prefix}-*`
227
+
228
+ ## Phase 2: Context Loading
229
+
230
+ Load task description, detect mode/command.
231
+
232
+ ## Phase 3: Command Router
233
+
234
+ | Condition | Command |
235
+ |-----------|---------|
236
+ ${role.commands.map(cmd =>
237
+ `| [condition for ${cmd}] | → commands/${cmd}.md |`
238
+ ).join('\n')}
239
+
240
+ Read command file → Execute ALL steps → Return to Phase 4.
241
+
242
+ ## Phase 4: Output & Report
243
+
244
+ Write artifacts, log state_update.
245
+ ```
246
+
247
+ Then generate each `commands/<cmd>.md` with domain-specific logic.
248
+
249
+ ## Step 3.3: Generate Specs
250
+
251
+ ### specs/pipelines.md
252
+
253
+ ```markdown
254
+ # Pipeline Definitions
255
+
256
+ ## Available Pipelines
257
+
258
+ ${teamConfig.pipelines.map(p => `
259
+ ### ${p.name}
260
+
261
+ | Task ID | Role | Name | Depends On | Checkpoint |
262
+ |---------|------|------|------------|------------|
263
+ ${p.tasks.map(t =>
264
+ `| ${t.id} | ${t.role} | ${t.name} | ${t.dependsOn.join(', ') || '—'} | ${t.isCheckpoint ? '✓' : '—'} |`
265
+ ).join('\n')}
266
+ `).join('\n')}
267
+
268
+ ## Task Metadata Registry
269
+
270
+ Standard task description template:
271
+
272
+ \```
273
+ PURPOSE: [goal]
274
+ TASK: [steps]
275
+ CONTEXT: [session artifacts + specs]
276
+ EXPECTED: [deliverable format]
277
+ CONSTRAINTS: [scope limits]
278
+ \```
279
+
280
+ ## Conditional Routing
281
+
282
+ ${teamConfig.conditionalRouting ? `
283
+ PLAN-001 complexity assessment routes to:
284
+ - Low (1-3): Direct implementation
285
+ - Medium (4-6): Standard planning
286
+ - High (7+): Full spec → plan → implement
287
+ ` : 'No conditional routing in this pipeline.'}
288
+
289
+ ## Dynamic Specialist Injection
290
+
291
+ ${teamConfig.dynamicSpecialists.length > 0 ?
292
+ teamConfig.dynamicSpecialists.map(s => `- ${s}: Injected when domain keywords detected`).join('\n') :
293
+ 'No dynamic specialists configured.'
294
+ }
295
+ ```
296
+
297
+ ### Additional Specs
298
+
299
+ For each additional spec in `teamConfig.specs` (beyond pipelines), generate domain-appropriate content:
300
+
301
+ - **quality-gates.md**: Thresholds (Pass≥80%, Review 60-79%, Fail<60%), scoring dimensions, per-phase gates
302
+ - **knowledge-transfer.md**: 5 transfer channels, Phase 2 loading protocol, Phase 4 publishing protocol
303
+
304
+ ## Step 3.4: Generate Templates
305
+
306
+ For each template in `teamConfig.templates`:
307
+
308
+ 1. Check if golden sample has matching template at `~ or <project>/.claude/skills/team-lifecycle-v4/templates/`
309
+ 2. If exists: copy and adapt for new domain
310
+ 3. If not: generate domain-appropriate template structure
311
+
312
+ ## Step 3.5: Generation Order
313
+
314
+ Execute in this order (respects dependencies):
315
+
316
+ 1. **specs/** — needed by roles for reference
317
+ 2. **coordinator/** — role.md + commands/ (3 files)
318
+ 3. **workers/** — each role.md (+ optional commands/)
319
+ 4. **templates/** — independent, generate last
320
+
321
+ For each file:
322
+ 1. Read golden sample equivalent (if exists)
323
+ 2. Adapt content for current teamConfig
324
+ 3. Write file
325
+ 4. Verify file exists
326
+
327
+ ## Output
328
+
329
+ - **Files**: All role.md, commands/*.md, specs/*.md, templates/*.md
330
+ - **Next**: Phase 4 - Validation