maestro-flow 0.4.6 → 0.4.8

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 (105) hide show
  1. package/.claude/commands/maestro-ralph.md +548 -377
  2. package/.claude/commands/maestro.md +220 -191
  3. package/.codex/skills/maestro/SKILL.md +495 -462
  4. package/.codex/skills/maestro-collab/SKILL.md +218 -117
  5. package/.codex/skills/maestro-execute/SKILL.md +13 -11
  6. package/.codex/skills/maestro-milestone-audit/SKILL.md +12 -10
  7. package/.codex/skills/maestro-ralph/SKILL.md +491 -339
  8. package/.codex/skills/maestro-ui-codify/SKILL.md +18 -16
  9. package/.codex/skills/manage-codebase-rebuild/SKILL.md +20 -13
  10. package/.codex/skills/manage-issue-discover/SKILL.md +19 -17
  11. package/.codex/skills/quality-debug/SKILL.md +35 -31
  12. package/.codex/skills/quality-refactor/SKILL.md +20 -12
  13. package/.codex/skills/quality-review/SKILL.md +21 -17
  14. package/.codex/skills/team-coordinate/SKILL.md +462 -235
  15. package/.codex/skills/team-coordinate/specs/role-catalog.md +132 -0
  16. package/.codex/skills/team-lifecycle-v4/SKILL.md +445 -191
  17. package/.codex/skills/team-quality-assurance/SKILL.md +205 -161
  18. package/.codex/skills/team-review/SKILL.md +198 -159
  19. package/.codex/skills/team-tech-debt/SKILL.md +214 -144
  20. package/.codex/skills/team-testing/SKILL.md +210 -158
  21. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js +25 -33
  22. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js.map +1 -1
  23. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.test.js +9 -3
  24. package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.test.js.map +1 -1
  25. package/dashboard/dist-server/dashboard/src/server/agents/codex-app-server-adapter.js +5 -2
  26. package/dashboard/dist-server/dashboard/src/server/agents/codex-app-server-adapter.js.map +1 -1
  27. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +20 -8
  28. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
  29. package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.js +6 -3
  30. package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.js.map +1 -1
  31. package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.test.js +7 -1
  32. package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.test.js.map +1 -1
  33. package/dashboard/dist-server/dashboard/src/server/agents/opencode-adapter.d.ts +2 -0
  34. package/dashboard/dist-server/dashboard/src/server/agents/opencode-adapter.js +40 -15
  35. package/dashboard/dist-server/dashboard/src/server/agents/opencode-adapter.js.map +1 -1
  36. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.d.ts +1 -0
  37. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.js +59 -0
  38. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.js.map +1 -0
  39. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.test.d.ts +1 -0
  40. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.test.js +78 -0
  41. package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.test.js.map +1 -0
  42. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.d.ts +25 -0
  43. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.js +40 -0
  44. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.js.map +1 -0
  45. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.test.d.ts +1 -0
  46. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.test.js +89 -0
  47. package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.test.js.map +1 -0
  48. package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js +19 -8
  49. package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js.map +1 -1
  50. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.d.ts +6 -0
  51. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.js +7 -1
  52. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.js.map +1 -1
  53. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.test.d.ts +1 -0
  54. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.test.js +46 -0
  55. package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.test.js.map +1 -0
  56. package/dashboard/dist-server/shared/agent-types.d.ts +6 -0
  57. package/dist/shared/agent-types.d.ts +6 -0
  58. package/dist/shared/agent-types.d.ts.map +1 -1
  59. package/dist/src/agents/cli-agent-runner.d.ts +3 -0
  60. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  61. package/dist/src/agents/cli-agent-runner.js +1 -0
  62. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  63. package/dist/src/commands/delegate.d.ts +2 -0
  64. package/dist/src/commands/delegate.d.ts.map +1 -1
  65. package/dist/src/commands/delegate.js +18 -0
  66. package/dist/src/commands/delegate.js.map +1 -1
  67. package/dist/src/config/cli-tools-config.d.ts +3 -0
  68. package/dist/src/config/cli-tools-config.d.ts.map +1 -1
  69. package/dist/src/config/cli-tools-config.js.map +1 -1
  70. package/package.json +1 -1
  71. package/shared/agent-types.ts +237 -231
  72. package/.codex/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +0 -247
  73. package/.codex/skills/team-coordinate/roles/coordinator/commands/dispatch.md +0 -126
  74. package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +0 -265
  75. package/.codex/skills/team-coordinate/roles/coordinator/role.md +0 -403
  76. package/.codex/skills/team-coordinate/specs/knowledge-transfer.md +0 -113
  77. package/.codex/skills/team-coordinate/specs/pipelines.md +0 -97
  78. package/.codex/skills/team-coordinate/specs/quality-gates.md +0 -112
  79. package/.codex/skills/team-coordinate/specs/role-spec-template.md +0 -192
  80. package/.codex/skills/team-executor/SKILL.md +0 -116
  81. package/.codex/skills/team-executor/roles/executor/commands/monitor.md +0 -213
  82. package/.codex/skills/team-executor/roles/executor/role.md +0 -173
  83. package/.codex/skills/team-executor/specs/session-schema.md +0 -230
  84. package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/analyze.md +0 -56
  85. package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +0 -61
  86. package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +0 -113
  87. package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +0 -189
  88. package/.codex/skills/team-lifecycle-v4/schemas/tasks-schema.md +0 -100
  89. package/.codex/skills/team-lifecycle-v4/specs/knowledge-transfer.md +0 -204
  90. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +0 -72
  91. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +0 -108
  92. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +0 -163
  93. package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +0 -177
  94. package/.codex/skills/team-review/roles/coordinator/commands/analyze.md +0 -71
  95. package/.codex/skills/team-review/roles/coordinator/commands/dispatch.md +0 -90
  96. package/.codex/skills/team-review/roles/coordinator/commands/monitor.md +0 -135
  97. package/.codex/skills/team-review/roles/coordinator/role.md +0 -176
  98. package/.codex/skills/team-tech-debt/roles/coordinator/commands/analyze.md +0 -47
  99. package/.codex/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +0 -163
  100. package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +0 -133
  101. package/.codex/skills/team-tech-debt/roles/coordinator/role.md +0 -173
  102. package/.codex/skills/team-testing/roles/coordinator/commands/analyze.md +0 -70
  103. package/.codex/skills/team-testing/roles/coordinator/commands/dispatch.md +0 -106
  104. package/.codex/skills/team-testing/roles/coordinator/commands/monitor.md +0 -156
  105. package/.codex/skills/team-testing/roles/coordinator/role.md +0 -185
