maestro-flow 0.3.10 → 0.3.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 (184) hide show
  1. package/.claude/agents/workflow-collab-planner.md +1 -1
  2. package/.claude/agents/workflow-executor.md +1 -1
  3. package/.claude/agents/workflow-plan-checker.md +1 -1
  4. package/.claude/agents/workflow-planner.md +1 -1
  5. package/.claude/commands/learn-decompose.md +176 -176
  6. package/.claude/commands/learn-follow.md +167 -167
  7. package/.claude/commands/learn-retro.md +1 -1
  8. package/.claude/commands/maestro-coordinate.md +1 -3
  9. package/.claude/commands/manage-harvest.md +131 -131
  10. package/.claude/commands/manage-issue.md +2 -2
  11. package/.claude/commands/spec-add.md +67 -56
  12. package/.claude/commands/spec-load.md +66 -64
  13. package/.claude/commands/spec-setup.md +5 -9
  14. package/.codex/skills/learn-decompose/SKILL.md +119 -0
  15. package/.codex/skills/learn-follow/SKILL.md +83 -0
  16. package/.codex/skills/learn-investigate/SKILL.md +83 -0
  17. package/.codex/skills/learn-retro/SKILL.md +83 -0
  18. package/.codex/skills/learn-second-opinion/SKILL.md +86 -0
  19. package/.codex/skills/maestro/SKILL.md +151 -279
  20. package/.codex/skills/maestro-analyze/SKILL.md +59 -71
  21. package/.codex/skills/maestro-brainstorm/SKILL.md +452 -463
  22. package/.codex/skills/maestro-chain/SKILL.md +95 -110
  23. package/.codex/skills/maestro-coordinate/SKILL.md +68 -234
  24. package/.codex/skills/maestro-execute/SKILL.md +435 -446
  25. package/.codex/skills/maestro-fork/SKILL.md +68 -0
  26. package/.codex/skills/maestro-init/SKILL.md +171 -167
  27. package/.codex/skills/maestro-learn/SKILL.md +80 -0
  28. package/.codex/skills/maestro-link-coordinate/SKILL.md +224 -220
  29. package/.codex/skills/maestro-merge/SKILL.md +62 -0
  30. package/.codex/skills/maestro-milestone-audit/SKILL.md +108 -103
  31. package/.codex/skills/maestro-milestone-complete/SKILL.md +155 -149
  32. package/.codex/skills/maestro-milestone-release/SKILL.md +70 -0
  33. package/.codex/skills/maestro-overlay/SKILL.md +188 -185
  34. package/.codex/skills/maestro-plan/SKILL.md +58 -69
  35. package/.codex/skills/maestro-quick/SKILL.md +26 -23
  36. package/.codex/skills/maestro-roadmap/SKILL.md +65 -73
  37. package/.codex/skills/maestro-spec-generate/SKILL.md +66 -74
  38. package/.codex/skills/maestro-ui-design/SKILL.md +34 -31
  39. package/.codex/skills/maestro-verify/SKILL.md +556 -566
  40. package/.codex/skills/manage-codebase-rebuild/SKILL.md +397 -405
  41. package/.codex/skills/manage-codebase-refresh/SKILL.md +93 -82
  42. package/.codex/skills/manage-harvest/SKILL.md +82 -0
  43. package/.codex/skills/manage-issue/SKILL.md +80 -65
  44. package/.codex/skills/manage-issue-discover/SKILL.md +491 -503
  45. package/.codex/skills/manage-learn/SKILL.md +190 -186
  46. package/.codex/skills/manage-memory/SKILL.md +95 -72
  47. package/.codex/skills/manage-memory-capture/SKILL.md +99 -86
  48. package/.codex/skills/manage-status/SKILL.md +102 -89
  49. package/.codex/skills/quality-business-test/SKILL.md +228 -223
  50. package/.codex/skills/quality-debug/SKILL.md +54 -66
  51. package/.codex/skills/quality-integration-test/SKILL.md +532 -544
  52. package/.codex/skills/quality-refactor/SKILL.md +197 -191
  53. package/.codex/skills/quality-retrospective/SKILL.md +512 -505
  54. package/.codex/skills/quality-review/SKILL.md +93 -105
  55. package/.codex/skills/quality-sync/SKILL.md +101 -89
  56. package/.codex/skills/quality-test/SKILL.md +202 -198
  57. package/.codex/skills/quality-test-gen/SKILL.md +93 -104
  58. package/.codex/skills/spec-add/SKILL.md +58 -39
  59. package/.codex/skills/spec-load/SKILL.md +45 -40
  60. package/.codex/skills/spec-map/SKILL.md +180 -182
  61. package/.codex/skills/spec-setup/SKILL.md +94 -76
  62. package/.codex/skills/team-coordinate/SKILL.md +346 -357
  63. package/.codex/skills/team-executor/SKILL.md +70 -112
  64. package/.codex/skills/team-lifecycle-v4/SKILL.md +311 -299
  65. package/.codex/skills/team-quality-assurance/SKILL.md +234 -227
  66. package/.codex/skills/team-review/SKILL.md +232 -225
  67. package/.codex/skills/team-tech-debt/SKILL.md +78 -100
  68. package/.codex/skills/team-testing/SKILL.md +242 -235
  69. package/.codex/skills/wiki-connect/SKILL.md +75 -0
  70. package/.codex/skills/wiki-digest/SKILL.md +87 -0
  71. package/README.md +7 -4
  72. package/README.zh-CN.md +7 -4
  73. package/dashboard/dist-server/dashboard/src/server/routes/specs.d.ts +1 -1
  74. package/dashboard/dist-server/dashboard/src/server/routes/specs.js +75 -30
  75. package/dashboard/dist-server/dashboard/src/server/routes/specs.js.map +1 -1
  76. package/dashboard/dist-server/dashboard/src/server/state/event-bus.d.ts +5 -0
  77. package/dashboard/dist-server/dashboard/src/server/state/event-bus.js +5 -0
  78. package/dashboard/dist-server/dashboard/src/server/state/event-bus.js.map +1 -1
  79. package/dashboard/dist-server/dashboard/src/shared/constants.js +5 -0
  80. package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
  81. package/dashboard/dist-server/dashboard/src/shared/team-types.d.ts +21 -0
  82. package/dashboard/dist-server/dashboard/src/shared/team-types.js.map +1 -1
  83. package/dashboard/dist-server/dashboard/src/shared/types.d.ts +3 -2
  84. package/dashboard/dist-server/dashboard/src/shared/ws-protocol.d.ts +1 -1
  85. package/dashboard/dist-server/dashboard/src/shared/ws-protocol.js.map +1 -1
  86. package/dashboard/dist-server/src/hooks/constants.d.ts +2 -0
  87. package/dashboard/dist-server/src/hooks/constants.js +2 -0
  88. package/dashboard/dist-server/src/hooks/constants.js.map +1 -1
  89. package/dist/src/commands/collab.js +4 -4
  90. package/dist/src/commands/collab.js.map +1 -1
  91. package/dist/src/commands/hooks.d.ts.map +1 -1
  92. package/dist/src/commands/hooks.js +66 -1
  93. package/dist/src/commands/hooks.js.map +1 -1
  94. package/dist/src/commands/spec.d.ts.map +1 -1
  95. package/dist/src/commands/spec.js +7 -2
  96. package/dist/src/commands/spec.js.map +1 -1
  97. package/dist/src/hooks/constants.d.ts +2 -0
  98. package/dist/src/hooks/constants.d.ts.map +1 -1
  99. package/dist/src/hooks/constants.js +2 -0
  100. package/dist/src/hooks/constants.js.map +1 -1
  101. package/dist/src/hooks/guards/index.d.ts +1 -0
  102. package/dist/src/hooks/guards/index.d.ts.map +1 -1
  103. package/dist/src/hooks/guards/index.js +1 -0
  104. package/dist/src/hooks/guards/index.js.map +1 -1
  105. package/dist/src/hooks/guards/spec-validator.d.ts +25 -0
  106. package/dist/src/hooks/guards/spec-validator.d.ts.map +1 -0
  107. package/dist/src/hooks/guards/spec-validator.js +66 -0
  108. package/dist/src/hooks/guards/spec-validator.js.map +1 -0
  109. package/dist/src/hooks/keyword-spec-injector.d.ts +21 -0
  110. package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -0
  111. package/dist/src/hooks/keyword-spec-injector.js +96 -0
  112. package/dist/src/hooks/keyword-spec-injector.js.map +1 -0
  113. package/dist/src/hooks/plugins/spec-injection-plugin.d.ts +2 -1
  114. package/dist/src/hooks/plugins/spec-injection-plugin.d.ts.map +1 -1
  115. package/dist/src/hooks/plugins/spec-injection-plugin.js +21 -12
  116. package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
  117. package/dist/src/hooks/spec-bridge.d.ts +40 -0
  118. package/dist/src/hooks/spec-bridge.d.ts.map +1 -0
  119. package/dist/src/hooks/spec-bridge.js +97 -0
  120. package/dist/src/hooks/spec-bridge.js.map +1 -0
  121. package/dist/src/hooks/spec-injector.d.ts.map +1 -1
  122. package/dist/src/hooks/spec-injector.js +18 -12
  123. package/dist/src/hooks/spec-injector.js.map +1 -1
  124. package/dist/src/team/phase-orchestrator.d.ts +52 -0
  125. package/dist/src/team/phase-orchestrator.d.ts.map +1 -0
  126. package/dist/src/team/phase-orchestrator.js +165 -0
  127. package/dist/src/team/phase-orchestrator.js.map +1 -0
  128. package/dist/src/team/phase-types.d.ts +51 -0
  129. package/dist/src/team/phase-types.d.ts.map +1 -0
  130. package/dist/src/team/phase-types.js +41 -0
  131. package/dist/src/team/phase-types.js.map +1 -0
  132. package/dist/src/tools/index.d.ts.map +1 -1
  133. package/dist/src/tools/index.js +6 -0
  134. package/dist/src/tools/index.js.map +1 -1
  135. package/dist/src/tools/spec-entry-parser.d.ts +56 -0
  136. package/dist/src/tools/spec-entry-parser.d.ts.map +1 -0
  137. package/dist/src/tools/spec-entry-parser.js +196 -0
  138. package/dist/src/tools/spec-entry-parser.js.map +1 -0
  139. package/dist/src/tools/spec-init.d.ts.map +1 -1
  140. package/dist/src/tools/spec-init.js +66 -92
  141. package/dist/src/tools/spec-init.js.map +1 -1
  142. package/dist/src/tools/spec-keyword-index.d.ts +30 -0
  143. package/dist/src/tools/spec-keyword-index.d.ts.map +1 -0
  144. package/dist/src/tools/spec-keyword-index.js +101 -0
  145. package/dist/src/tools/spec-keyword-index.js.map +1 -0
  146. package/dist/src/tools/spec-loader.d.ts +3 -3
  147. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  148. package/dist/src/tools/spec-loader.js +49 -23
  149. package/dist/src/tools/spec-loader.js.map +1 -1
  150. package/dist/src/tools/team-agents.d.ts +27 -0
  151. package/dist/src/tools/team-agents.d.ts.map +1 -0
  152. package/dist/src/tools/team-agents.js +362 -0
  153. package/dist/src/tools/team-agents.js.map +1 -0
  154. package/dist/src/tools/team-mailbox.d.ts +40 -0
  155. package/dist/src/tools/team-mailbox.d.ts.map +1 -0
  156. package/dist/src/tools/team-mailbox.js +384 -0
  157. package/dist/src/tools/team-mailbox.js.map +1 -0
  158. package/dist/src/tools/team-msg.d.ts +17 -8
  159. package/dist/src/tools/team-msg.d.ts.map +1 -1
  160. package/dist/src/tools/team-msg.js +110 -13
  161. package/dist/src/tools/team-msg.js.map +1 -1
  162. package/dist/src/tools/team-tasks-mcp.d.ts +27 -0
  163. package/dist/src/tools/team-tasks-mcp.d.ts.map +1 -0
  164. package/dist/src/tools/team-tasks-mcp.js +408 -0
  165. package/dist/src/tools/team-tasks-mcp.js.map +1 -0
  166. package/package.json +2 -1
  167. package/workflows/analyze.md +816 -816
  168. package/workflows/brainstorm.md +471 -471
  169. package/workflows/codebase-rebuild.md +332 -332
  170. package/workflows/codebase-refresh.md +240 -240
  171. package/workflows/execute.md +1 -1
  172. package/workflows/harvest.md +420 -420
  173. package/workflows/integration-test.md +343 -343
  174. package/workflows/issue-discover.md +414 -414
  175. package/workflows/map.md +111 -111
  176. package/workflows/milestone-complete.md +176 -176
  177. package/workflows/plan.md +1 -1
  178. package/workflows/quick.md +497 -497
  179. package/workflows/refactor.md +300 -300
  180. package/workflows/roadmap.md +335 -335
  181. package/workflows/spec-generate.md +640 -640
  182. package/workflows/specs-add.md +46 -81
  183. package/workflows/specs-load.md +15 -17
  184. package/workflows/specs-setup.md +40 -161
