maestro-flow 0.4.10 → 0.4.11

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 (226) hide show
  1. package/.agents/agents/cli-explore-agent.md +189 -0
  2. package/.agents/agents/conceptual-planning-agent.md +247 -0
  3. package/.agents/agents/impeccable-agent.md +101 -0
  4. package/.agents/agents/team-supervisor.md +145 -0
  5. package/.agents/agents/team-worker.md +239 -0
  6. package/.agents/agents/ui-design-agent.md +289 -0
  7. package/.agents/agents/workflow-analyzer.md +117 -0
  8. package/.agents/agents/workflow-codebase-mapper.md +79 -0
  9. package/.agents/agents/workflow-collab-planner.md +145 -0
  10. package/.agents/agents/workflow-debugger.md +105 -0
  11. package/.agents/agents/workflow-executor.md +134 -0
  12. package/.agents/agents/workflow-external-researcher.md +88 -0
  13. package/.agents/agents/workflow-integration-checker.md +85 -0
  14. package/.agents/agents/workflow-nyquist-auditor.md +87 -0
  15. package/.agents/agents/workflow-phase-researcher.md +87 -0
  16. package/.agents/agents/workflow-plan-checker.md +92 -0
  17. package/.agents/agents/workflow-planner.md +197 -0
  18. package/.agents/agents/workflow-project-researcher.md +76 -0
  19. package/.agents/agents/workflow-research-synthesizer.md +72 -0
  20. package/.agents/agents/workflow-reviewer.md +84 -0
  21. package/.agents/agents/workflow-roadmapper.md +83 -0
  22. package/.agents/agents/workflow-verifier.md +122 -0
  23. package/.agents/skills/codify-to-knowhow/SKILL.md +169 -0
  24. package/.agents/skills/codify-to-knowhow/phases/01-load-manifest.md +101 -0
  25. package/.agents/skills/codify-to-knowhow/phases/02-generate-knowhow.md +97 -0
  26. package/.agents/skills/codify-to-knowhow/phases/03-generate-specs.md +92 -0
  27. package/.agents/skills/codify-to-knowhow/phases/04-index-verify.md +119 -0
  28. package/.agents/skills/learn-decompose/SKILL.md +118 -0
  29. package/.agents/skills/learn-follow/SKILL.md +129 -0
  30. package/.agents/skills/learn-investigate/SKILL.md +154 -0
  31. package/.agents/skills/learn-retro/SKILL.md +159 -0
  32. package/.agents/skills/learn-second-opinion/SKILL.md +124 -0
  33. package/.agents/skills/maestro/SKILL.md +224 -0
  34. package/.agents/skills/maestro-amend/SKILL.md +165 -0
  35. package/.agents/skills/maestro-analyze/SKILL.md +135 -0
  36. package/.agents/skills/maestro-brainstorm/SKILL.md +118 -0
  37. package/.agents/skills/maestro-collab/SKILL.md +174 -0
  38. package/.agents/skills/maestro-composer/SKILL.md +181 -0
  39. package/.agents/skills/maestro-execute/SKILL.md +133 -0
  40. package/.agents/skills/maestro-fork/SKILL.md +88 -0
  41. package/.agents/skills/maestro-guard/SKILL.md +103 -0
  42. package/.agents/skills/maestro-help/SKILL.md +266 -0
  43. package/.agents/skills/maestro-help/index/catalog.json +184 -0
  44. package/.agents/skills/maestro-help/phases/01-parse-intent.md +122 -0
  45. package/.agents/skills/maestro-help/phases/02-search-present.md +181 -0
  46. package/.agents/skills/maestro-help/phases/03-workflow-guide.md +186 -0
  47. package/.agents/skills/maestro-impeccable/SKILL.md +251 -0
  48. package/.agents/skills/maestro-init/SKILL.md +80 -0
  49. package/.agents/skills/maestro-learn/SKILL.md +142 -0
  50. package/.agents/skills/maestro-merge/SKILL.md +66 -0
  51. package/.agents/skills/maestro-milestone-audit/SKILL.md +70 -0
  52. package/.agents/skills/maestro-milestone-complete/SKILL.md +77 -0
  53. package/.agents/skills/maestro-milestone-release/SKILL.md +98 -0
  54. package/.agents/skills/maestro-overlay/SKILL.md +180 -0
  55. package/.agents/skills/maestro-plan/SKILL.md +172 -0
  56. package/.agents/skills/maestro-player/SKILL.md +177 -0
  57. package/.agents/skills/maestro-quick/SKILL.md +67 -0
  58. package/.agents/skills/maestro-ralph/SKILL.md +685 -0
  59. package/.agents/skills/maestro-ralph-execute/SKILL.md +259 -0
  60. package/.agents/skills/maestro-roadmap/SKILL.md +170 -0
  61. package/.agents/skills/maestro-tools-execute/SKILL.md +119 -0
  62. package/.agents/skills/maestro-tools-register/SKILL.md +159 -0
  63. package/.agents/skills/maestro-ui-codify/SKILL.md +82 -0
  64. package/.agents/skills/maestro-update/SKILL.md +178 -0
  65. package/.agents/skills/maestro-verify/SKILL.md +111 -0
  66. package/.agents/skills/manage-codebase-rebuild/SKILL.md +77 -0
  67. package/.agents/skills/manage-codebase-refresh/SKILL.md +59 -0
  68. package/.agents/skills/manage-harvest/SKILL.md +96 -0
  69. package/.agents/skills/manage-issue/SKILL.md +75 -0
  70. package/.agents/skills/manage-issue-discover/SKILL.md +83 -0
  71. package/.agents/skills/manage-knowhow/SKILL.md +79 -0
  72. package/.agents/skills/manage-knowhow-capture/SKILL.md +81 -0
  73. package/.agents/skills/manage-learn/SKILL.md +67 -0
  74. package/.agents/skills/manage-status/SKILL.md +54 -0
  75. package/.agents/skills/manage-wiki/SKILL.md +64 -0
  76. package/.agents/skills/quality-auto-test/SKILL.md +138 -0
  77. package/.agents/skills/quality-debug/SKILL.md +122 -0
  78. package/.agents/skills/quality-refactor/SKILL.md +69 -0
  79. package/.agents/skills/quality-retrospective/SKILL.md +79 -0
  80. package/.agents/skills/quality-review/SKILL.md +130 -0
  81. package/.agents/skills/quality-sync/SKILL.md +53 -0
  82. package/.agents/skills/quality-test/SKILL.md +119 -0
  83. package/.agents/skills/security-audit/SKILL.md +157 -0
  84. package/.agents/skills/skill-iter-tune/SKILL.md +384 -0
  85. package/.agents/skills/skill-iter-tune/phases/01-setup.md +144 -0
  86. package/.agents/skills/skill-iter-tune/phases/02-execute.md +292 -0
  87. package/.agents/skills/skill-iter-tune/phases/03-evaluate.md +312 -0
  88. package/.agents/skills/skill-iter-tune/phases/04-improve.md +186 -0
  89. package/.agents/skills/skill-iter-tune/phases/05-report.md +166 -0
  90. package/.agents/skills/skill-iter-tune/specs/evaluation-criteria.md +63 -0
  91. package/.agents/skills/skill-iter-tune/templates/eval-prompt.md +134 -0
  92. package/.agents/skills/skill-iter-tune/templates/execute-prompt.md +97 -0
  93. package/.agents/skills/spec-add/SKILL.md +70 -0
  94. package/.agents/skills/spec-load/SKILL.md +73 -0
  95. package/.agents/skills/spec-remove/SKILL.md +53 -0
  96. package/.agents/skills/spec-setup/SKILL.md +50 -0
  97. package/.agents/skills/team-coordinate/SKILL.md +268 -0
  98. package/.agents/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +247 -0
  99. package/.agents/skills/team-coordinate/roles/coordinator/commands/dispatch.md +131 -0
  100. package/.agents/skills/team-coordinate/roles/coordinator/commands/monitor.md +358 -0
  101. package/.agents/skills/team-coordinate/roles/coordinator/role.md +365 -0
  102. package/.agents/skills/team-coordinate/specs/knowledge-transfer.md +111 -0
  103. package/.agents/skills/team-coordinate/specs/pipelines.md +97 -0
  104. package/.agents/skills/team-coordinate/specs/quality-gates.md +112 -0
  105. package/.agents/skills/team-coordinate/specs/role-spec-template.md +198 -0
  106. package/.agents/skills/team-executor/SKILL.md +191 -0
  107. package/.agents/skills/team-executor/roles/executor/commands/monitor.md +239 -0
  108. package/.agents/skills/team-executor/roles/executor/role.md +171 -0
  109. package/.agents/skills/team-executor/specs/session-schema.md +264 -0
  110. package/.agents/skills/team-lifecycle-v4/SKILL.md +211 -0
  111. package/.agents/skills/team-lifecycle-v4/roles/analyst/role.md +96 -0
  112. package/.agents/skills/team-lifecycle-v4/roles/coordinator/commands/analyze.md +56 -0
  113. package/.agents/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +56 -0
  114. package/.agents/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +206 -0
  115. package/.agents/skills/team-lifecycle-v4/roles/coordinator/role.md +130 -0
  116. package/.agents/skills/team-lifecycle-v4/roles/executor/commands/fix.md +35 -0
  117. package/.agents/skills/team-lifecycle-v4/roles/executor/commands/implement.md +62 -0
  118. package/.agents/skills/team-lifecycle-v4/roles/executor/role.md +69 -0
  119. package/.agents/skills/team-lifecycle-v4/roles/planner/role.md +87 -0
  120. package/.agents/skills/team-lifecycle-v4/roles/reviewer/commands/review-code.md +34 -0
  121. package/.agents/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +44 -0
  122. package/.agents/skills/team-lifecycle-v4/roles/reviewer/role.md +71 -0
  123. package/.agents/skills/team-lifecycle-v4/roles/supervisor/role.md +194 -0
  124. package/.agents/skills/team-lifecycle-v4/roles/tester/role.md +89 -0
  125. package/.agents/skills/team-lifecycle-v4/roles/writer/role.md +97 -0
  126. package/.agents/skills/team-lifecycle-v4/specs/knowledge-transfer.md +114 -0
  127. package/.agents/skills/team-lifecycle-v4/specs/pipelines.md +140 -0
  128. package/.agents/skills/team-lifecycle-v4/specs/quality-gates.md +130 -0
  129. package/.agents/skills/team-lifecycle-v4/templates/architecture.md +254 -0
  130. package/.agents/skills/team-lifecycle-v4/templates/epics.md +196 -0
  131. package/.agents/skills/team-lifecycle-v4/templates/product-brief.md +133 -0
  132. package/.agents/skills/team-lifecycle-v4/templates/requirements.md +224 -0
  133. package/.agents/skills/team-quality-assurance/SKILL.md +149 -0
  134. package/.agents/skills/team-quality-assurance/roles/analyst/role.md +90 -0
  135. package/.agents/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +72 -0
  136. package/.agents/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +111 -0
  137. package/.agents/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +250 -0
  138. package/.agents/skills/team-quality-assurance/roles/coordinator/role.md +143 -0
  139. package/.agents/skills/team-quality-assurance/roles/executor/role.md +68 -0
  140. package/.agents/skills/team-quality-assurance/roles/generator/role.md +70 -0
  141. package/.agents/skills/team-quality-assurance/roles/scout/role.md +77 -0
  142. package/.agents/skills/team-quality-assurance/roles/strategist/role.md +73 -0
  143. package/.agents/skills/team-quality-assurance/specs/pipelines.md +115 -0
  144. package/.agents/skills/team-quality-assurance/specs/team-config.json +131 -0
  145. package/.agents/skills/team-review/SKILL.md +149 -0
  146. package/.agents/skills/team-review/roles/coordinator/commands/analyze.md +71 -0
  147. package/.agents/skills/team-review/roles/coordinator/commands/dispatch.md +91 -0
  148. package/.agents/skills/team-review/roles/coordinator/commands/monitor.md +224 -0
  149. package/.agents/skills/team-review/roles/coordinator/role.md +132 -0
  150. package/.agents/skills/team-review/roles/fixer/role.md +78 -0
  151. package/.agents/skills/team-review/roles/reviewer/role.md +70 -0
  152. package/.agents/skills/team-review/roles/scanner/role.md +81 -0
  153. package/.agents/skills/team-review/specs/dimensions.md +82 -0
  154. package/.agents/skills/team-review/specs/finding-schema.json +82 -0
  155. package/.agents/skills/team-review/specs/pipelines.md +102 -0
  156. package/.agents/skills/team-review/specs/team-config.json +27 -0
  157. package/.agents/skills/team-tech-debt/SKILL.md +130 -0
  158. package/.agents/skills/team-tech-debt/roles/assessor/role.md +79 -0
  159. package/.agents/skills/team-tech-debt/roles/coordinator/commands/analyze.md +47 -0
  160. package/.agents/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +156 -0
  161. package/.agents/skills/team-tech-debt/roles/coordinator/commands/monitor.md +209 -0
  162. package/.agents/skills/team-tech-debt/roles/coordinator/role.md +123 -0
  163. package/.agents/skills/team-tech-debt/roles/executor/role.md +78 -0
  164. package/.agents/skills/team-tech-debt/roles/planner/role.md +71 -0
  165. package/.agents/skills/team-tech-debt/roles/scanner/role.md +92 -0
  166. package/.agents/skills/team-tech-debt/roles/validator/role.md +80 -0
  167. package/.agents/skills/team-tech-debt/specs/pipelines.md +47 -0
  168. package/.agents/skills/team-tech-debt/specs/team-config.json +129 -0
  169. package/.agents/skills/team-testing/SKILL.md +145 -0
  170. package/.agents/skills/team-testing/roles/analyst/role.md +105 -0
  171. package/.agents/skills/team-testing/roles/coordinator/commands/analyze.md +70 -0
  172. package/.agents/skills/team-testing/roles/coordinator/commands/dispatch.md +108 -0
  173. package/.agents/skills/team-testing/roles/coordinator/commands/monitor.md +257 -0
  174. package/.agents/skills/team-testing/roles/coordinator/role.md +134 -0
  175. package/.agents/skills/team-testing/roles/executor/role.md +101 -0
  176. package/.agents/skills/team-testing/roles/generator/role.md +100 -0
  177. package/.agents/skills/team-testing/roles/strategist/role.md +85 -0
  178. package/.agents/skills/team-testing/specs/pipelines.md +101 -0
  179. package/.agents/skills/team-testing/specs/team-config.json +93 -0
  180. package/.agents/skills/wiki-connect/SKILL.md +64 -0
  181. package/.agents/skills/wiki-digest/SKILL.md +70 -0
  182. package/.agents/skills/workflow-skill-designer/SKILL.md +498 -0
  183. package/.agents/skills/workflow-skill-designer/phases/01-requirements-analysis.md +356 -0
  184. package/.agents/skills/workflow-skill-designer/phases/02-orchestrator-design.md +444 -0
  185. package/.agents/skills/workflow-skill-designer/phases/03-phase-design.md +458 -0
  186. package/.agents/skills/workflow-skill-designer/phases/04-validation.md +471 -0
  187. package/.agy/skills/maestro/SKILL.md +13 -11
  188. package/.agy/skills/maestro-ralph/SKILL.md +222 -87
  189. package/.claude/commands/maestro-ralph.md +222 -87
  190. package/.claude/commands/maestro.md +13 -11
  191. package/.codex/skills/maestro/SKILL.md +23 -17
  192. package/.codex/skills/maestro-ralph/SKILL.md +177 -67
  193. package/dist/src/commands/install-backend.d.ts +12 -0
  194. package/dist/src/commands/install-backend.d.ts.map +1 -1
  195. package/dist/src/commands/install-backend.js +144 -0
  196. package/dist/src/commands/install-backend.js.map +1 -1
  197. package/dist/src/core/component-defs.d.ts +6 -0
  198. package/dist/src/core/component-defs.d.ts.map +1 -1
  199. package/dist/src/core/component-defs.js +97 -0
  200. package/dist/src/core/component-defs.js.map +1 -1
  201. package/dist/src/tui/install-ui/ExtraMcpConfig.d.ts +11 -0
  202. package/dist/src/tui/install-ui/ExtraMcpConfig.d.ts.map +1 -0
  203. package/dist/src/tui/install-ui/ExtraMcpConfig.js +61 -0
  204. package/dist/src/tui/install-ui/ExtraMcpConfig.js.map +1 -0
  205. package/dist/src/tui/install-ui/InstallConfirm.d.ts +3 -0
  206. package/dist/src/tui/install-ui/InstallConfirm.d.ts.map +1 -1
  207. package/dist/src/tui/install-ui/InstallConfirm.js +1 -1
  208. package/dist/src/tui/install-ui/InstallConfirm.js.map +1 -1
  209. package/dist/src/tui/install-ui/InstallExecution.d.ts +2 -0
  210. package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
  211. package/dist/src/tui/install-ui/InstallExecution.js +14 -2
  212. package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
  213. package/dist/src/tui/install-ui/InstallFlow.d.ts +1 -1
  214. package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
  215. package/dist/src/tui/install-ui/InstallFlow.js +16 -3
  216. package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
  217. package/dist/src/tui/install-ui/InstallHub.d.ts +2 -0
  218. package/dist/src/tui/install-ui/InstallHub.d.ts.map +1 -1
  219. package/dist/src/tui/install-ui/InstallHub.js +8 -0
  220. package/dist/src/tui/install-ui/InstallHub.js.map +1 -1
  221. package/dist/src/tui/install-ui/InstallResult.d.ts.map +1 -1
  222. package/dist/src/tui/install-ui/InstallResult.js +3 -1
  223. package/dist/src/tui/install-ui/InstallResult.js.map +1 -1
  224. package/dist/src/utils/update-notices.js +19 -0
  225. package/dist/src/utils/update-notices.js.map +1 -1
  226. package/package.json +5 -2
