pi-maestro-flow 0.2.0

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 (179) hide show
  1. package/README.md +124 -0
  2. package/agents/aggregator.md +27 -0
  3. package/agents/cli-explore-agent.md +188 -0
  4. package/agents/cross-role-reviewer.md +171 -0
  5. package/agents/delegate.md +19 -0
  6. package/agents/explorer.md +23 -0
  7. package/agents/impeccable-agent.md +99 -0
  8. package/agents/ralph-executor.md +81 -0
  9. package/agents/reference.md +24 -0
  10. package/agents/role-design-author.md +220 -0
  11. package/agents/team-supervisor.md +143 -0
  12. package/agents/team-worker.md +237 -0
  13. package/agents/ui-design-agent.md +270 -0
  14. package/agents/workflow-analyzer.md +116 -0
  15. package/agents/workflow-codebase-mapper.md +77 -0
  16. package/agents/workflow-collab-planner.md +147 -0
  17. package/agents/workflow-debugger.md +104 -0
  18. package/agents/workflow-executor.md +133 -0
  19. package/agents/workflow-external-researcher.md +86 -0
  20. package/agents/workflow-integration-checker.md +83 -0
  21. package/agents/workflow-nyquist-auditor.md +85 -0
  22. package/agents/workflow-phase-researcher.md +85 -0
  23. package/agents/workflow-plan-checker.md +100 -0
  24. package/agents/workflow-planner.md +200 -0
  25. package/agents/workflow-project-researcher.md +74 -0
  26. package/agents/workflow-research-synthesizer.md +70 -0
  27. package/agents/workflow-reviewer.md +82 -0
  28. package/agents/workflow-roadmapper.md +81 -0
  29. package/agents/workflow-verifier.md +120 -0
  30. package/package.json +58 -0
  31. package/skills/codify-to-knowhow/SKILL.md +167 -0
  32. package/skills/delegation-check/SKILL.md +297 -0
  33. package/skills/domain-add/SKILL.md +75 -0
  34. package/skills/insight-challenge/SKILL.md +226 -0
  35. package/skills/learn-decompose/SKILL.md +124 -0
  36. package/skills/learn-follow/SKILL.md +163 -0
  37. package/skills/learn-investigate/SKILL.md +160 -0
  38. package/skills/learn-second-opinion/SKILL.md +128 -0
  39. package/skills/maestro/SKILL.md +239 -0
  40. package/skills/maestro-amend/SKILL.md +169 -0
  41. package/skills/maestro-analyze/SKILL.md +173 -0
  42. package/skills/maestro-blueprint/SKILL.md +159 -0
  43. package/skills/maestro-brainstorm/SKILL.md +193 -0
  44. package/skills/maestro-collab/SKILL.md +181 -0
  45. package/skills/maestro-companion/SKILL.md +536 -0
  46. package/skills/maestro-composer/SKILL.md +192 -0
  47. package/skills/maestro-execute/SKILL.md +193 -0
  48. package/skills/maestro-fork/SKILL.md +104 -0
  49. package/skills/maestro-grill/SKILL.md +151 -0
  50. package/skills/maestro-guard/SKILL.md +124 -0
  51. package/skills/maestro-help/SKILL.md +328 -0
  52. package/skills/maestro-impeccable/SKILL.md +302 -0
  53. package/skills/maestro-init/SKILL.md +151 -0
  54. package/skills/maestro-merge/SKILL.md +90 -0
  55. package/skills/maestro-milestone-audit/SKILL.md +117 -0
  56. package/skills/maestro-milestone-complete/SKILL.md +133 -0
  57. package/skills/maestro-milestone-release/SKILL.md +131 -0
  58. package/skills/maestro-next/SKILL.md +269 -0
  59. package/skills/maestro-overlay/SKILL.md +203 -0
  60. package/skills/maestro-plan/SKILL.md +194 -0
  61. package/skills/maestro-player/SKILL.md +184 -0
  62. package/skills/maestro-quick/SKILL.md +117 -0
  63. package/skills/maestro-ralph/SKILL.md +905 -0
  64. package/skills/maestro-ralph-cli/SKILL.md +976 -0
  65. package/skills/maestro-ralph-cli-execute/SKILL.md +229 -0
  66. package/skills/maestro-ralph-execute/SKILL.md +409 -0
  67. package/skills/maestro-ralph-v2/SKILL.md +1198 -0
  68. package/skills/maestro-roadmap/SKILL.md +157 -0
  69. package/skills/maestro-swarm-workflow/SKILL.md +272 -0
  70. package/skills/maestro-tools-execute/SKILL.md +143 -0
  71. package/skills/maestro-tools-register/SKILL.md +192 -0
  72. package/skills/maestro-ui-codify/SKILL.md +127 -0
  73. package/skills/maestro-universal-workflow/SKILL.md +622 -0
  74. package/skills/maestro-update/SKILL.md +156 -0
  75. package/skills/manage-codebase-rebuild/SKILL.md +111 -0
  76. package/skills/manage-drift-realign/SKILL.md +159 -0
  77. package/skills/manage-harvest/SKILL.md +121 -0
  78. package/skills/manage-issue/SKILL.md +88 -0
  79. package/skills/manage-issue-discover/SKILL.md +104 -0
  80. package/skills/manage-kg-extractors/SKILL.md +147 -0
  81. package/skills/manage-knowhow/SKILL.md +102 -0
  82. package/skills/manage-knowhow-capture/SKILL.md +109 -0
  83. package/skills/manage-knowledge-audit/SKILL.md +147 -0
  84. package/skills/manage-status/SKILL.md +80 -0
  85. package/skills/manage-wiki/SKILL.md +104 -0
  86. package/skills/odyssey-debug/SKILL.md +344 -0
  87. package/skills/odyssey-improve/SKILL.md +423 -0
  88. package/skills/odyssey-planex/SKILL.md +542 -0
  89. package/skills/odyssey-review-test-fix/SKILL.md +392 -0
  90. package/skills/odyssey-ui/SKILL.md +388 -0
  91. package/skills/prompt-generator/SKILL.md +470 -0
  92. package/skills/quality-auto-test/SKILL.md +168 -0
  93. package/skills/quality-debug/SKILL.md +176 -0
  94. package/skills/quality-refactor/SKILL.md +108 -0
  95. package/skills/quality-retrospective/SKILL.md +134 -0
  96. package/skills/quality-review/SKILL.md +169 -0
  97. package/skills/quality-sync/SKILL.md +90 -0
  98. package/skills/quality-test/SKILL.md +183 -0
  99. package/skills/scholar-anti-ai-writing/SKILL.md +173 -0
  100. package/skills/scholar-anti-ai-writing/references/patterns-chinese.md +242 -0
  101. package/skills/scholar-anti-ai-writing/references/patterns-english.md +242 -0
  102. package/skills/scholar-citation-verify/SKILL.md +166 -0
  103. package/skills/scholar-citation-verify/references/api-usage.md +372 -0
  104. package/skills/scholar-citation-verify/references/common-errors.md +384 -0
  105. package/skills/scholar-citation-verify/references/verification-rules.md +399 -0
  106. package/skills/scholar-experiment/SKILL.md +321 -0
  107. package/skills/scholar-ideation/SKILL.md +288 -0
  108. package/skills/scholar-latex-organizer/SKILL.md +186 -0
  109. package/skills/scholar-publish/SKILL.md +220 -0
  110. package/skills/scholar-rebuttal-pro/README.md +313 -0
  111. package/skills/scholar-rebuttal-pro/SKILL.md +511 -0
  112. package/skills/scholar-review/SKILL.md +227 -0
  113. package/skills/scholar-thesis-docx/README.md +111 -0
  114. package/skills/scholar-thesis-docx/README_EN.md +108 -0
  115. package/skills/scholar-thesis-docx/SKILL.md +212 -0
  116. package/skills/scholar-thesis-docx/references/failure-patterns-and-quality-gates.md +178 -0
  117. package/skills/scholar-thesis-docx/references/figure-and-code-rules.md +33 -0
  118. package/skills/scholar-thesis-docx/references/paper-format-workflow.md +68 -0
  119. package/skills/scholar-thesis-docx/references/script-usage.md +157 -0
  120. package/skills/scholar-thesis-docx/scripts/audit_docx_ooxml.py +429 -0
  121. package/skills/scholar-thesis-docx/scripts/check_word_com.ps1 +50 -0
  122. package/skills/scholar-thesis-docx/scripts/export_word_pdf.ps1 +62 -0
  123. package/skills/scholar-thesis-docx/scripts/normalize_word_styles.ps1 +498 -0
  124. package/skills/scholar-thesis-docx/scripts/render_mermaid_figure.ps1 +148 -0
  125. package/skills/scholar-writing/SKILL.md +296 -0
  126. package/skills/security-audit/SKILL.md +244 -0
  127. package/skills/skill-generator/SKILL.md +472 -0
  128. package/skills/skill-iter-tune/SKILL.md +382 -0
  129. package/skills/skill-simplify/SKILL.md +63 -0
  130. package/skills/skill-tuning/SKILL.md +174 -0
  131. package/skills/spec-add/SKILL.md +105 -0
  132. package/skills/spec-load/SKILL.md +98 -0
  133. package/skills/spec-remove/SKILL.md +74 -0
  134. package/skills/spec-setup/SKILL.md +75 -0
  135. package/skills/team-adversarial-swarm/SKILL.md +233 -0
  136. package/skills/team-adversarial-swarm/scripts/__pycache__/pheromone.cpython-313.pyc +0 -0
  137. package/skills/team-adversarial-swarm/scripts/__pycache__/scoring.cpython-313.pyc +0 -0
  138. package/skills/team-adversarial-swarm/scripts/aco.py +473 -0
  139. package/skills/team-adversarial-swarm/scripts/pheromone.py +144 -0
  140. package/skills/team-adversarial-swarm/scripts/scoring.py +92 -0
  141. package/skills/team-adversarial-swarm/scripts/test_aco.py +475 -0
  142. package/skills/team-arch-opt/SKILL.md +158 -0
  143. package/skills/team-brainstorm/SKILL.md +171 -0
  144. package/skills/team-coordinate/SKILL.md +266 -0
  145. package/skills/team-designer/SKILL.md +160 -0
  146. package/skills/team-executor/SKILL.md +189 -0
  147. package/skills/team-frontend/SKILL.md +136 -0
  148. package/skills/team-frontend-debug/SKILL.md +198 -0
  149. package/skills/team-interactive-craft/SKILL.md +141 -0
  150. package/skills/team-issue/SKILL.md +171 -0
  151. package/skills/team-lifecycle-v4/SKILL.md +209 -0
  152. package/skills/team-motion-design/SKILL.md +142 -0
  153. package/skills/team-perf-opt/SKILL.md +175 -0
  154. package/skills/team-planex/SKILL.md +137 -0
  155. package/skills/team-quality-assurance/SKILL.md +147 -0
  156. package/skills/team-review/SKILL.md +147 -0
  157. package/skills/team-roadmap-dev/SKILL.md +169 -0
  158. package/skills/team-swarm/SKILL.md +178 -0
  159. package/skills/team-swarm/scripts/aco.py +473 -0
  160. package/skills/team-swarm/scripts/pheromone.py +144 -0
  161. package/skills/team-swarm/scripts/scoring.py +92 -0
  162. package/skills/team-swarm/scripts/test_aco.py +475 -0
  163. package/skills/team-tech-debt/SKILL.md +128 -0
  164. package/skills/team-testing/SKILL.md +143 -0
  165. package/skills/team-ui-polish/SKILL.md +141 -0
  166. package/skills/team-uidesign/SKILL.md +144 -0
  167. package/skills/team-ultra-analyze/SKILL.md +173 -0
  168. package/skills/team-ux-improve/SKILL.md +151 -0
  169. package/skills/team-visual-a11y/SKILL.md +156 -0
  170. package/skills/workflow-skill-designer/SKILL.md +496 -0
  171. package/src/extension/index.ts +222 -0
  172. package/src/extension/schemas.ts +131 -0
  173. package/src/providers/cli-tools-loader.ts +74 -0
  174. package/src/providers/provider-registry.ts +130 -0
  175. package/src/tools/delegate.ts +85 -0
  176. package/src/tools/explore.ts +134 -0
  177. package/src/tools/moa.ts +213 -0
  178. package/src/tools/status.ts +99 -0
  179. package/src/tools/wait.ts +166 -0