@@ -1,227 +1,234 @@
1
- ---
2
- name: team-quality-assurance
3
- description: Unified team skill for quality assurance. Full closed-loop QA combining issue discovery and software testing. Triggers on "team quality-assurance", "team qa".
4
- allowed-tools: spawn_agent(*), wait_agent(*), send_message(*), followup_task(*), close_agent(*), list_agents(*), report_agent_job_result(*), request_user_input(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*), mcp__maestro-tools__team_msg(*)
5
- ---
6
-
7
- # Team Quality Assurance
8
-
9
- Orchestrate multi-agent QA: scout -> strategist -> generator -> executor -> analyst. Supports discovery, testing, and full closed-loop modes with parallel generation and GC loops.
10
-
11
- ## Architecture
12
-
13
- ```
14
- Skill(skill="team-quality-assurance", 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
- [scout] [strat] [gen] [exec] [analyst]
30
- team-worker agents, each loads roles/<role>/role.md
31
- ```
32
-
33
- ## Role Registry
34
-
35
- | Role | Path | Prefix | Inner Loop |
36
- |------|------|--------|------------|
37
- | coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | | |
38
- | scout | [roles/scout/role.md](roles/scout/role.md) | SCOUT-* | false |
39
- | strategist | [roles/strategist/role.md](roles/strategist/role.md) | QASTRAT-* | false |
40
- | generator | [roles/generator/role.md](roles/generator/role.md) | QAGEN-* | false |
41
- | executor | [roles/executor/role.md](roles/executor/role.md) | QARUN-* | true |
42
- | analyst | [roles/analyst/role.md](roles/analyst/role.md) | QAANA-* | false |
43
-
44
- ## Role Router
45
-
46
- Parse `$ARGUMENTS`:
47
- - Has `--role <name>` -> Read `roles/<name>/role.md`, execute Phase 2-4
48
- - No `--role` -> `roles/coordinator/role.md`, execute entry router
49
-
50
- ## Delegation Lock
51
-
52
- **Coordinator is a PURE ORCHESTRATOR. It coordinates, it does NOT do.**
53
-
54
- Before calling ANY tool, apply this check:
55
-
56
- | Tool Call | Verdict | Reason |
57
- |-----------|---------|--------|
58
- | `spawn_agent`, `wait_agent`, `close_agent`, `send_message`, `followup_task` | ALLOWED | Orchestration |
59
- | `list_agents` | ALLOWED | Agent health check |
60
- | `request_user_input` | ALLOWED | User interaction |
61
- | `mcp__maestro-tools__team_msg` | ALLOWED | Message bus |
62
- | `Read/Write` on `.workflow/.team/` files | ALLOWED | Session state |
63
- | `Read` on `roles/`, `commands/`, `specs/` | ALLOWED | Loading own instructions |
64
- | `Read/Grep/Glob` on project source code | BLOCKED | Delegate to worker |
65
- | `Edit` on any file outside `.workflow/` | BLOCKED | Delegate to worker |
66
- | `Bash("maestro delegate ...")` | BLOCKED | Only workers call CLI |
67
- | `Bash` running build/test/lint commands | BLOCKED | Delegate to worker |
68
-
69
- **If a tool call is BLOCKED**: STOP. Create a task, spawn a worker.
70
-
71
- **No exceptions for "simple" tasks.** Even a single-file read-and-report MUST go through spawn_agent.
72
-
73
- ---
74
-
75
- ## Shared Constants
76
-
77
- - **Session prefix**: `QA`
78
- - **Session path**: `.workflow/.team/QA-<slug>-<date>/`
79
- - **Team name**: `quality-assurance`
80
- - **CLI tools**: `maestro delegate --mode analysis` (read-only), `maestro delegate --mode write` (modifications)
81
- - **Message bus**: `mcp__maestro-tools__team_msg(session_id=<session-id>, ...)`
82
-
83
- ## Worker Spawn Template
84
-
85
- Coordinator spawns workers using this template:
86
-
87
- ```
88
- spawn_agent({
89
- agent_type: "team_worker",
90
- task_name: "<task-id>",
91
- fork_turns: "none",
92
- message: `## Role Assignment
93
- role: <role>
94
- role_spec: <skill_root>/roles/<role>/role.md
95
- session: <session-folder>
96
- session_id: <session-id>
97
- requirement: <task-description>
98
- inner_loop: <true|false>
99
-
100
- Read role_spec file (<skill_root>/roles/<role>/role.md) to load Phase 2-4 domain instructions.
101
-
102
- ## Task Context
103
- task_id: <task-id>
104
- title: <task-title>
105
- description: <task-description>
106
- pipeline_phase: <pipeline-phase>
107
-
108
- ## Upstream Context
109
- <prev_context>`
110
- })
111
- ```
112
-
113
- After spawning, use `wait_agent({ timeout_ms: 1800000 })` to collect results (30 min). If `result.timed_out`, send STATUS_CHECK via followup_task (wait 3 min), then FINALIZE with interrupt (wait 3 min), then mark timed_out and close agents. Use `close_agent({ target })` each worker.
114
-
115
-
116
- ### Model Selection Guide
117
-
118
- | Role | model | reasoning_effort | Rationale |
119
- |------|-------|-------------------|-----------|
120
- | Scout (SCOUT-*) | (default) | medium | Issue discovery scanning, less reasoning needed |
121
- | Strategist (QASTRAT-*) | (default) | high | Test strategy design requires deep analysis |
122
- | Generator (QAGEN-*) | (default) | high | Test code generation needs precision |
123
- | Executor (QARUN-*) | (default) | medium | Running tests and collecting results |
124
- | Analyst (QAANA-*) | (default) | high | Quality analysis and coverage assessment |
125
-
126
- Override model/reasoning_effort in spawn_agent when cost optimization is needed:
127
- ```
128
- spawn_agent({
129
- agent_type: "team_worker",
130
- task_name: "<task-id>",
131
- fork_turns: "none",
132
- model: "<model-override>",
133
- reasoning_effort: "<effort-level>",
134
- message: "..."
135
- })
136
- ```
137
-
138
- ## User Commands
139
-
140
- | Command | Action |
141
- |---------|--------|
142
- | `check` / `status` | View pipeline status graph |
143
- | `resume` / `continue` | Advance to next step |
144
- | `--mode=discovery` | Force discovery mode |
145
- | `--mode=testing` | Force testing mode |
146
- | `--mode=full` | Force full QA mode |
147
-
148
- ## v4 Agent Coordination
149
-
150
- ### Message Semantics
151
-
152
- | Intent | API | Example |
153
- |--------|-----|---------|
154
- | Send scout findings to running strategist | `send_message` | Queue issue scan results to QASTRAT-* |
155
- | Not used in this skill | `followup_task` | No resident agents -- all workers are one-shot |
156
- | Check running agents | `list_agents` | Verify agent health during resume |
157
-
158
- ### Pipeline Pattern
159
-
160
- Sequential pipeline with GC loops: scout -> strategist -> generator -> executor -> analyst. The executor/generator may loop via GC fix tasks when coverage is below target (max 3 rounds).
161
-
162
- ### Agent Health Check
163
-
164
- Use `list_agents({})` in handleResume and handleComplete:
165
-
166
- ```
167
- // Reconcile session state with actual running agents
168
- const running = list_agents({})
169
- // Compare with tasks.json active_agents
170
- // Reset orphaned tasks (in_progress but agent gone) to pending
171
- ```
172
-
173
- ### Named Agent Targeting
174
-
175
- Workers are spawned with `task_name: "<task-id>"` enabling direct addressing:
176
- - `send_message({ target: "QASTRAT-001", message: "..." })` -- queue scout findings to running strategist
177
- - `close_agent({ target: "SCOUT-001" })` -- cleanup by name after completion
178
-
179
- ## Completion Action
180
-
181
- When pipeline completes, coordinator presents:
182
-
183
- ```
184
- request_user_input({
185
- questions: [{
186
- question: "Quality Assurance pipeline complete. What would you like to do?",
187
- header: "Completion",
188
- multiSelect: false,
189
- options: [
190
- { label: "Archive & Clean (Recommended)", description: "Archive session, clean up" },
191
- { label: "Keep Active", description: "Keep session for follow-up work" },
192
- { label: "Export Results", description: "Export deliverables to target directory" }
193
- ]
194
- }]
195
- })
196
- ```
197
-
198
- ## Session Directory
199
-
200
- ```
201
- .workflow/.team/QA-<slug>-<date>/
202
- ├── .msg/messages.jsonl # Team message bus
203
- ├── .msg/meta.json # Session state + shared memory
204
- ├── wisdom/ # Cross-task knowledge
205
- ├── scan/ # Scout output
206
- ├── strategy/ # Strategist output
207
- ├── tests/ # Generator output (L1/, L2/, L3/)
208
- ├── results/ # Executor output
209
- └── analysis/ # Analyst output
210
- ```
211
-
212
- ## Specs Reference
213
-
214
- - [specs/pipelines.md](specs/pipelines.md) — Pipeline definitions and task registry
215
- - [specs/team-config.json](specs/team-config.json) — Team configuration and shared memory schema
216
-
217
- ## Error Handling
218
-
219
- | Scenario | Resolution |
220
- |----------|------------|
221
- | Unknown --role value | Error with available role list |
222
- | Role not found | Error with expected path (roles/<name>/role.md) |
223
- | CLI tool fails | Worker fallback to direct implementation |
224
- | Scout finds no issues | Report clean scan, skip to testing mode |
225
- | GC loop exceeded | Accept current coverage with warning |
226
- | Fast-advance conflict | Coordinator reconciles on next callback |
227
- | Completion action fails | Default to Keep Active |
1
+ ---
2
+ name: team-quality-assurance
3
+ description: Unified team skill for quality assurance. Full closed-loop QA combining issue discovery and software testing. Triggers on "team quality-assurance", "team qa".
4
+ allowed-tools: spawn_agent(*), wait_agent(*), send_message(*), followup_task(*), close_agent(*), list_agents(*), report_agent_job_result(*), request_user_input(*), Read(*), Write(*), Edit(*), Bash(*), Glob(*), Grep(*), mcp__maestro-tools__team_msg(*)
5
+ ---
6
+
7
+ <purpose>
8
+ Orchestrate multi-agent QA: scout -> strategist -> generator -> executor -> analyst. Supports discovery, testing, and full closed-loop modes with parallel generation and GC loops.
9
+
10
+ ```
11
+ Skill(skill="team-quality-assurance", args="task description")
12
+ |
13
+ SKILL.md (this file) = Router
14
+ |
15
+ +--------------+--------------+
16
+ | |
17
+ no --role flag --role <name>
18
+ | |
19
+ Coordinator Worker
20
+ roles/coordinator/role.md roles/<name>/role.md
21
+ |
22
+ +-- analyze -> dispatch -> spawn workers -> STOP
23
+ |
24
+ +-------+-------+-------+-------+-------+
25
+ v v v v v
26
+ [scout] [strat] [gen] [exec] [analyst]
27
+ team-worker agents, each loads roles/<role>/role.md
28
+ ```
29
+ </purpose>
30
+
31
+ <context>
32
+ ### Role Registry
33
+
34
+ | Role | Path | Prefix | Inner Loop |
35
+ |------|------|--------|------------|
36
+ | coordinator | [roles/coordinator/role.md](roles/coordinator/role.md) | -- | -- |
37
+ | scout | [roles/scout/role.md](roles/scout/role.md) | SCOUT-* | false |
38
+ | strategist | [roles/strategist/role.md](roles/strategist/role.md) | QASTRAT-* | false |
39
+ | generator | [roles/generator/role.md](roles/generator/role.md) | QAGEN-* | false |
40
+ | executor | [roles/executor/role.md](roles/executor/role.md) | QARUN-* | true |
41
+ | analyst | [roles/analyst/role.md](roles/analyst/role.md) | QAANA-* | false |
42
+
43
+ ### Role Router
44
+
45
+ Parse `$ARGUMENTS`:
46
+ - Has `--role <name>` -> Read `roles/<name>/role.md`, execute Phase 2-4
47
+ - No `--role` -> `roles/coordinator/role.md`, execute entry router
48
+
49
+ ### Delegation Lock
50
+
51
+ **Coordinator is a PURE ORCHESTRATOR. It coordinates, it does NOT do.**
52
+
53
+ Before calling ANY tool, apply this check:
54
+
55
+ | Tool Call | Verdict | Reason |
56
+ |-----------|---------|--------|
57
+ | `spawn_agent`, `wait_agent`, `close_agent`, `send_message`, `followup_task` | ALLOWED | Orchestration |
58
+ | `list_agents` | ALLOWED | Agent health check |
59
+ | `request_user_input` | ALLOWED | User interaction |
60
+ | `mcp__maestro-tools__team_msg` | ALLOWED | Message bus |
61
+ | `Read/Write` on `.workflow/.team/` files | ALLOWED | Session state |
62
+ | `Read` on `roles/`, `commands/`, `specs/` | ALLOWED | Loading own instructions |
63
+ | `Read/Grep/Glob` on project source code | BLOCKED | Delegate to worker |
64
+ | `Edit` on any file outside `.workflow/` | BLOCKED | Delegate to worker |
65
+ | `Bash("maestro delegate ...")` | BLOCKED | Only workers call CLI |
66
+ | `Bash` running build/test/lint commands | BLOCKED | Delegate to worker |
67
+
68
+ **If a tool call is BLOCKED**: STOP. Create a task, spawn a worker.
69
+
70
+ **No exceptions for "simple" tasks.** Even a single-file read-and-report MUST go through spawn_agent.
71
+
72
+ ### Shared Constants
73
+
74
+ - **Session prefix**: `QA`
75
+ - **Session path**: `.workflow/.team/QA-<slug>-<date>/`
76
+ - **Team name**: `quality-assurance`
77
+ - **CLI tools**: `maestro delegate --mode analysis` (read-only), `maestro delegate --mode write` (modifications)
78
+ - **Message bus**: `mcp__maestro-tools__team_msg(session_id=<session-id>, ...)`
79
+
80
+ ### Worker Spawn Template
81
+
82
+ Coordinator spawns workers using this template:
83
+
84
+ ```
85
+ spawn_agent({
86
+ agent_type: "team_worker",
87
+ task_name: "<task-id>",
88
+ fork_turns: "none",
89
+ message: `## Role Assignment
90
+ role: <role>
91
+ role_spec: <skill_root>/roles/<role>/role.md
92
+ session: <session-folder>
93
+ session_id: <session-id>
94
+ requirement: <task-description>
95
+ inner_loop: <true|false>
96
+
97
+ Read role_spec file (<skill_root>/roles/<role>/role.md) to load Phase 2-4 domain instructions.
98
+
99
+ ## Task Context
100
+ task_id: <task-id>
101
+ title: <task-title>
102
+ description: <task-description>
103
+ pipeline_phase: <pipeline-phase>
104
+
105
+ ## Upstream Context
106
+ <prev_context>`
107
+ })
108
+ ```
109
+
110
+ After spawning, use `wait_agent({ timeout_ms: 1800000 })` to collect results (30 min). If `result.timed_out`, send STATUS_CHECK via followup_task (wait 3 min), then FINALIZE with interrupt (wait 3 min), then mark timed_out and close agents. Use `close_agent({ target })` each worker.
111
+
112
+ ### Model Selection Guide
113
+
114
+ | Role | model | reasoning_effort | Rationale |
115
+ |------|-------|-------------------|-----------|
116
+ | Scout (SCOUT-*) | (default) | medium | Issue discovery scanning, less reasoning needed |
117
+ | Strategist (QASTRAT-*) | (default) | high | Test strategy design requires deep analysis |
118
+ | Generator (QAGEN-*) | (default) | high | Test code generation needs precision |
119
+ | Executor (QARUN-*) | (default) | medium | Running tests and collecting results |
120
+ | Analyst (QAANA-*) | (default) | high | Quality analysis and coverage assessment |
121
+
122
+ Override model/reasoning_effort in spawn_agent when cost optimization is needed:
123
+ ```
124
+ spawn_agent({
125
+ agent_type: "team_worker",
126
+ task_name: "<task-id>",
127
+ fork_turns: "none",
128
+ model: "<model-override>",
129
+ reasoning_effort: "<effort-level>",
130
+ message: "..."
131
+ })
132
+ ```
133
+
134
+ ### User Commands
135
+
136
+ | Command | Action |
137
+ |---------|--------|
138
+ | `check` / `status` | View pipeline status graph |
139
+ | `resume` / `continue` | Advance to next step |
140
+ | `--mode=discovery` | Force discovery mode |
141
+ | `--mode=testing` | Force testing mode |
142
+ | `--mode=full` | Force full QA mode |
143
+
144
+ ### v4 Agent Coordination
145
+
146
+ #### Message Semantics
147
+
148
+ | Intent | API | Example |
149
+ |--------|-----|---------|
150
+ | Send scout findings to running strategist | `send_message` | Queue issue scan results to QASTRAT-* |
151
+ | Not used in this skill | `followup_task` | No resident agents -- all workers are one-shot |
152
+ | Check running agents | `list_agents` | Verify agent health during resume |
153
+
154
+ #### Pipeline Pattern
155
+
156
+ Sequential pipeline with GC loops: scout -> strategist -> generator -> executor -> analyst. The executor/generator may loop via GC fix tasks when coverage is below target (max 3 rounds).
157
+
158
+ #### Agent Health Check
159
+
160
+ Use `list_agents({})` in handleResume and handleComplete:
161
+
162
+ ```
163
+ // Reconcile session state with actual running agents
164
+ const running = list_agents({})
165
+ // Compare with tasks.json active_agents
166
+ // Reset orphaned tasks (in_progress but agent gone) to pending
167
+ ```
168
+
169
+ #### Named Agent Targeting
170
+
171
+ Workers are spawned with `task_name: "<task-id>"` enabling direct addressing:
172
+ - `send_message({ target: "QASTRAT-001", message: "..." })` -- queue scout findings to running strategist
173
+ - `close_agent({ target: "SCOUT-001" })` -- cleanup by name after completion
174
+
175
+ ### Completion Action
176
+
177
+ When pipeline completes, coordinator presents:
178
+
179
+ ```
180
+ request_user_input({
181
+ questions: [{
182
+ question: "Quality Assurance pipeline complete. What would you like to do?",
183
+ header: "Completion",
184
+ multiSelect: false,
185
+ options: [
186
+ { label: "Archive & Clean (Recommended)", description: "Archive session, clean up" },
187
+ { label: "Keep Active", description: "Keep session for follow-up work" },
188
+ { label: "Export Results", description: "Export deliverables to target directory" }
189
+ ]
190
+ }]
191
+ })
192
+ ```
193
+
194
+ ### Session Directory
195
+
196
+ ```
197
+ .workflow/.team/QA-<slug>-<date>/
198
+ +-- .msg/messages.jsonl # Team message bus
199
+ +-- .msg/meta.json # Session state + shared memory
200
+ +-- wisdom/ # Cross-task knowledge
201
+ +-- scan/ # Scout output
202
+ +-- strategy/ # Strategist output
203
+ +-- tests/ # Generator output (L1/, L2/, L3/)
204
+ +-- results/ # Executor output
205
+ +-- analysis/ # Analyst output
206
+ ```
207
+
208
+ ### Specs Reference
209
+
210
+ - [specs/pipelines.md](specs/pipelines.md) -- Pipeline definitions and task registry
211
+ - [specs/team-config.json](specs/team-config.json) -- Team configuration and shared memory schema
212
+ </context>
213
+
214
+ <error_codes>
215
+
216
+ | Scenario | Resolution |
217
+ |----------|------------|
218
+ | Unknown --role value | Error with available role list |
219
+ | Role not found | Error with expected path (roles/<name>/role.md) |
220
+ | CLI tool fails | Worker fallback to direct implementation |
221
+ | Scout finds no issues | Report clean scan, skip to testing mode |
222
+ | GC loop exceeded | Accept current coverage with warning |
223
+ | Fast-advance conflict | Coordinator reconciles on next callback |
224
+ | Completion action fails | Default to Keep Active |
225
+ </error_codes>
226
+
227
+ <success_criteria>
228
+ - [ ] Role router correctly dispatches to coordinator or worker based on --role flag
229
+ - [ ] Pipeline mode detected (discovery/testing/full) from task description
230
+ - [ ] Scout -> strategist -> generator -> executor -> analyst executed in order
231
+ - [ ] GC loops create fix tasks when coverage is below target (max 3 rounds)
232
+ - [ ] Session state persisted after each pipeline stage
233
+ - [ ] Completion action presented and handled correctly
234
+ </success_criteria>