@@ -1,70 +0,0 @@
1
- # Analyze Task
2
-
3
- Parse user task -> detect testing capabilities -> select pipeline -> design roles.
4
-
5
- **CONSTRAINT**: Text-level analysis only. NO source code reading, NO codebase exploration.
6
-
7
- ## Signal Detection
8
-
9
- | Keywords | Capability | Prefix |
10
- |----------|------------|--------|
11
- | strategy, plan, layers, scope | strategist | STRATEGY |
12
- | generate tests, write tests, create tests | generator | TESTGEN |
13
- | run tests, execute, coverage | executor | TESTRUN |
14
- | analyze, report, quality, defects | analyst | TESTANA |
15
-
16
- ## Pipeline Mode Detection
17
-
18
- | Condition | Pipeline |
19
- |-----------|----------|
20
- | fileCount <= 3 AND moduleCount <= 1 | targeted |
21
- | fileCount <= 10 AND moduleCount <= 3 | standard |
22
- | Otherwise | comprehensive |
23
-
24
- ## Dependency Graph
25
-
26
- Natural ordering for testing pipeline:
27
- - Tier 0: strategist (change analysis, no upstream dependency)
28
- - Tier 1: generator (requires strategy)
29
- - Tier 2: executor (requires generated tests; GC loop with generator)
30
- - Tier 3: analyst (requires execution results)
31
-
32
- ## Pipeline Definitions
33
-
34
- ```
35
- Targeted: STRATEGY -> TESTGEN(L1) -> TESTRUN(L1)
36
- Standard: STRATEGY -> TESTGEN(L1) -> TESTRUN(L1) -> TESTGEN(L2) -> TESTRUN(L2) -> TESTANA
37
- Comprehensive: STRATEGY -> [TESTGEN(L1) || TESTGEN(L2)] -> [TESTRUN(L1) || TESTRUN(L2)] -> TESTGEN(L3) -> TESTRUN(L3) -> TESTANA
38
- ```
39
-
40
- ## Complexity Scoring
41
-
42
- | Factor | Points |
43
- |--------|--------|
44
- | Per test layer | +1 |
45
- | Parallel tracks | +1 per track |
46
- | GC loop enabled | +1 |
47
- | Serial depth > 3 | +1 |
48
-
49
- Results: 1-2 Low, 3-5 Medium, 6+ High
50
-
51
- ## Role Minimization
52
-
53
- - Cap at 5 roles (coordinator + 4 workers)
54
- - GC loop: generator <-> executor iterate up to 3 rounds per layer
55
-
56
- ## Output
57
-
58
- Write <session>/task-analysis.json:
59
- ```json
60
- {
61
- "task_description": "<original>",
62
- "pipeline_mode": "<targeted|standard|comprehensive>",
63
- "capabilities": [{ "name": "<cap>", "prefix": "<PREFIX>", "keywords": ["..."] }],
64
- "dependency_graph": { "<TASK-ID>": { "role": "<role>", "blockedBy": ["..."], "layer": "L1|L2|L3" } },
65
- "roles": [{ "name": "<role>", "prefix": "<PREFIX>", "inner_loop": true }],
66
- "complexity": { "score": 0, "level": "Low|Medium|High" },
67
- "coverage_targets": { "L1": 80, "L2": 60, "L3": 40 },
68
- "gc_loop_enabled": true
69
- }
70
- ```
@@ -1,106 +0,0 @@
1
- # Dispatch Tasks
2
-
3
- Create testing task chains with correct dependencies. Supports targeted, standard, and comprehensive pipelines.
4
-
5
- ## Workflow
6
-
7
- 1. Read task-analysis.json -> extract pipeline_mode and dependency_graph
8
- 2. Read specs/pipelines.md -> get task registry for selected pipeline
9
- 3. Topological sort tasks (respect deps)
10
- 4. Validate all owners exist in role registry (SKILL.md)
11
- 5. For each task (in order):
12
- - Add task entry to tasks.json `tasks` object (see template below)
13
- - Set deps array with upstream task IDs
14
- 6. Update tasks.json metadata: total count
15
- 7. Validate chain (no orphans, no cycles, all refs valid)
16
-
17
- ## Task Entry Template
18
-
19
- Each task in tasks.json `tasks` object:
20
- ```json
21
- {
22
- "<TASK-ID>": {
23
- "title": "<concise title>",
24
- "description": "PURPOSE: <goal> | Success: <criteria>\nTASK:\n - <step 1>\n - <step 2>\nCONTEXT:\n - Session: <session-folder>\n - Scope: <scope>\n - Layer: <L1-unit|L2-integration|L3-e2e>\n - Upstream artifacts: <artifact-1>, <artifact-2>\n - Shared memory: <session>/wisdom/.msg/meta.json\nEXPECTED: <deliverable path> + <quality criteria>\nCONSTRAINTS: <scope limits, focus areas>\n---\nInnerLoop: <true|false>\nRoleSpec: <project>/.codex/skills/team-testing/roles/<role>/role.md",
25
- "role": "<role-name>",
26
- "prefix": "<PREFIX>",
27
- "deps": ["<upstream-task-id>"],
28
- "status": "pending",
29
- "findings": null,
30
- "error": null
31
- }
32
- }
33
- ```
34
-
35
- ## Pipeline Task Registry
36
-
37
- ### Targeted Pipeline
38
- ```
39
- STRATEGY-001 (strategist): Analyze change scope, define test strategy
40
- deps: []
41
- TESTGEN-001 (generator): Generate L1 unit tests
42
- deps: [STRATEGY-001], meta: layer=L1-unit
43
- TESTRUN-001 (executor): Execute L1 tests, collect coverage
44
- deps: [TESTGEN-001], inner_loop: true, meta: layer=L1-unit, coverage_target=80%
45
- ```
46
-
47
- ### Standard Pipeline
48
- ```
49
- STRATEGY-001 (strategist): Analyze change scope, define test strategy
50
- deps: []
51
- TESTGEN-001 (generator): Generate L1 unit tests
52
- deps: [STRATEGY-001], meta: layer=L1-unit
53
- TESTRUN-001 (executor): Execute L1 tests, collect coverage
54
- deps: [TESTGEN-001], inner_loop: true, meta: layer=L1-unit, coverage_target=80%
55
- TESTGEN-002 (generator): Generate L2 integration tests
56
- deps: [TESTRUN-001], meta: layer=L2-integration
57
- TESTRUN-002 (executor): Execute L2 tests, collect coverage
58
- deps: [TESTGEN-002], inner_loop: true, meta: layer=L2-integration, coverage_target=60%
59
- TESTANA-001 (analyst): Defect pattern analysis, quality report
60
- deps: [TESTRUN-002]
61
- ```
62
-
63
- ### Comprehensive Pipeline
64
- ```
65
- STRATEGY-001 (strategist): Analyze change scope, define test strategy
66
- deps: []
67
- TESTGEN-001 (generator-1): Generate L1 unit tests
68
- deps: [STRATEGY-001], meta: layer=L1-unit
69
- TESTGEN-002 (generator-2): Generate L2 integration tests
70
- deps: [STRATEGY-001], meta: layer=L2-integration
71
- TESTRUN-001 (executor-1): Execute L1 tests, collect coverage
72
- deps: [TESTGEN-001], inner_loop: true, meta: layer=L1-unit, coverage_target=80%
73
- TESTRUN-002 (executor-2): Execute L2 tests, collect coverage
74
- deps: [TESTGEN-002], inner_loop: true, meta: layer=L2-integration, coverage_target=60%
75
- TESTGEN-003 (generator): Generate L3 E2E tests
76
- deps: [TESTRUN-001, TESTRUN-002], meta: layer=L3-e2e
77
- TESTRUN-003 (executor): Execute L3 tests, collect coverage
78
- deps: [TESTGEN-003], inner_loop: true, meta: layer=L3-e2e, coverage_target=40%
79
- TESTANA-001 (analyst): Defect pattern analysis, quality report
80
- deps: [TESTRUN-003]
81
- ```
82
-
83
- ## InnerLoop Flag Rules
84
-
85
- - true: generator, executor roles (GC loop iterations)
86
- - false: strategist, analyst roles
87
-
88
- ## Dependency Validation
89
-
90
- - No orphan tasks (all tasks have valid owner)
91
- - No circular dependencies
92
- - All deps references exist in tasks object
93
- - Session reference in every task description
94
- - RoleSpec reference in every task description
95
-
96
- ## Log After Creation
97
-
98
- ```
99
- mcp__maestro-tools__team_msg({
100
- operation: "log",
101
- session_id: <session-id>,
102
- from: "coordinator",
103
- type: "pipeline_selected",
104
- data: { pipeline: "<mode>", task_count: <N> }
105
- })
106
- ```
@@ -1,156 +0,0 @@
1
- # Monitor Pipeline
2
-
3
- Synchronous pipeline coordination using spawn_agent + wait_agent.
4
-
5
- ## Constants
6
-
7
- - WORKER_AGENT: team_worker
8
- - ONE_STEP_PER_INVOCATION: false (synchronous wait loop)
9
- - FAST_ADVANCE_AWARE: true
10
- - MAX_GC_ROUNDS: 3
11
-
12
- ## Handler Router
13
-
14
- | Source | Handler |
15
- |--------|---------|
16
- | "capability_gap" | handleAdapt |
17
- | "check" or "status" | handleCheck |
18
- | "resume" or "continue" | handleResume |
19
- | All tasks completed | handleComplete |
20
- | Default | handleSpawnNext |
21
-
22
- ## Role-Worker Map
23
-
24
- | Prefix | Role | Role Spec | inner_loop |
25
- |--------|------|-----------|------------|
26
- | STRATEGY-* | strategist | `<project>/.codex/skills/team-testing/roles/strategist/role.md` | false |
27
- | TESTGEN-* | generator | `<project>/.codex/skills/team-testing/roles/generator/role.md` | true |
28
- | TESTRUN-* | executor | `<project>/.codex/skills/team-testing/roles/executor/role.md` | true |
29
- | TESTANA-* | analyst | `<project>/.codex/skills/team-testing/roles/analyst/role.md` | false |
30
-
31
- ## handleCheck
32
-
33
- Read-only status report from tasks.json, then STOP.
34
-
35
- Read tasks.json + team_msg (type="progress", last=50) + team_msg (type="blocker", last=10). Count tasks by status.
36
-
37
- **Output format**:
38
- ```
39
- [coordinator] Testing Pipeline Status — Mode: <pipeline_mode> — Progress: <done>/<total> (<pct>%)
40
- [coordinator] GC Rounds: L1: <n>/3, L2: <n>/3
41
- [coordinator] Pipeline Graph: <task_id>: <done|run|wait> <description> (per task)
42
- [coordinator] Active Workers: <task_id> <role> <milestone_phase> <pct>% "<summary>" <time_ago>
43
- [coordinator] Blockers: <task_id> <role> "<blocker_summary>" <time_ago> (omit if none)
44
- [coordinator] Ready: <pending tasks with resolved deps>
45
- [coordinator] Commands: 'resume' to advance | 'check' to refresh
46
- ```
47
-
48
- **CLI monitoring**: `maestro agent-msg list -s "<session_id>" --type progress --last 10`
49
-
50
- Then STOP.
51
-
52
- ## handleResume
53
-
54
- **Agent Health Check** (v4): Cross-check `list_agents()` against `active_agents`. Missing agents -> reset task to pending.
55
-
56
- ```
57
- Load active_agents -> route:
58
- none -> handleSpawnNext
59
- has agents -> classify each: completed | in_progress
60
- some completed -> handleSpawnNext
61
- all running -> report status -> STOP
62
- ```
63
-
64
- ## handleSpawnNext
65
-
66
- Find ready tasks, spawn workers, wait for completion, process results.
67
-
68
- ```
69
- Classify tasks: completed | in_progress | ready (pending + all deps completed)
70
-
71
- Ready tasks -> route:
72
- none + in_progress exists -> report waiting, STOP
73
- none + nothing in_progress -> handleComplete
74
- has ready -> for each:
75
- determine role from prefix (Role-Worker Map)
76
- skip if inner loop role (generator/executor) already has active worker
77
- else: set status="in_progress", log task_unblocked, spawn team_worker, add to active_agents
78
- ```
79
-
80
- **Spawn worker message template**:
81
- ```
82
- ## Role Assignment
83
- role: <role> | role_spec: <skillRoot>/roles/<role>/role.md
84
- session: <session-folder> | session_id: <session-id> | team_name: testing
85
- requirement: <task-description> | inner_loop: <true for generator/executor>
86
- ## Current Task
87
- task_id: <taskId> | title: <task-title>
88
- Read role_spec for Phase 2-4 instructions. Execute Phase 1 -> role Phase 2-4 -> Phase 5 (report).
89
- ## Task Context + Upstream Context
90
- <task description + prevContext>
91
- ## Progress Milestones
92
- Report progress via team_msg at phase boundaries. Blockers via type="blocker". Completion via type="task_complete" after report_agent_job_result.
93
- ```
94
-
95
- **Parallel spawn**: Multiple unblocked TESTGEN-* or TESTRUN-* tasks spawn in parallel.
96
-
97
- ### Wait and Process Results
98
-
99
- `wait_agent({ timeout_ms: 1800000 })` (30 min), drain progress from team_msg.
100
-
101
- **Timeout escalation**: STATUS_CHECK (3 min) -> FINALIZE with interrupt (3 min) -> mark timed_out with last progress context, close_agent. Normal completion -> mark completed, close_agent (use task_name, not agentId).
102
-
103
- ### GC Checkpoint (TESTRUN-* completes)
104
-
105
- After TESTRUN-* completion, read meta.json for executor.pass_rate and executor.coverage:
106
- - (pass_rate >= 0.95 AND coverage >= target) OR gc_rounds[layer] >= MAX_GC_ROUNDS -> proceed
107
- - (pass_rate < 0.95 OR coverage < target) AND gc_rounds[layer] < MAX_GC_ROUNDS -> create GC fix tasks, increment gc_rounds[layer]
108
-
109
- **GC Fix Task Creation** (when coverage below target): Add paired tasks to tasks.json:
110
- - `TESTGEN-<layer>-fix-<round>` (role: generator, inner_loop: true) — revise tests to fix failures and improve coverage
111
- - `TESTRUN-<layer>-fix-<round>` (role: executor, deps: [TESTGEN-fix], inner_loop: true) — re-execute revised tests
112
-
113
- Increment `gc_rounds[layer]++`.
114
-
115
- **Cross-Agent Supplementary Context** (v4): Use `send_message` (not `followup_task`) to deliver upstream results to running downstream workers as non-interrupting supplementary context.
116
-
117
- ### Persist and Loop
118
-
119
- Write tasks.json -> more tasks ready? -> loop handleSpawnNext. All done -> handleComplete. Blocked -> report, STOP.
120
-
121
- ## handleComplete
122
-
123
- **Cleanup Verification** (v4): `list_agents()` -> close any still-running team agents.
124
-
125
- Pipeline done. Verify all tasks (including GC fix tasks) completed/failed. Incomplete -> handleSpawnNext. All complete -> read meta.json (quality_score, coverage, gc_rounds), generate summary.
126
-
127
- Route by completion_action: interactive (Archive/Keep/Deepen Coverage) | auto_archive | auto_keep.
128
-
129
- ## handleAdapt
130
-
131
- Capability gap reported mid-pipeline.
132
-
133
- 1. Parse gap description
134
- 2. Check if existing role covers it -> redirect
135
- 3. Role count < 5 -> generate dynamic role-spec in <session>/role-specs/
136
- 4. Add new task to tasks.json, spawn worker via spawn_agent + wait_agent
137
- 5. Role count >= 5 -> merge or pause
138
-
139
- ## Fast-Advance Reconciliation
140
-
141
- On every wake: sync `fast_advance` messages from team_msg into active_agents. No duplicate spawns.
142
-
143
- ## Phase 4: State Persistence
144
-
145
- After every handler: reconcile active_agents with tasks.json, remove completed/failed entries, write tasks.json, STOP.
146
-
147
- ## Error Handling
148
-
149
- | Scenario | Resolution |
150
- |----------|------------|
151
- | Session file not found | Error, suggest re-initialization |
152
- | Unknown role in callback | Log info, scan for other completions |
153
- | GC loop exceeded (3 rounds) | Accept current coverage with warning, proceed |
154
- | Pipeline stall | Check deps chains, report to user |
155
- | Coverage tool unavailable | Degrade to pass rate judgment |
156
- | Worker crash | Reset task to pending in tasks.json, respawn via spawn_agent |
@@ -1,185 +0,0 @@
1
- # Coordinator Role
2
-
3
- Orchestrate team-testing: analyze -> dispatch -> spawn -> monitor -> report.
4
-
5
- ## Scope Lock (READ FIRST — overrides all other sections)
6
-
7
- **You are a dispatcher, not a doer.** Your ONLY outputs are:
8
- - Session state files (`.workflow/.team/` directory)
9
- - `spawn_agent` / `wait_agent` / `close_agent` / `send_message` / `followup_task` calls
10
- - Status reports to the user / `request_user_input` prompts
11
-
12
- **FORBIDDEN** (even if the task seems trivial):
13
- ```
14
- WRONG: Read/Grep/Glob on project source code — worker work
15
- WRONG: Bash("maestro delegate ...") — worker work
16
- WRONG: Bash("npm test"), Bash("jest"), etc. — worker work
17
- WRONG: Edit/Write on test or source files — worker work
18
- ```
19
-
20
- **Self-check gate**: Before ANY tool call, ask: "Is this orchestration or project work? If project work → STOP → spawn worker."
21
-
22
- ---
23
-
24
- ## Identity
25
- - Name: coordinator | Tag: [coordinator]
26
- - Responsibility: Change scope analysis -> Create session -> Dispatch tasks -> Monitor progress -> Report results
27
-
28
- ## Boundaries
29
-
30
- ### MUST
31
- - Spawn workers via `spawn_agent({ agent_type: "team_worker" })` and wait via `wait_agent`
32
- - Follow Command Execution Protocol for dispatch and monitor commands
33
- - Respect pipeline stage dependencies (deps)
34
- - Handle Generator-Critic cycles with max 3 iterations per layer
35
- - Execute completion action in Phase 5
36
- - **Always proceed through full Phase 1-5 workflow, never skip to direct execution**
37
- - Use `send_message` for supplementary context (non-interrupting) and `followup_task` for triggering new work
38
- - Use `list_agents` for session resume health checks and cleanup verification
39
-
40
- ### MUST NOT
41
- - Implement domain logic (test generation, execution, analysis) -- workers handle this
42
- - Spawn workers without creating tasks first
43
- - Skip quality gates when coverage is below target
44
- - Modify test files or source code directly -- delegate to workers
45
- - Force-advance pipeline past failed GC loops
46
- - Call CLI tools (maestro delegate) — only workers use CLI
47
-
48
- ## Command Execution Protocol
49
- When coordinator needs to execute a specific phase:
50
- 1. Read `commands/<command>.md`
51
- 2. Follow the workflow defined in the command
52
- 3. Commands are inline execution guides, NOT separate agents
53
- 4. Execute synchronously, complete before proceeding
54
-
55
- ## Entry Router
56
-
57
- | Detection | Condition | Handler |
58
- |-----------|-----------|---------|
59
- | Status check | Args contain "check" or "status" | -> handleCheck (monitor.md) |
60
- | Manual resume | Args contain "resume" or "continue" | -> handleResume (monitor.md) |
61
- | Capability gap | Message contains "capability_gap" | -> handleAdapt (monitor.md) |
62
- | Pipeline complete | All tasks completed | -> handleComplete (monitor.md) |
63
- | Interrupted session | Active session in .workflow/.team/TST-* | -> Phase 0 |
64
- | New session | None of above | -> Phase 1 |
65
-
66
- For check/resume/adapt/complete: load @commands/monitor.md, execute handler, STOP.
67
-
68
- ## Phase 0: Session Resume Check
69
-
70
- 1. Scan .workflow/.team/TST-*/tasks.json for active/paused sessions
71
- 2. No sessions -> Phase 1
72
- 3. Single session -> reconcile:
73
- a. Read tasks.json, reset in_progress -> pending
74
- b. Rebuild active_agents map
75
- c. Kick first ready task via handleSpawnNext
76
- 4. Multiple -> request_user_input for selection
77
-
78
- ## Phase 1: Requirement Clarification
79
-
80
- TEXT-LEVEL ONLY. No source code reading.
81
-
82
- 1. Parse task description from $ARGUMENTS
83
- 2. Analyze change scope:
84
- ```
85
- Bash("git diff --name-only HEAD~1 2>/dev/null || git diff --name-only --cached")
86
- ```
87
- 3. Select pipeline:
88
-
89
- | Condition | Pipeline |
90
- |-----------|----------|
91
- | fileCount <= 3 AND moduleCount <= 1 | targeted |
92
- | fileCount <= 10 AND moduleCount <= 3 | standard |
93
- | Otherwise | comprehensive |
94
-
95
- 4. Clarify if ambiguous (request_user_input for scope)
96
- 5. Delegate to @commands/analyze.md
97
- 6. Output: task-analysis.json
98
- 7. CRITICAL: Always proceed to Phase 2, never skip team workflow
99
-
100
- ## Phase 2: Create Session + Initialize
101
-
102
- 1. Resolve workspace paths (MUST do first):
103
- - `project_root` = result of `Bash({ command: "pwd" })`
104
- - `skill_root` = `<project_root>/.codex/skills/team-testing`
105
- 2. Generate session ID: TST-<slug>-<date>
106
- 3. Create session folder structure:
107
- ```bash
108
- mkdir -p .workflow/.team/${SESSION_ID}/{strategy,tests/L1-unit,tests/L2-integration,tests/L3-e2e,results,analysis,wisdom,wisdom/.msg}
109
- ```
110
- 4. Read specs/pipelines.md -> select pipeline based on mode
111
- 5. Initialize pipeline via team_msg state_update:
112
- ```
113
- mcp__maestro-tools__team_msg({
114
- operation: "log", session_id: "<id>", from: "coordinator",
115
- type: "state_update", summary: "Session initialized",
116
- data: {
117
- pipeline_mode: "<targeted|standard|comprehensive>",
118
- pipeline_stages: ["strategist", "generator", "executor", "analyst"],
119
- team_name: "testing",
120
- coverage_targets: { "L1": 80, "L2": 60, "L3": 40 },
121
- gc_rounds: {}
122
- }
123
- })
124
- ```
125
- 6. Write initial tasks.json:
126
- ```json
127
- {
128
- "session_id": "<id>",
129
- "pipeline": "<targeted|standard|comprehensive>",
130
- "requirement": "<original requirement>",
131
- "created_at": "<ISO timestamp>",
132
- "coverage_targets": { "L1": 80, "L2": 60, "L3": 40 },
133
- "gc_rounds": {},
134
- "completed_waves": [],
135
- "active_agents": {},
136
- "tasks": {}
137
- }
138
- ```
139
-
140
- ## Phase 3: Create Task Chain
141
-
142
- Delegate to @commands/dispatch.md:
143
- 1. Read specs/pipelines.md for selected pipeline's task registry
144
- 2. Topological sort tasks
145
- 3. Write tasks to tasks.json with deps arrays
146
- 4. Update tasks.json metadata
147
-
148
- ## Phase 4: Spawn-and-Wait
149
-
150
- Delegate to @commands/monitor.md#handleSpawnNext:
151
- 1. Find ready tasks (pending + deps resolved)
152
- 2. Spawn team_worker agents via spawn_agent
153
- 3. Wait for completion via wait_agent
154
- 4. Process results, advance pipeline
155
- 5. Repeat until all waves complete or pipeline blocked
156
-
157
- ## Phase 5: Report + Completion Action
158
-
159
- 1. Generate summary (deliverables, pipeline stats, GC rounds, coverage metrics)
160
- 2. Execute completion action per tasks.json completion_action:
161
- - interactive -> request_user_input (Archive/Keep/Deepen Coverage)
162
- - auto_archive -> Archive & Clean (rm -rf session folder)
163
- - auto_keep -> Keep Active
164
-
165
- ## v4 Coordination Patterns
166
-
167
- ### Message Semantics
168
- - **send_message**: Queue supplementary info to a running agent. Does NOT interrupt current processing. Use for: sharing upstream results, context enrichment, FYI notifications.
169
- - **followup_task**: Assign new work and trigger processing. Use for: waking idle agents, redirecting work, requesting new output, and status probing on timeout (STATUS_CHECK / FINALIZE cascade before closing timed-out agents).
170
-
171
- ### Agent Lifecycle Management
172
- - **list_agents({})**: Returns all running agents. Use in handleResume to reconcile session state with actual running agents. Use in handleComplete to verify clean shutdown.
173
- - **Named targeting**: Workers spawned with `task_name: "<task-id>"` can be addressed by name in send_message, followup_task, and close_agent calls.
174
- - **Close agents promptly**: Call `close_agent` immediately after collecting a worker's result — do NOT leave completed agents running. Idle agents waste resources. At pipeline end, verify all agents closed via `list_agents`.
175
-
176
- ## Error Handling
177
-
178
- | Error | Resolution |
179
- |-------|------------|
180
- | Task too vague | request_user_input for clarification |
181
- | Session corruption | Attempt recovery, fallback to manual |
182
- | Worker crash | Reset task to pending in tasks.json, respawn via spawn_agent |
183
- | Dependency cycle | Detect in analysis, halt |
184
- | GC loop exceeded (3 rounds) | Accept current coverage, log to wisdom, proceed |
185
- | Coverage tool unavailable | Degrade to pass rate judgment |