@@ -0,0 +1,268 @@
1
+ ---
2
+ name: team-coordinate
3
+ description: Universal team coordination skill with dynamic role generation. Uses team-worker agent architecture with role-spec files. Only coordinator is built-in -- all worker roles are generated at runtime as role-specs and spawned via team-worker agent. Beat/cadence model for orchestration. Triggers on "Team Coordinate ".
4
+ allowed-tools: team_create(*), team_delete(*), send_message(*), task_create(*), task_update(*), task_list(*), task_get(*), agent(*), ask_user_question(*), read(*), write(*), edit(*), bash(*), glob(*), grep(*), mcp__ccw-tools__team_msg(*)
5
+ ---
6
+ <!-- Open-standard mirror generated by scripts/build-agents-standard.mjs — do not edit; re-run after editing .claude/ source. -->
7
+
8
+
9
+ # Team Coordinate
10
+
11
+ Universal team coordination skill: analyze task -> generate role-specs -> dispatch -> execute -> deliver. Only the **coordinator** is built-in. All worker roles are **dynamically generated** as lightweight role-spec files and spawned via the `team-worker` agent.
12
+
13
+
14
+ ## Architecture
15
+
16
+ ```
17
+ +---------------------------------------------------+
18
+ | invoke_skill(skill="team-coordinate") |
19
+ | args="task description" |
20
+ +-------------------+-------------------------------+
21
+ |
22
+ Orchestration Mode (auto -> coordinator)
23
+ |
24
+ Coordinator (built-in)
25
+ Phase 0-5 orchestration
26
+ |
27
+ +-------+-------+-------+-------+
28
+ v v v v v
29
+ [team-worker agents, each loaded with a dynamic role-spec]
30
+ (roles generated at runtime from task analysis)
31
+
32
+ CLI Tools (callable by any worker):
33
+ maestro delegate --mode analysis - analysis and exploration
34
+ maestro delegate --mode write - code generation and modification
35
+ ```
36
+
37
+ ## Shared Constants
38
+
39
+ | Constant | Value |
40
+ |----------|-------|
41
+ | Session prefix | `TC` |
42
+ | Session path | `.workflow/.team/TC-<slug>-<date>/` |
43
+ | Worker agent | `team-worker` |
44
+ | Message bus | `mcp__ccw-tools__team_msg(session_id=<session-id>, ...)` |
45
+ | CLI analysis | `maestro delegate --mode analysis` |
46
+ | CLI write | `maestro delegate --mode write` |
47
+ | Max roles | 5 |
48
+
49
+ ## Role Router
50
+
51
+ This skill is **coordinator-only**. Workers do NOT invoke this skill -- they are spawned as `team-worker` agents directly.
52
+
53
+ ### Input Parsing
54
+
55
+ Parse `$ARGUMENTS`. No `--role` needed -- always routes to coordinator.
56
+
57
+ ### Role Registry
58
+
59
+ Only coordinator is statically registered. All other roles are dynamic, stored as role-specs in session.
60
+
61
+ | Role | File | Type |
62
+ |------|------|------|
63
+ | coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | built-in orchestrator |
64
+ | (dynamic) | `<session>/role-specs/<role-name>.md` | runtime-generated role-spec |
65
+
66
+ ### CLI Tool Usage
67
+
68
+ Workers can use CLI tools for analysis and code operations:
69
+
70
+ | Tool | Purpose |
71
+ |------|---------|
72
+ | maestro delegate --mode analysis | Analysis, exploration, pattern discovery |
73
+ | maestro delegate --mode write | Code generation, modification, refactoring |
74
+
75
+ ### Dispatch
76
+
77
+ Always route to coordinator. Coordinator reads `roles/coordinator/role.md` and executes its phases.
78
+
79
+ ### Orchestration Mode
80
+
81
+ User just provides task description.
82
+
83
+ **Invocation**: `invoke_skill(skill="team-coordinate", args="task description")`
84
+
85
+ **Lifecycle**:
86
+ ```
87
+ User provides task description
88
+ -> coordinator Phase 1: task analysis (detect capabilities, build dependency graph)
89
+ -> coordinator Phase 2: generate role-specs + initialize session
90
+ -> coordinator Phase 3: create task chain from dependency graph
91
+ -> coordinator Phase 4: spawn first batch workers (background) -> STOP
92
+ -> Worker executes -> send_message callback -> coordinator advances next step
93
+ -> Loop until pipeline complete -> Phase 5 report + completion action
94
+ ```
95
+
96
+ **User Commands** (wake paused coordinator):
97
+
98
+ | Command | Action |
99
+ |---------|--------|
100
+ | `check` / `status` | Output execution status graph, no advancement |
101
+ | `resume` / `continue` | Check worker states, advance next step |
102
+ | `revise <TASK-ID> [feedback]` | Revise specific task with optional feedback |
103
+ | `feedback <text>` | Inject feedback into active pipeline |
104
+ | `improve [dimension]` | Auto-improve weakest quality dimension |
105
+
106
+ ---
107
+
108
+ ## Coordinator Spawn Template
109
+
110
+ ### v2 Worker Spawn (all roles)
111
+
112
+ When coordinator spawns workers, use `team-worker` agent with role-spec path:
113
+
114
+ ```
115
+ delegate_subagent({
116
+ subagent_type: "team-worker",
117
+ description: "Spawn <role> worker",
118
+ team_name: <team-name>,
119
+ name: "<role>",
120
+ run_in_background: true,
121
+ prompt: `## Role Assignment
122
+ role: <role>
123
+ role_spec: <session-folder>/role-specs/<role>.md
124
+ session: <session-folder>
125
+ session_id: <session-id>
126
+ team_name: <team-name>
127
+ requirement: <task-description>
128
+ inner_loop: <true|false>
129
+
130
+ ## Progress Milestones
131
+ session_id: <session-id>
132
+ Report progress via team_msg at natural phase boundaries (context loaded -> core work done -> verification).
133
+ Report blockers immediately via team_msg type="blocker".
134
+ Report completion via team_msg type="task_complete" after final send_message.
135
+
136
+ Read role_spec file to load Phase 2-4 domain instructions.
137
+ Execute built-in Phase 1 (task discovery) -> role-spec Phase 2-4 -> built-in Phase 5 (report).`
138
+ })
139
+ ```
140
+
141
+ **Inner Loop roles** (role has 2+ serial same-prefix tasks): Set `inner_loop: true`. The team-worker agent handles the loop internally.
142
+
143
+ **Single-task roles**: Set `inner_loop: false`.
144
+
145
+ ---
146
+
147
+ ## Completion Action
148
+
149
+ When pipeline completes (all tasks done), coordinator presents an interactive choice:
150
+
151
+ ```
152
+ ask_user({
153
+ questions: [{
154
+ question: "Team pipeline complete. What would you like to do?",
155
+ header: "Completion",
156
+ multiSelect: false,
157
+ options: [
158
+ { label: "Archive & Clean (Recommended)", description: "Archive session, clean up team" },
159
+ { label: "Keep Active", description: "Keep session for follow-up work" },
160
+ { label: "Export Results", description: "Export deliverables to target directory, then clean" }
161
+ ]
162
+ }]
163
+ })
164
+ ```
165
+
166
+ ### Action Handlers
167
+
168
+ | Choice | Steps |
169
+ |--------|-------|
170
+ | Archive & Clean | Update session status="completed" -> delete_team -> output final summary with artifact paths |
171
+ | Keep Active | Update session status="paused" -> output: "Resume with: invoke_skill(skill='team-coordinate', args='resume')" |
172
+ | Export Results | ask_user(target path) -> copy artifacts to target -> Archive & Clean |
173
+
174
+ ---
175
+
176
+ ## Specs Reference
177
+
178
+ | Spec | Purpose |
179
+ |------|---------|
180
+ | [specs/pipelines.md](specs/pipelines.md) | Dynamic pipeline model, task naming, dependency graph |
181
+ | [specs/role-spec-template.md](specs/role-spec-template.md) | Template for dynamic role-spec generation |
182
+ | [specs/quality-gates.md](specs/quality-gates.md) | Quality thresholds and scoring dimensions |
183
+ | [specs/knowledge-transfer.md](specs/knowledge-transfer.md) | Context transfer protocols between roles |
184
+
185
+ ---
186
+
187
+ ## Session Directory
188
+
189
+ ```
190
+ .workflow/.team/TC-<slug>-<date>/
191
+ +-- team-session.json # Session state + dynamic role registry
192
+ +-- task-analysis.json # Phase 1 output: capabilities, dependency graph
193
+ +-- role-specs/ # Dynamic role-spec definitions (generated Phase 2)
194
+ | +-- <role-1>.md # Lightweight: frontmatter + Phase 2-4 only
195
+ | +-- <role-2>.md
196
+ +-- artifacts/ # All MD deliverables from workers
197
+ | +-- <artifact>.md
198
+ +-- .msg/ # Team message bus + state
199
+ | +-- messages.jsonl # Message log
200
+ | +-- meta.json # Session metadata + cross-role state
201
+ +-- wisdom/ # Cross-task knowledge
202
+ | +-- learnings.md
203
+ | +-- decisions.md
204
+ | +-- issues.md
205
+ +-- explorations/ # Shared explore cache
206
+ | +-- cache-index.json
207
+ | +-- explore-<angle>.json
208
+ +-- discussions/ # Inline discuss records
209
+ | +-- <round>.md
210
+ ```
211
+
212
+ ### team-session.json Schema
213
+
214
+ ```json
215
+ {
216
+ "session_id": "TC-<slug>-<date>",
217
+ "task_description": "<original user input>",
218
+ "status": "active | paused | completed",
219
+ "team_name": "<team-name>",
220
+ "roles": [
221
+ {
222
+ "name": "<role-name>",
223
+ "prefix": "<PREFIX>",
224
+ "responsibility_type": "<type>",
225
+ "inner_loop": false,
226
+ "role_spec": "role-specs/<role-name>.md"
227
+ }
228
+ ],
229
+ "pipeline": {
230
+ "dependency_graph": {},
231
+ "tasks_total": 0,
232
+ "tasks_completed": 0
233
+ },
234
+ "active_workers": [],
235
+ "completed_tasks": [],
236
+ "completion_action": "interactive",
237
+ "created_at": "<timestamp>"
238
+ }
239
+ ```
240
+
241
+ ---
242
+
243
+ ## Session Resume
244
+
245
+ Coordinator supports `resume` / `continue` for interrupted sessions:
246
+
247
+ 1. Scan `.workflow/.team/TC-*/team-session.json` for active/paused sessions
248
+ 2. Multiple matches -> ask_user for selection
249
+ 3. Audit list_tasks -> reconcile session state <-> task status
250
+ 4. Reset in_progress -> pending (interrupted tasks)
251
+ 5. Rebuild team and spawn needed workers only
252
+ 6. Create missing tasks, set dependencies via update_task({ addBlockedBy })
253
+ 7. Kick first executable task -> Phase 4 coordination loop
254
+
255
+ ---
256
+
257
+ ## Error Handling
258
+
259
+ | Scenario | Resolution |
260
+ |----------|------------|
261
+ | Unknown command | Error with available command list |
262
+ | Dynamic role-spec not found | Error, coordinator may need to regenerate |
263
+ | Command file not found | Fallback to inline execution |
264
+ | CLI tool fails | Worker proceeds with direct implementation, logs warning |
265
+ | Explore cache corrupt | Clear cache, re-explore |
266
+ | Fast-advance spawns wrong task | Coordinator reconciles on next callback |
267
+ | capability_gap reported | Coordinator generates new role-spec via handleAdapt |
268
+ | Completion action fails | Default to Keep Active, log warning |
@@ -0,0 +1,247 @@
1
+ # Command: analyze-task
2
+
3
+ ## Purpose
4
+
5
+ Parse user task description -> detect required capabilities -> build dependency graph -> design dynamic roles with role-spec metadata. Outputs structured task-analysis.json with frontmatter fields for role-spec generation.
6
+
7
+ ## CRITICAL CONSTRAINT
8
+
9
+ **TEXT-LEVEL analysis only. MUST NOT read source code or explore codebase.**
10
+
11
+ **Allowed:**
12
+ - Parse user task description text
13
+ - ask_user for clarification
14
+ - Keyword-to-capability mapping
15
+ - Write `task-analysis.json`
16
+
17
+ If task context requires codebase knowledge, set `needs_research: true`. Phase 2 will spawn researcher worker.
18
+
19
+ ## When to Use
20
+
21
+ | Trigger | Condition |
22
+ |---------|-----------|
23
+ | New task | Coordinator Phase 1 receives task description |
24
+ | Re-analysis | User provides revised requirements |
25
+ | Adapt | handleAdapt extends analysis for new capability |
26
+
27
+ ## Strategy
28
+
29
+ - **Delegation**: Inline execution (coordinator processes directly)
30
+ - **Mode**: Text-level analysis only (no codebase reading)
31
+ - **Output**: `<session>/task-analysis.json`
32
+
33
+ ## Phase 2: Context Loading
34
+
35
+ | Input | Source | Required |
36
+ |-------|--------|----------|
37
+ | Task description | User input from Phase 1 | Yes |
38
+ | Clarification answers | ask_user results (if any) | No |
39
+ | Session folder | From coordinator Phase 2 | Yes |
40
+
41
+ ## Phase 3: Task Analysis
42
+
43
+ ### Step 1: Signal Detection
44
+
45
+ Scan task description for capability keywords:
46
+
47
+ | Signal | Keywords | Capability | Prefix | Responsibility Type |
48
+ |--------|----------|------------|--------|---------------------|
49
+ | Research | investigate, explore, compare, survey, find, research, discover, benchmark, study | researcher | RESEARCH | orchestration |
50
+ | Writing | write, draft, document, article, report, blog, describe, explain, summarize, content | writer | DRAFT | code-gen (docs) |
51
+ | Coding | implement, build, code, fix, refactor, develop, create app, program, migrate, port | developer | IMPL | code-gen (code) |
52
+ | Design | design, architect, plan, structure, blueprint, model, schema, wireframe, layout | designer | DESIGN | orchestration |
53
+ | Analysis | analyze, review, audit, assess, evaluate, inspect, examine, diagnose, profile | analyst | ANALYSIS | read-only |
54
+ | Testing | test, verify, validate, QA, quality, check, assert, coverage, regression | tester | TEST | validation |
55
+ | Planning | plan, breakdown, organize, schedule, decompose, roadmap, strategy, prioritize | planner | PLAN | orchestration |
56
+
57
+ **Multi-match**: A task may trigger multiple capabilities.
58
+
59
+ **No match**: Default to a single `general` capability with `TASK` prefix.
60
+
61
+ ### Step 2: Artifact Inference
62
+
63
+ Each capability produces default output artifacts:
64
+
65
+ | Capability | Default Artifact | Format |
66
+ |------------|-----------------|--------|
67
+ | researcher | Research findings | `<session>/artifacts/research-findings.md` |
68
+ | writer | Written document(s) | `<session>/artifacts/<doc-name>.md` |
69
+ | developer | Code implementation | Source files + `<session>/artifacts/implementation-summary.md` |
70
+ | designer | Design document | `<session>/artifacts/design-spec.md` |
71
+ | analyst | Analysis report | `<session>/artifacts/analysis-report.md` |
72
+ | tester | Test results | `<session>/artifacts/test-report.md` |
73
+ | planner | Execution plan | `<session>/artifacts/execution-plan.md` |
74
+
75
+ ### Step 2.5: Key File Inference
76
+
77
+ For each task, infer relevant files based on capability type and task keywords:
78
+
79
+ | Capability | File Inference Strategy |
80
+ |------------|------------------------|
81
+ | researcher | Extract domain keywords → map to likely directories (e.g., "auth" → `src/auth/**`, `middleware/auth.ts`) |
82
+ | developer | Extract feature/module keywords → map to source files (e.g., "payment" → `src/payments/**`, `types/payment.ts`) |
83
+ | designer | Look for architecture/config keywords → map to config/schema files |
84
+ | analyst | Extract target keywords → map to files under analysis |
85
+ | tester | Extract test target keywords → map to source + test files |
86
+ | writer | Extract documentation target → map to relevant source files for context |
87
+ | planner | No specific files (planning is abstract) |
88
+
89
+ **Inference rules:**
90
+ - Extract nouns and verbs from task description
91
+ - Match against common directory patterns (src/, lib/, components/, services/, utils/)
92
+ - Include related type definition files (types/, *.d.ts)
93
+ - For "fix bug" tasks, include error-prone areas (error handlers, validation)
94
+ - For "implement feature" tasks, include similar existing features as reference
95
+
96
+ ### Step 3: Dependency Graph Construction
97
+
98
+ Build a DAG of work streams using natural ordering tiers:
99
+
100
+ | Tier | Capabilities | Description |
101
+ |------|-------------|-------------|
102
+ | 0 | researcher, planner | Knowledge gathering / planning |
103
+ | 1 | designer | Design (requires context from tier 0 if present) |
104
+ | 2 | writer, developer | Creation (requires design/plan if present) |
105
+ | 3 | analyst, tester | Validation (requires artifacts to validate) |
106
+
107
+ ### Step 4: Complexity Scoring
108
+
109
+ | Factor | Weight | Condition |
110
+ |--------|--------|-----------|
111
+ | Capability count | +1 each | Number of distinct capabilities |
112
+ | Cross-domain factor | +2 | Capabilities span 3+ tiers |
113
+ | Parallel tracks | +1 each | Independent parallel work streams |
114
+ | Serial depth | +1 per level | Longest dependency chain length |
115
+
116
+ | Total Score | Complexity | Role Limit |
117
+ |-------------|------------|------------|
118
+ | 1-3 | Low | 1-2 roles |
119
+ | 4-6 | Medium | 2-3 roles |
120
+ | 7+ | High | 3-5 roles |
121
+
122
+ ### Step 5: Role Minimization
123
+
124
+ Apply merging rules to reduce role count (cap at 5).
125
+
126
+ ### Step 6: Role-Spec Metadata Assignment
127
+
128
+ For each role, determine frontmatter and generation hints:
129
+
130
+ | Field | Derivation |
131
+ |-------|------------|
132
+ | `prefix` | From capability prefix (e.g., RESEARCH, DRAFT, IMPL) |
133
+ | `inner_loop` | `true` if role has 2+ serial same-prefix tasks |
134
+ | `CLI tools` | Suggested, not mandatory — coordinator may adjust based on task needs |
135
+ | `pattern_hint` | Reference pattern name from role-spec-template (research/document/code/analysis/validation) — guides coordinator's Phase 2-4 composition, NOT a rigid template selector |
136
+ | `output_type` | `artifact` (new files in session/artifacts/) / `codebase` (modify existing project files) / `mixed` (both) — determines verification strategy in Behavioral Traits |
137
+ | `message_types.success` | `<prefix>_complete` |
138
+ | `message_types.error` | `error` |
139
+
140
+ **output_type derivation**:
141
+
142
+ | Task Signal | output_type | Example |
143
+ |-------------|-------------|---------|
144
+ | "write report", "analyze", "research" | `artifact` | New analysis-report.md in session |
145
+ | "update docs", "modify code", "fix bug" | `codebase` | Modify existing project files |
146
+ | "implement feature + write summary" | `mixed` | Code changes + implementation summary |
147
+
148
+ ## Phase 4: Output
149
+
150
+ Write `<session-folder>/task-analysis.json`:
151
+
152
+ ```json
153
+ {
154
+ "task_description": "<original user input>",
155
+ "capabilities": [
156
+ {
157
+ "name": "researcher",
158
+ "prefix": "RESEARCH",
159
+ "responsibility_type": "orchestration",
160
+ "tasks": [
161
+ {
162
+ "id": "RESEARCH-001",
163
+ "goal": "What this task achieves and why",
164
+ "steps": [
165
+ "step 1: specific action with clear verb",
166
+ "step 2: specific action with clear verb",
167
+ "step 3: specific action with clear verb"
168
+ ],
169
+ "key_files": [
170
+ "src/path/to/relevant.ts",
171
+ "src/path/to/other.ts"
172
+ ],
173
+ "upstream_artifacts": [],
174
+ "success_criteria": "Measurable completion condition",
175
+ "constraints": "Scope limits, focus areas"
176
+ }
177
+ ],
178
+ "artifacts": ["research-findings.md"]
179
+ }
180
+ ],
181
+ "dependency_graph": {
182
+ "RESEARCH-001": [],
183
+ "DRAFT-001": ["RESEARCH-001"],
184
+ "ANALYSIS-001": ["DRAFT-001"]
185
+ },
186
+ "roles": [
187
+ {
188
+ "name": "researcher",
189
+ "prefix": "RESEARCH",
190
+ "responsibility_type": "orchestration",
191
+ "task_count": 1,
192
+ "inner_loop": false,
193
+ "role_spec_metadata": {
194
+ "CLI tools": ["explore"],
195
+ "pattern_hint": "research",
196
+ "output_type": "artifact",
197
+ "message_types": {
198
+ "success": "research_complete",
199
+ "error": "error"
200
+ }
201
+ }
202
+ }
203
+ ],
204
+ "complexity": {
205
+ "capability_count": 2,
206
+ "cross_domain_factor": false,
207
+ "parallel_tracks": 0,
208
+ "serial_depth": 2,
209
+ "total_score": 3,
210
+ "level": "low"
211
+ },
212
+ "needs_research": false,
213
+ "artifacts": [
214
+ { "name": "research-findings.md", "producer": "researcher", "path": "artifacts/research-findings.md" }
215
+ ]
216
+ }
217
+ ```
218
+
219
+ ## Complexity Interpretation
220
+
221
+ **CRITICAL**: Complexity score is for **role design optimization**, NOT for skipping team workflow.
222
+
223
+ | Complexity | Team Structure | Coordinator Action |
224
+ |------------|----------------|-------------------|
225
+ | Low (1-2 roles) | Minimal team | Generate 1-2 role-specs, create team, spawn workers |
226
+ | Medium (2-3 roles) | Standard team | Generate role-specs, create team, spawn workers |
227
+ | High (3-5 roles) | Full team | Generate role-specs, create team, spawn workers |
228
+
229
+ **All complexity levels use team-worker architecture**:
230
+ - Single-role tasks still spawn team-worker agent
231
+ - Coordinator NEVER executes task work directly
232
+ - Team infrastructure provides session management, message bus, fast-advance
233
+
234
+ **Purpose of complexity score**:
235
+ - ✅ Determine optimal role count (merge vs separate)
236
+ - ✅ Guide dependency graph design
237
+ - ✅ Inform user about task scope
238
+ - ❌ NOT for deciding whether to use team workflow
239
+
240
+ ## Error Handling
241
+
242
+ | Scenario | Resolution |
243
+ |----------|------------|
244
+ | No capabilities detected | Default to single `general` role with TASK prefix |
245
+ | Circular dependency in graph | Break cycle at lowest-tier edge, warn |
246
+ | Task description too vague | Return minimal analysis, coordinator will ask_user |
247
+ | All capabilities merge into one | Valid -- single-role execution via team-worker |
@@ -0,0 +1,131 @@
1
+ # Command: dispatch
2
+
3
+ ## Purpose
4
+
5
+ Create task chains from dynamic dependency graphs. Builds pipelines from the task-analysis.json produced by Phase 1. Workers are spawned as team-worker agents with role-spec paths.
6
+
7
+ ## When to Use
8
+
9
+ | Trigger | Condition |
10
+ |---------|-----------|
11
+ | After analysis | Phase 1 complete, task-analysis.json exists |
12
+ | After adapt | handleAdapt created new roles, needs new tasks |
13
+ | Re-dispatch | Pipeline restructuring (rare) |
14
+
15
+ ## Strategy
16
+
17
+ - **Delegation**: Inline execution (coordinator processes directly)
18
+ - **Inputs**: task-analysis.json + team-session.json
19
+ - **Output**: create_task calls with dependency chains
20
+
21
+ ## Phase 2: Context Loading
22
+
23
+ | Input | Source | Required |
24
+ |-------|--------|----------|
25
+ | Task analysis | `<session-folder>/task-analysis.json` | Yes |
26
+ | Session file | `<session-folder>/team-session.json` | Yes |
27
+ | Role registry | `team-session.json#roles` | Yes |
28
+ | Scope | User requirements description | Yes |
29
+
30
+ ## Phase 3: Task Chain Creation
31
+
32
+ ### Workflow
33
+
34
+ 1. **Read dependency graph** from `task-analysis.json#dependency_graph`
35
+ 2. **Topological sort** tasks to determine creation order
36
+ 3. **Validate** all task owners exist in role registry
37
+ 4. **For each task** (in topological order):
38
+
39
+ ```
40
+ create_task({
41
+ subject: "<PREFIX>-<NNN>",
42
+ description: "PURPOSE: <goal> | Success: <success_criteria>
43
+ TASK:
44
+ - <step 1>
45
+ - <step 2>
46
+ - <step 3>
47
+ CONTEXT:
48
+ - Session: <session-folder>
49
+ - Upstream artifacts: <artifact-1.md>, <artifact-2.md>
50
+ - Key files: <file1>, <file2>
51
+ - Shared state: team_msg(operation="get_state", session_id=<session-id>)
52
+ EXPECTED: <deliverable path> + <quality criteria>
53
+ CONSTRAINTS: <scope limits>
54
+ ---
55
+ InnerLoop: <true|false>
56
+ RoleSpec: <session-folder>/role-specs/<role-name>.md"
57
+ })
58
+ update_task({ taskId: "<PREFIX>-<NNN>", addBlockedBy: [<dependency-list from graph>], owner: "<role-name>" })
59
+ ```
60
+
61
+ 5. **Update team-session.json** with pipeline and tasks_total
62
+ 6. **Validate** created chain
63
+
64
+ ### Task Description Template
65
+
66
+ Every task description includes structured fields for clarity:
67
+
68
+ ```
69
+ PURPOSE: <goal from task-analysis.json#tasks[].goal> | Success: <success_criteria from task-analysis.json#tasks[].success_criteria>
70
+ TASK:
71
+ - <step 1 from task-analysis.json#tasks[].steps[]>
72
+ - <step 2 from task-analysis.json#tasks[].steps[]>
73
+ - <step 3 from task-analysis.json#tasks[].steps[]>
74
+ CONTEXT:
75
+ - Session: <session-folder>
76
+ - Upstream artifacts: <comma-separated list from task-analysis.json#tasks[].upstream_artifacts[]>
77
+ - Key files: <comma-separated list from task-analysis.json#tasks[].key_files[]>
78
+ - Shared state: team_msg(operation="get_state", session_id=<session-id>)
79
+ EXPECTED: <artifact path from task-analysis.json#capabilities[].artifacts[]> + <quality criteria based on capability type>
80
+ CONSTRAINTS: <constraints from task-analysis.json#tasks[].constraints>
81
+ ---
82
+ InnerLoop: <true|false>
83
+ RoleSpec: <session-folder>/role-specs/<role-name>.md
84
+ ```
85
+
86
+ **Field Mapping**:
87
+ - `PURPOSE`: From `task-analysis.json#capabilities[].tasks[].goal` + `success_criteria`
88
+ - `TASK`: From `task-analysis.json#capabilities[].tasks[].steps[]`
89
+ - `CONTEXT.Upstream artifacts`: From `task-analysis.json#capabilities[].tasks[].upstream_artifacts[]`
90
+ - `CONTEXT.Key files`: From `task-analysis.json#capabilities[].tasks[].key_files[]`
91
+ - `EXPECTED`: From `task-analysis.json#capabilities[].artifacts[]` + quality criteria
92
+ - `CONSTRAINTS`: From `task-analysis.json#capabilities[].tasks[].constraints`
93
+
94
+ ### InnerLoop Flag Rules
95
+
96
+ | Condition | InnerLoop |
97
+ |-----------|-----------|
98
+ | Role has 2+ serial same-prefix tasks | true |
99
+ | Role has 1 task | false |
100
+ | Tasks are parallel (no dependency between them) | false |
101
+
102
+ ### Dependency Validation
103
+
104
+ | Check | Criteria |
105
+ |-------|----------|
106
+ | No orphan tasks | Every task is reachable from at least one root |
107
+ | No circular deps | Topological sort succeeds without cycle |
108
+ | All owners valid | Every task owner exists in team-session.json#roles |
109
+ | All blockedBy valid | Every blockedBy references an existing task subject |
110
+ | Session reference | Every task description contains `Session: <session-folder>` |
111
+ | RoleSpec reference | Every task description contains `RoleSpec: <path>` |
112
+
113
+ ## Phase 4: Validation
114
+
115
+ | Check | Criteria |
116
+ |-------|----------|
117
+ | Task count | Matches dependency_graph node count |
118
+ | Dependencies | Every blockedBy references an existing task subject |
119
+ | Owner assignment | Each task owner is in role registry |
120
+ | Session reference | Every task description contains `Session:` |
121
+ | Pipeline integrity | No disconnected subgraphs (warn if found) |
122
+
123
+ ## Error Handling
124
+
125
+ | Scenario | Resolution |
126
+ |----------|------------|
127
+ | Circular dependency detected | Report cycle, halt task creation |
128
+ | Owner not in role registry | Error, coordinator must fix roles first |
129
+ | create_task fails | Log error, report to coordinator |
130
+ | Duplicate task subject | Skip creation, log warning |
131
+ | Empty dependency graph | Error, task analysis may have failed |