@@ -0,0 +1,158 @@
1
+ ---
2
+ name: team-arch-opt
3
+ description: "Unified team skill for architecture optimization. Uses team-worker agent architecture with role directories for domain logic. Coordinator orchestrates pipeline, workers are team-worker agents. Triggers on \"team arch-opt\"."
4
+ allowed-tools: Agent TaskCreate TaskList TaskGet TaskUpdate TeamCreate TeamDelete SendMessage AskUserQuestion Read Write Edit Bash Glob Grep mcp__maestro__team_msg
5
+ ---
6
+
7
+ # Team Architecture Optimization
8
+
9
+ Orchestrate multi-agent architecture optimization: analyze codebase → design refactoring plan → implement changes → validate improvements → review code quality.
10
+
11
+ ## Architecture
12
+
13
+ ```
14
+ Skill(skill="team-arch-opt", args="task description")
15
+ |
16
+ SKILL.md (this file) = Router
17
+ |
18
+ +--------------+--------------+
19
+ | |
20
+ no --role flag --role <name>
21
+ | |
22
+ Coordinator Worker
23
+ roles/coordinator/role.md roles/<name>/role.md
24
+ |
25
+ +-- analyze → dispatch → spawn workers → STOP
26
+ |
27
+ +-------+-------+-------+-------+
28
+ v v v v v
29
+ [analyzer][designer][refactorer][validator][reviewer]
30
+ ```
31
+
32
+ ## Role Registry
33
+
34
+ | Role | Path | Prefix | Inner Loop |
35
+ |------|------|--------|------------|
36
+ | coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | — | — |
37
+ | analyzer | [roles/analyzer/role.md](roles/analyzer/role.md) | ANALYZE-* | false |
38
+ | designer | [roles/designer/role.md](roles/designer/role.md) | DESIGN-* | false |
39
+ | refactorer | [roles/refactorer/role.md](roles/refactorer/role.md) | REFACTOR-*, FIX-* | true |
40
+ | validator | [roles/validator/role.md](roles/validator/role.md) | VALIDATE-* | false |
41
+ | reviewer | [roles/reviewer/role.md](roles/reviewer/role.md) | REVIEW-*, QUALITY-* | false |
42
+
43
+
44
+ ## Pre-load (coordinator, before dispatch)
45
+
46
+ 1. **Codebase docs**: If `.workflow/codebase/ARCHITECTURE.md` exists, read for module boundaries
47
+ 2. **Specs (arch)**: `maestro load --type spec --category arch` — load arch constraints as shared context
48
+ 3. **Specs (coding)**: `maestro load --type spec --category coding` — load coding constraints as shared context
49
+ 4. **Wiki knowledge**: `maestro search "architecture optimization refactor" --json` — top 5 entries as prior context
50
+ 5. All optional — proceed without if unavailable
51
+ ## Role Router
52
+
53
+ Parse `$ARGUMENTS`:
54
+ - Has `--role <name>` → Read `roles/<name>/role.md`, execute Phase 2-4
55
+ - No `--role` → `@roles/coordinator/role.md`, execute entry router
56
+
57
+ ## Shared Constants
58
+
59
+ - **Session prefix**: `TAO`
60
+ - **Session path**: `.workflow/.team/TAO-<slug>-<date>/`
61
+ - **CLI tools**: `maestro delegate --mode analysis` (read-only), `maestro delegate --mode write` (modifications)
62
+ - **Message bus**: `mcp__maestro__team_msg(session_id=<session-id>, ...)`
63
+
64
+ ## Worker Spawn Template
65
+
66
+ Coordinator spawns workers using this template:
67
+
68
+ ```
69
+ Agent({
70
+ subagent_type: "team-worker",
71
+ description: "Spawn <role> worker",
72
+ team_name: "arch-opt",
73
+ name: "<role>",
74
+ run_in_background: true,
75
+ prompt: `## Role Assignment
76
+ role: <role>
77
+ role_spec: <skill_root>/roles/<role>/role.md
78
+ session: <session-folder>
79
+ session_id: <session-id>
80
+ team_name: arch-opt
81
+ requirement: <task-description>
82
+ inner_loop: <true|false>
83
+
84
+ ## Progress Milestones
85
+ session_id: <session-id>
86
+ Report progress via team_msg at natural phase boundaries (context loaded -> core work done -> verification).
87
+ Report blockers immediately via team_msg type="blocker".
88
+ Report completion via team_msg type="task_complete" after final SendMessage.
89
+
90
+ Read role_spec file (@<skill_root>/roles/<role>/role.md) to load Phase 2-4 domain instructions.
91
+ Execute built-in Phase 1 (task discovery) -> role Phase 2-4 -> built-in Phase 5 (report).`
92
+ })
93
+ ```
94
+
95
+ **Inner Loop roles** (refactorer): Set `inner_loop` dynamically — `true` for single mode, `false` for fan-out/independent (parallel branches).
96
+ **Single-task roles** (analyzer, designer, validator, reviewer): Set `inner_loop: false`.
97
+
98
+ ## User Commands
99
+
100
+ | Command | Action |
101
+ |---------|--------|
102
+ | `check` / `status` | View execution status graph (branch-grouped), no advancement |
103
+ | `resume` / `continue` | Check worker states, advance next step |
104
+ | `revise <TASK-ID> [feedback]` | Revise specific task + cascade downstream |
105
+ | `feedback <text>` | Analyze feedback impact, create targeted revision chain |
106
+ | `recheck` | Re-run quality check |
107
+ | `improve [dimension]` | Auto-improve weakest dimension |
108
+
109
+ ## Session Directory
110
+
111
+ ```
112
+ .workflow/.team/TAO-<slug>-<date>/
113
+ ├── session.json # Session metadata + status + parallel_mode
114
+ ├── task-analysis.json # Coordinator analyze output
115
+ ├── artifacts/
116
+ │ ├── architecture-baseline.json # Analyzer: pre-refactoring metrics
117
+ │ ├── architecture-report.md # Analyzer: ranked structural issue findings
118
+ │ ├── refactoring-plan.md # Designer: prioritized refactoring plan
119
+ │ ├── validation-results.json # Validator: post-refactoring validation
120
+ │ ├── review-report.md # Reviewer: code review findings
121
+ │ ├── aggregate-results.json # Fan-out/independent: aggregated results
122
+ │ ├── branches/ # Fan-out mode branch artifacts
123
+ │ │ └── B{NN}/
124
+ │ │ ├── refactoring-detail.md
125
+ │ │ ├── validation-results.json
126
+ │ │ └── review-report.md
127
+ │ └── pipelines/ # Independent mode pipeline artifacts
128
+ │ └── {P}/
129
+ │ └── ...
130
+ ├── explorations/
131
+ │ ├── cache-index.json # Shared explore cache
132
+ │ └── <hash>.md
133
+ ├── wisdom/
134
+ │ └── patterns.md # Discovered patterns and conventions
135
+ ├── discussions/
136
+ │ ├── DISCUSS-REFACTOR.md
137
+ │ └── DISCUSS-REVIEW.md
138
+ └── .msg/
139
+ ├── messages.jsonl # Message bus log
140
+ └── meta.json # Session state + cross-role state
141
+ ```
142
+
143
+ ## Specs Reference
144
+
145
+ - [specs/pipelines.md](specs/pipelines.md) — Pipeline definitions, task registry, parallel modes
146
+
147
+ ## Error Handling
148
+
149
+ | Scenario | Resolution |
150
+ |----------|------------|
151
+ | Unknown command | Error with available command list |
152
+ | Role not found | Error with role registry |
153
+ | CLI tool fails | Worker fallback to direct implementation |
154
+ | Fast-advance conflict | Coordinator reconciles on next callback |
155
+ | Completion action fails | Default to Keep Active |
156
+ | consensus_blocked HIGH | Coordinator creates revision task or pauses pipeline |
157
+ | Branch fix cycle >= 3 | Escalate only that branch to user, others continue |
158
+ | max_branches exceeded | Coordinator truncates to top N at CP-2.5 |
@@ -0,0 +1,171 @@
1
+ ---
2
+ name: team-brainstorm
3
+ description: "Unified team skill for brainstorming team. Uses team-worker agent architecture with role directories for domain logic. Coordinator orchestrates pipeline, workers are team-worker agents. Triggers on \"team brainstorm\"."
4
+ allowed-tools: TeamCreate TeamDelete SendMessage TaskCreate TaskUpdate TaskList TaskGet Agent AskUserQuestion Read Write Edit Bash Glob Grep mcp__maestro__team_msg
5
+ ---
6
+
7
+ # Team Brainstorm
8
+
9
+ Orchestrate multi-agent brainstorming: generate ideas → challenge assumptions → synthesize → evaluate. Supports Quick, Deep, and Full pipelines with Generator-Critic loop.
10
+
11
+ ## Architecture
12
+
13
+ ```
14
+ Skill(skill="team-brainstorm", args="topic description")
15
+ |
16
+ SKILL.md (this file) = Router
17
+ |
18
+ +--------------+--------------+
19
+ | |
20
+ no --role flag --role <name>
21
+ | |
22
+ Coordinator Worker
23
+ roles/coordinator/role.md roles/<name>/role.md
24
+ |
25
+ +-- analyze → dispatch → spawn workers → STOP
26
+ |
27
+ +-------+-------+-------+
28
+ v v v v
29
+ [ideator][challenger][synthesizer][evaluator]
30
+ ```
31
+
32
+ ## Role Registry
33
+
34
+ | Role | Path | Prefix | Inner Loop |
35
+ |------|------|--------|------------|
36
+ | coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | — | — |
37
+ | ideator | [roles/ideator/role.md](roles/ideator/role.md) | IDEA-* | false |
38
+ | challenger | [roles/challenger/role.md](roles/challenger/role.md) | CHALLENGE-* | false |
39
+ | synthesizer | [roles/synthesizer/role.md](roles/synthesizer/role.md) | SYNTH-* | false |
40
+ | evaluator | [roles/evaluator/role.md](roles/evaluator/role.md) | EVAL-* | false |
41
+
42
+
43
+ ## Pre-load (coordinator, before dispatch)
44
+
45
+ 1. **Codebase docs**: If `.workflow/codebase/ARCHITECTURE.md` exists, read for module boundaries
46
+ 2. **Specs (arch)**: `maestro load --type spec --category arch` — load arch constraints as shared context
47
+ 3. **Wiki knowledge**: `maestro search "brainstorm ideation design" --json` — top 5 entries as prior context
48
+ 4. All optional — proceed without if unavailable
49
+ ## Role Router
50
+
51
+ Parse `$ARGUMENTS`:
52
+ - Has `--role <name>` → Read `roles/<name>/role.md`, execute Phase 2-4
53
+ - No `--role` → `@roles/coordinator/role.md`, execute entry router
54
+
55
+ ## Shared Constants
56
+
57
+ - **Session prefix**: `BRS`
58
+ - **Session path**: `.workflow/.team/BRS-<slug>-<date>/`
59
+ - **CLI tools**: `maestro delegate --mode analysis` (read-only), `maestro delegate --mode write` (modifications)
60
+ - **Message bus**: `mcp__maestro__team_msg(session_id=<session-id>, ...)`
61
+
62
+ ## Worker Spawn Template
63
+
64
+ Coordinator spawns workers using this template:
65
+
66
+ ```
67
+ Agent({
68
+ subagent_type: "team-worker",
69
+ description: "Spawn <role> worker",
70
+ team_name: "brainstorm",
71
+ name: "<role>",
72
+ run_in_background: true,
73
+ prompt: `## Role Assignment
74
+ role: <role>
75
+ role_spec: <skill_root>/roles/<role>/role.md
76
+ session: <session-folder>
77
+ session_id: <session-id>
78
+ team_name: brainstorm
79
+ requirement: <topic-description>
80
+ inner_loop: false
81
+
82
+ ## Progress Milestones
83
+ session_id: <session-id>
84
+ Report progress via team_msg at natural phase boundaries (context loaded -> core work done -> verification).
85
+ Report blockers immediately via team_msg type="blocker".
86
+ Report completion via team_msg type="task_complete" after final SendMessage.
87
+
88
+ Read role_spec file (@<skill_root>/roles/<role>/role.md) to load Phase 2-4 domain instructions.
89
+ Execute built-in Phase 1 (task discovery) -> role Phase 2-4 -> built-in Phase 5 (report).`
90
+ })
91
+ ```
92
+
93
+ **Parallel ideator spawn** (Full pipeline with N angles):
94
+
95
+ When Full pipeline has N parallel IDEA tasks, spawn N distinct team-worker agents named `ideator-1`, `ideator-2`, etc.
96
+
97
+ ```
98
+ Agent({
99
+ subagent_type: "team-worker",
100
+ name: "ideator-<N>",
101
+ team_name: "brainstorm",
102
+ run_in_background: true,
103
+ prompt: `## Role Assignment
104
+ role: ideator
105
+ role_spec: <skill_root>/roles/ideator/role.md
106
+ session: <session-folder>
107
+ session_id: <session-id>
108
+ team_name: brainstorm
109
+ requirement: <topic-description>
110
+ agent_name: ideator-<N>
111
+ inner_loop: false
112
+
113
+ ## Progress Milestones
114
+ session_id: <session-id>
115
+ Report progress via team_msg at natural phase boundaries (context loaded -> core work done -> verification).
116
+ Report blockers immediately via team_msg type="blocker".
117
+ Report completion via team_msg type="task_complete" after final SendMessage.
118
+
119
+ Read role_spec file (@<skill_root>/roles/ideator/role.md) to load Phase 2-4 domain instructions.
120
+ Execute built-in Phase 1 (task discovery, owner=ideator-<N>) -> role Phase 2-4 -> built-in Phase 5 (report).`
121
+ })
122
+ ```
123
+
124
+ ## User Commands
125
+
126
+ | Command | Action |
127
+ |---------|--------|
128
+ | `check` / `status` | View execution status graph, no advancement |
129
+ | `resume` / `continue` | Check worker states, advance next step |
130
+
131
+ ## Session Directory
132
+
133
+ ```
134
+ .workflow/.team/BRS-<slug>-<date>/
135
+ ├── session.json # Session metadata + pipeline + gc_round
136
+ ├── task-analysis.json # Coordinator analyze output
137
+ ├── .msg/
138
+ │ ├── messages.jsonl # Message bus log
139
+ │ └── meta.json # Session state + cross-role state
140
+ ├── wisdom/ # Cross-task knowledge
141
+ │ ├── learnings.md
142
+ │ ├── decisions.md
143
+ │ ├── conventions.md
144
+ │ └── issues.md
145
+ ├── ideas/ # Ideator output
146
+ │ ├── idea-001.md
147
+ │ └── idea-002.md
148
+ ├── critiques/ # Challenger output
149
+ │ ├── critique-001.md
150
+ │ └── critique-002.md
151
+ ├── synthesis/ # Synthesizer output
152
+ │ └── synthesis-001.md
153
+ └── evaluation/ # Evaluator output
154
+ └── evaluation-001.md
155
+ ```
156
+
157
+ ## Specs Reference
158
+
159
+ - [specs/pipelines.md](specs/pipelines.md) — Pipeline definitions and task registry
160
+
161
+ ## Error Handling
162
+
163
+ | Scenario | Resolution |
164
+ |----------|------------|
165
+ | Unknown command | Error with available command list |
166
+ | Role not found | Error with role registry |
167
+ | CLI tool fails | Worker fallback to direct implementation |
168
+ | Fast-advance conflict | Coordinator reconciles on next callback |
169
+ | Completion action fails | Default to Keep Active |
170
+ | Generator-Critic loop exceeds 2 rounds | Force convergence to synthesizer |
171
+ | No ideas generated | Coordinator prompts with seed questions |
@@ -0,0 +1,266 @@
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: TeamCreate TeamDelete SendMessage TaskCreate TaskUpdate TaskList TaskGet Agent AskUserQuestion Read Write Edit Bash Glob Grep mcp__maestro__team_msg
5
+ ---
6
+
7
+ # Team Coordinate
8
+
9
+ 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.
10
+
11
+
12
+ ## Architecture
13
+
14
+ ```
15
+ +---------------------------------------------------+
16
+ | Skill(skill="team-coordinate") |
17
+ | args="task description" |
18
+ +-------------------+-------------------------------+
19
+ |
20
+ Orchestration Mode (auto -> coordinator)
21
+ |
22
+ Coordinator (built-in)
23
+ Phase 0-5 orchestration
24
+ |
25
+ +-------+-------+-------+-------+
26
+ v v v v v
27
+ [team-worker agents, each loaded with a dynamic role-spec]
28
+ (roles generated at runtime from task analysis)
29
+
30
+ CLI Tools (callable by any worker):
31
+ maestro delegate --mode analysis - analysis and exploration
32
+ maestro delegate --mode write - code generation and modification
33
+ ```
34
+
35
+ ## Shared Constants
36
+
37
+ | Constant | Value |
38
+ |----------|-------|
39
+ | Session prefix | `TC` |
40
+ | Session path | `.workflow/.team/TC-<slug>-<date>/` |
41
+ | Worker agent | `team-worker` |
42
+ | Message bus | `mcp__maestro__team_msg(session_id=<session-id>, ...)` |
43
+ | CLI analysis | `maestro delegate --mode analysis` |
44
+ | CLI write | `maestro delegate --mode write` |
45
+ | Max roles | 5 |
46
+
47
+ ## Role Router
48
+
49
+ This skill is **coordinator-only**. Workers do NOT invoke this skill -- they are spawned as `team-worker` agents directly.
50
+
51
+ ### Input Parsing
52
+
53
+ Parse `$ARGUMENTS`. No `--role` needed -- always routes to coordinator.
54
+
55
+ ### Role Registry
56
+
57
+ Only coordinator is statically registered. All other roles are dynamic, stored as role-specs in session.
58
+
59
+ | Role | File | Type |
60
+ |------|------|------|
61
+ | coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | built-in orchestrator |
62
+ | (dynamic) | `<session>/role-specs/<role-name>.md` | runtime-generated role-spec |
63
+
64
+ ### CLI Tool Usage
65
+
66
+ Workers can use CLI tools for analysis and code operations:
67
+
68
+ | Tool | Purpose |
69
+ |------|---------|
70
+ | maestro delegate --mode analysis | Analysis, exploration, pattern discovery |
71
+ | maestro delegate --mode write | Code generation, modification, refactoring |
72
+
73
+ ### Dispatch
74
+
75
+ Always route to coordinator. Coordinator reads `roles/coordinator/role.md` and executes its phases.
76
+
77
+ ### Orchestration Mode
78
+
79
+ User just provides task description.
80
+
81
+ **Invocation**: `Skill(skill="team-coordinate", args="task description")`
82
+
83
+ **Lifecycle**:
84
+ ```
85
+ User provides task description
86
+ -> coordinator Phase 1: task analysis (detect capabilities, build dependency graph)
87
+ -> coordinator Phase 2: generate role-specs + initialize session
88
+ -> coordinator Phase 3: create task chain from dependency graph
89
+ -> coordinator Phase 4: spawn first batch workers (background) -> STOP
90
+ -> Worker executes -> SendMessage callback -> coordinator advances next step
91
+ -> Loop until pipeline complete -> Phase 5 report + completion action
92
+ ```
93
+
94
+ **User Commands** (wake paused coordinator):
95
+
96
+ | Command | Action |
97
+ |---------|--------|
98
+ | `check` / `status` | Output execution status graph, no advancement |
99
+ | `resume` / `continue` | Check worker states, advance next step |
100
+ | `revise <TASK-ID> [feedback]` | Revise specific task with optional feedback |
101
+ | `feedback <text>` | Inject feedback into active pipeline |
102
+ | `improve [dimension]` | Auto-improve weakest quality dimension |
103
+
104
+ ---
105
+
106
+ ## Coordinator Spawn Template
107
+
108
+ ### v2 Worker Spawn (all roles)
109
+
110
+ When coordinator spawns workers, use `team-worker` agent with role-spec path:
111
+
112
+ ```
113
+ Agent({
114
+ subagent_type: "team-worker",
115
+ description: "Spawn <role> worker",
116
+ team_name: <team-name>,
117
+ name: "<role>",
118
+ run_in_background: true,
119
+ prompt: `## Role Assignment
120
+ role: <role>
121
+ role_spec: <session-folder>/role-specs/<role>.md
122
+ session: <session-folder>
123
+ session_id: <session-id>
124
+ team_name: <team-name>
125
+ requirement: <task-description>
126
+ inner_loop: <true|false>
127
+
128
+ ## Progress Milestones
129
+ session_id: <session-id>
130
+ Report progress via team_msg at natural phase boundaries (context loaded -> core work done -> verification).
131
+ Report blockers immediately via team_msg type="blocker".
132
+ Report completion via team_msg type="task_complete" after final SendMessage.
133
+
134
+ Read role_spec file to load Phase 2-4 domain instructions.
135
+ Execute built-in Phase 1 (task discovery) -> role-spec Phase 2-4 -> built-in Phase 5 (report).`
136
+ })
137
+ ```
138
+
139
+ **Inner Loop roles** (role has 2+ serial same-prefix tasks): Set `inner_loop: true`. The team-worker agent handles the loop internally.
140
+
141
+ **Single-task roles**: Set `inner_loop: false`.
142
+
143
+ ---
144
+
145
+ ## Completion Action
146
+
147
+ When pipeline completes (all tasks done), coordinator presents an interactive choice:
148
+
149
+ ```
150
+ AskUserQuestion({
151
+ questions: [{
152
+ question: "Team pipeline complete. What would you like to do?",
153
+ header: "Completion",
154
+ multiSelect: false,
155
+ options: [
156
+ { label: "Archive & Clean (Recommended)", description: "Archive session, clean up team" },
157
+ { label: "Keep Active", description: "Keep session for follow-up work" },
158
+ { label: "Export Results", description: "Export deliverables to target directory, then clean" }
159
+ ]
160
+ }]
161
+ })
162
+ ```
163
+
164
+ ### Action Handlers
165
+
166
+ | Choice | Steps |
167
+ |--------|-------|
168
+ | Archive & Clean | Update session status="completed" -> TeamDelete -> output final summary with artifact paths |
169
+ | Keep Active | Update session status="paused" -> output: "Resume with: Skill(skill='team-coordinate', args='resume')" |
170
+ | Export Results | AskUserQuestion(target path) -> copy artifacts to target -> Archive & Clean |
171
+
172
+ ---
173
+
174
+ ## Specs Reference
175
+
176
+ | Spec | Purpose |
177
+ |------|---------|
178
+ | [specs/pipelines.md](specs/pipelines.md) | Dynamic pipeline model, task naming, dependency graph |
179
+ | [specs/role-spec-template.md](specs/role-spec-template.md) | Template for dynamic role-spec generation |
180
+ | [specs/quality-gates.md](specs/quality-gates.md) | Quality thresholds and scoring dimensions |
181
+ | [specs/knowledge-transfer.md](specs/knowledge-transfer.md) | Context transfer protocols between roles |
182
+
183
+ ---
184
+
185
+ ## Session Directory
186
+
187
+ ```
188
+ .workflow/.team/TC-<slug>-<date>/
189
+ +-- team-session.json # Session state + dynamic role registry
190
+ +-- task-analysis.json # Phase 1 output: capabilities, dependency graph
191
+ +-- role-specs/ # Dynamic role-spec definitions (generated Phase 2)
192
+ | +-- <role-1>.md # Lightweight: frontmatter + Phase 2-4 only
193
+ | +-- <role-2>.md
194
+ +-- artifacts/ # All MD deliverables from workers
195
+ | +-- <artifact>.md
196
+ +-- .msg/ # Team message bus + state
197
+ | +-- messages.jsonl # Message log
198
+ | +-- meta.json # Session metadata + cross-role state
199
+ +-- wisdom/ # Cross-task knowledge
200
+ | +-- learnings.md
201
+ | +-- decisions.md
202
+ | +-- issues.md
203
+ +-- explorations/ # Shared explore cache
204
+ | +-- cache-index.json
205
+ | +-- explore-<angle>.json
206
+ +-- discussions/ # Inline discuss records
207
+ | +-- <round>.md
208
+ ```
209
+
210
+ ### team-session.json Schema
211
+
212
+ ```json
213
+ {
214
+ "session_id": "TC-<slug>-<date>",
215
+ "task_description": "<original user input>",
216
+ "status": "active | paused | completed",
217
+ "team_name": "<team-name>",
218
+ "roles": [
219
+ {
220
+ "name": "<role-name>",
221
+ "prefix": "<PREFIX>",
222
+ "responsibility_type": "<type>",
223
+ "inner_loop": false,
224
+ "role_spec": "role-specs/<role-name>.md"
225
+ }
226
+ ],
227
+ "pipeline": {
228
+ "dependency_graph": {},
229
+ "tasks_total": 0,
230
+ "tasks_completed": 0
231
+ },
232
+ "active_workers": [],
233
+ "completed_tasks": [],
234
+ "completion_action": "interactive",
235
+ "created_at": "<timestamp>"
236
+ }
237
+ ```
238
+
239
+ ---
240
+
241
+ ## Session Resume
242
+
243
+ Coordinator supports `resume` / `continue` for interrupted sessions:
244
+
245
+ 1. Scan `.workflow/.team/TC-*/team-session.json` for active/paused sessions
246
+ 2. Multiple matches -> AskUserQuestion for selection
247
+ 3. Audit TaskList -> reconcile session state <-> task status
248
+ 4. Reset in_progress -> pending (interrupted tasks)
249
+ 5. Rebuild team and spawn needed workers only
250
+ 6. Create missing tasks, set dependencies via TaskUpdate({ addBlockedBy })
251
+ 7. Kick first executable task -> Phase 4 coordination loop
252
+
253
+ ---
254
+
255
+ ## Error Handling
256
+
257
+ | Scenario | Resolution |
258
+ |----------|------------|
259
+ | Unknown command | Error with available command list |
260
+ | Dynamic role-spec not found | Error, coordinator may need to regenerate |
261
+ | Command file not found | Fallback to inline execution |
262
+ | CLI tool fails | Worker proceeds with direct implementation, logs warning |
263
+ | Explore cache corrupt | Clear cache, re-explore |
264
+ | Fast-advance spawns wrong task | Coordinator reconciles on next callback |
265
+ | capability_gap reported | Coordinator generates new role-spec via handleAdapt |
266
+ | Completion action fails | Default to Keep Active, log warning |