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.
- package/.claude/commands/maestro-ralph.md +548 -377
- package/.claude/commands/maestro.md +220 -191
- package/.codex/skills/maestro/SKILL.md +495 -462
- package/.codex/skills/maestro-collab/SKILL.md +218 -117
- package/.codex/skills/maestro-execute/SKILL.md +13 -11
- package/.codex/skills/maestro-milestone-audit/SKILL.md +12 -10
- package/.codex/skills/maestro-ralph/SKILL.md +491 -339
- package/.codex/skills/maestro-ui-codify/SKILL.md +18 -16
- package/.codex/skills/manage-codebase-rebuild/SKILL.md +20 -13
- package/.codex/skills/manage-issue-discover/SKILL.md +19 -17
- package/.codex/skills/quality-debug/SKILL.md +35 -31
- package/.codex/skills/quality-refactor/SKILL.md +20 -12
- package/.codex/skills/quality-review/SKILL.md +21 -17
- package/.codex/skills/team-coordinate/SKILL.md +462 -235
- package/.codex/skills/team-coordinate/specs/role-catalog.md +132 -0
- package/.codex/skills/team-lifecycle-v4/SKILL.md +445 -191
- package/.codex/skills/team-quality-assurance/SKILL.md +205 -161
- package/.codex/skills/team-review/SKILL.md +198 -159
- package/.codex/skills/team-tech-debt/SKILL.md +214 -144
- package/.codex/skills/team-testing/SKILL.md +210 -158
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js +25 -33
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.test.js +9 -3
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.test.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/codex-app-server-adapter.js +5 -2
- package/dashboard/dist-server/dashboard/src/server/agents/codex-app-server-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +20 -8
- package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.js +6 -3
- package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.test.js +7 -1
- package/dashboard/dist-server/dashboard/src/server/agents/gemini-a2a-adapter.test.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/opencode-adapter.d.ts +2 -0
- package/dashboard/dist-server/dashboard/src/server/agents/opencode-adapter.js +40 -15
- package/dashboard/dist-server/dashboard/src/server/agents/opencode-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.d.ts +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.js +59 -0
- package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.js.map +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.test.d.ts +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.test.js +78 -0
- package/dashboard/dist-server/dashboard/src/server/agents/process-tree-kill.test.js.map +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.d.ts +25 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.js +40 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.js.map +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.test.d.ts +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.test.js +89 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stale-handler.test.js.map +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js +19 -8
- package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.d.ts +6 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.js +7 -1
- package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.test.d.ts +1 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.test.js +46 -0
- package/dashboard/dist-server/dashboard/src/server/agents/stream-monitor.test.js.map +1 -0
- package/dashboard/dist-server/shared/agent-types.d.ts +6 -0
- package/dist/shared/agent-types.d.ts +6 -0
- package/dist/shared/agent-types.d.ts.map +1 -1
- package/dist/src/agents/cli-agent-runner.d.ts +3 -0
- package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
- package/dist/src/agents/cli-agent-runner.js +1 -0
- package/dist/src/agents/cli-agent-runner.js.map +1 -1
- package/dist/src/commands/delegate.d.ts +2 -0
- package/dist/src/commands/delegate.d.ts.map +1 -1
- package/dist/src/commands/delegate.js +18 -0
- package/dist/src/commands/delegate.js.map +1 -1
- package/dist/src/config/cli-tools-config.d.ts +3 -0
- package/dist/src/config/cli-tools-config.d.ts.map +1 -1
- package/dist/src/config/cli-tools-config.js.map +1 -1
- package/package.json +1 -1
- package/shared/agent-types.ts +237 -231
- package/.codex/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +0 -247
- package/.codex/skills/team-coordinate/roles/coordinator/commands/dispatch.md +0 -126
- package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +0 -265
- package/.codex/skills/team-coordinate/roles/coordinator/role.md +0 -403
- package/.codex/skills/team-coordinate/specs/knowledge-transfer.md +0 -113
- package/.codex/skills/team-coordinate/specs/pipelines.md +0 -97
- package/.codex/skills/team-coordinate/specs/quality-gates.md +0 -112
- package/.codex/skills/team-coordinate/specs/role-spec-template.md +0 -192
- package/.codex/skills/team-executor/SKILL.md +0 -116
- package/.codex/skills/team-executor/roles/executor/commands/monitor.md +0 -213
- package/.codex/skills/team-executor/roles/executor/role.md +0 -173
- package/.codex/skills/team-executor/specs/session-schema.md +0 -230
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/analyze.md +0 -56
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +0 -61
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +0 -113
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +0 -189
- package/.codex/skills/team-lifecycle-v4/schemas/tasks-schema.md +0 -100
- package/.codex/skills/team-lifecycle-v4/specs/knowledge-transfer.md +0 -204
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +0 -72
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +0 -108
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +0 -163
- package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +0 -177
- package/.codex/skills/team-review/roles/coordinator/commands/analyze.md +0 -71
- package/.codex/skills/team-review/roles/coordinator/commands/dispatch.md +0 -90
- package/.codex/skills/team-review/roles/coordinator/commands/monitor.md +0 -135
- package/.codex/skills/team-review/roles/coordinator/role.md +0 -176
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/analyze.md +0 -47
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +0 -163
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +0 -133
- package/.codex/skills/team-tech-debt/roles/coordinator/role.md +0 -173
- package/.codex/skills/team-testing/roles/coordinator/commands/analyze.md +0 -70
- package/.codex/skills/team-testing/roles/coordinator/commands/dispatch.md +0 -106
- package/.codex/skills/team-testing/roles/coordinator/commands/monitor.md +0 -156
- package/.codex/skills/team-testing/roles/coordinator/role.md +0 -185
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
# Monitor Pipeline
|
|
2
|
-
|
|
3
|
-
Event-driven pipeline coordination. Beat model: coordinator wake -> process -> spawn -> STOP.
|
|
4
|
-
|
|
5
|
-
## Constants
|
|
6
|
-
|
|
7
|
-
- SPAWN_MODE: background
|
|
8
|
-
- ONE_STEP_PER_INVOCATION: true
|
|
9
|
-
- FAST_ADVANCE_AWARE: true
|
|
10
|
-
- WORKER_AGENT: team-worker
|
|
11
|
-
- MAX_GC_ROUNDS: 3
|
|
12
|
-
|
|
13
|
-
## Handler Router
|
|
14
|
-
|
|
15
|
-
| Source | Handler |
|
|
16
|
-
|--------|---------|
|
|
17
|
-
| Message contains [scout], [strategist], [generator], [executor], [analyst] | handleCallback |
|
|
18
|
-
| "capability_gap" | handleAdapt |
|
|
19
|
-
| "check" or "status" | handleCheck |
|
|
20
|
-
| "resume" or "continue" | handleResume |
|
|
21
|
-
| All tasks completed | handleComplete |
|
|
22
|
-
| Default | handleSpawnNext |
|
|
23
|
-
|
|
24
|
-
## handleCallback
|
|
25
|
-
|
|
26
|
-
Worker completed. Process and advance.
|
|
27
|
-
|
|
28
|
-
1. Parse message to identify role and task ID:
|
|
29
|
-
|
|
30
|
-
| Message Pattern | Role Detection |
|
|
31
|
-
|----------------|---------------|
|
|
32
|
-
| `[scout]` or task ID `SCOUT-*` | scout |
|
|
33
|
-
| `[strategist]` or task ID `QASTRAT-*` | strategist |
|
|
34
|
-
| `[generator]` or task ID `QAGEN-*` | generator |
|
|
35
|
-
| `[executor]` or task ID `QARUN-*` | executor |
|
|
36
|
-
| `[analyst]` or task ID `QAANA-*` | analyst |
|
|
37
|
-
|
|
38
|
-
2. Check if progress update (inner loop) or final completion
|
|
39
|
-
3. Progress -> update session state, STOP
|
|
40
|
-
4. Completion -> mark task done (read `<session>/tasks.json`, set status to "completed", write back), remove from active_workers
|
|
41
|
-
5. Check for checkpoints:
|
|
42
|
-
- QARUN-* completes -> read meta.json for coverage:
|
|
43
|
-
- coverage >= target OR gc_rounds >= MAX_GC_ROUNDS -> proceed to handleSpawnNext
|
|
44
|
-
- coverage < target AND gc_rounds < MAX_GC_ROUNDS -> create GC fix tasks, increment gc_rounds
|
|
45
|
-
|
|
46
|
-
**GC Fix Task Creation** (when coverage below target) -- add paired tasks to `<session>/tasks.json`:
|
|
47
|
-
- `QAGEN-fix-<round>` (owner: generator) -- fix failing tests and improve coverage using previous results
|
|
48
|
-
- `QARUN-gc-<round>` (owner: executor, blockedBy: [QAGEN-fix-<round>]) -- re-execute tests after fixes, measure coverage
|
|
49
|
-
|
|
50
|
-
6. -> handleSpawnNext
|
|
51
|
-
|
|
52
|
-
## handleCheck
|
|
53
|
-
|
|
54
|
-
Read-only status report, then STOP.
|
|
55
|
-
|
|
56
|
-
Read team_msg (type="progress", last=50) + team_msg (type="blocker", last=10). Aggregate per-worker milestones.
|
|
57
|
-
|
|
58
|
-
**Output format**:
|
|
59
|
-
```
|
|
60
|
-
[coordinator] QA Pipeline Status — Mode: <pipeline_mode> — Progress: <done>/<total> (<pct>%)
|
|
61
|
-
[coordinator] GC Rounds: <gc_rounds>/3
|
|
62
|
-
[coordinator] Pipeline Graph: <task_id>: <done|run|wait> <summary> (per task)
|
|
63
|
-
[coordinator] Active Workers: <task_id> <role> <milestone_phase> <pct>% "<summary>" <time_ago>
|
|
64
|
-
[coordinator] Blockers: <task_id> <role> "<blocker_summary>" <time_ago> (omit if none)
|
|
65
|
-
[coordinator] Ready: <pending tasks with resolved deps>
|
|
66
|
-
[coordinator] Commands: 'resume' to advance | 'check' to refresh
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
**CLI monitoring**: `maestro agent-msg list -s "<session_id>" --type progress --last 10`
|
|
70
|
-
|
|
71
|
-
Then STOP.
|
|
72
|
-
|
|
73
|
-
## handleResume
|
|
74
|
-
|
|
75
|
-
**Agent Health Check** (v4): Cross-check `list_agents()` against active_workers. Missing agents -> reset task to pending.
|
|
76
|
-
|
|
77
|
-
```
|
|
78
|
-
Load active_workers -> route:
|
|
79
|
-
none -> handleSpawnNext
|
|
80
|
-
has workers -> classify each: completed | in_progress
|
|
81
|
-
some completed -> handleSpawnNext
|
|
82
|
-
all running -> report status -> STOP
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
## handleSpawnNext
|
|
86
|
-
|
|
87
|
-
Find ready tasks, spawn workers, STOP.
|
|
88
|
-
|
|
89
|
-
```
|
|
90
|
-
Classify tasks: completed | in_progress | ready (pending + all blockedBy completed)
|
|
91
|
-
|
|
92
|
-
Ready tasks -> route:
|
|
93
|
-
none + in_progress exists -> report waiting, STOP
|
|
94
|
-
none + nothing in_progress -> handleComplete
|
|
95
|
-
has ready -> for each:
|
|
96
|
-
determine role from prefix (see prefix-role map below)
|
|
97
|
-
skip if inner loop role already has active worker
|
|
98
|
-
else: set status="in_progress", log task_unblocked, spawn team_worker, add to active_workers
|
|
99
|
-
Update session, output summary, STOP
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
| Prefix | Role | inner_loop |
|
|
103
|
-
|--------|------|------------|
|
|
104
|
-
| SCOUT-* | scout | false |
|
|
105
|
-
| QASTRAT-* | strategist | false |
|
|
106
|
-
| QAGEN-* | generator | false |
|
|
107
|
-
| QARUN-* | executor | true |
|
|
108
|
-
| QAANA-* | analyst | false |
|
|
109
|
-
|
|
110
|
-
**Spawn worker message template**:
|
|
111
|
-
```
|
|
112
|
-
## Role Assignment
|
|
113
|
-
role: <role> | role_spec: <project>/.codex/skills/team-quality-assurance/roles/<role>/role.md
|
|
114
|
-
session: <session-folder> | session_id: <session-id> | team_name: quality-assurance
|
|
115
|
-
requirement: <task-description> | inner_loop: <true|false>
|
|
116
|
-
## Current Task
|
|
117
|
-
task_id: <task-id> | subject: <subject>
|
|
118
|
-
Read role_spec for Phase 2-4 instructions. Execute Phase 1 -> role Phase 2-4 -> Phase 5 (report).
|
|
119
|
-
## Progress Milestones
|
|
120
|
-
Report progress via team_msg at phase boundaries. Blockers via type="blocker". Completion via type="task_complete" after report_agent_job_result.
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
**Result collection**: `wait_agent({ timeout_ms: 1800000 })` (30 min), drain progress from team_msg.
|
|
124
|
-
|
|
125
|
-
**Timeout escalation**: STATUS_CHECK (3 min) -> FINALIZE with interrupt (3 min) -> mark timed_out with last progress context, close_agent.
|
|
126
|
-
|
|
127
|
-
**Cross-Agent Supplementary Context** (v4): Use `send_message` (not `followup_task`) to deliver upstream results to running downstream workers as non-interrupting supplementary context.
|
|
128
|
-
|
|
129
|
-
## handleComplete
|
|
130
|
-
|
|
131
|
-
**Cleanup Verification** (v4): `list_agents()` -> close any still-running team agents.
|
|
132
|
-
|
|
133
|
-
Pipeline done. Verify all tasks (including GC fix/recheck) completed/deleted. Incomplete -> handleSpawnNext. All complete -> read meta.json (quality_score, coverage, gc_rounds), generate summary.
|
|
134
|
-
|
|
135
|
-
Route by completion_action: interactive (Archive/Keep/Export) | auto_archive | auto_keep.
|
|
136
|
-
|
|
137
|
-
## handleAdapt
|
|
138
|
-
|
|
139
|
-
Capability gap reported mid-pipeline.
|
|
140
|
-
|
|
141
|
-
1. Parse gap description
|
|
142
|
-
2. Check if existing role covers it -> redirect
|
|
143
|
-
3. Role count < 6 -> generate dynamic role-spec in <session>/role-specs/
|
|
144
|
-
4. Add new task entry to tasks.json, spawn worker
|
|
145
|
-
5. Role count >= 6 -> merge or pause
|
|
146
|
-
|
|
147
|
-
## Fast-Advance Reconciliation
|
|
148
|
-
|
|
149
|
-
On every wake: sync `fast_advance` messages from team_msg into active_workers. No duplicate spawns.
|
|
150
|
-
|
|
151
|
-
## Phase 4: State Persistence
|
|
152
|
-
|
|
153
|
-
After every handler: reconcile active_workers with tasks.json, remove completed/deleted entries, write meta.json, STOP.
|
|
154
|
-
|
|
155
|
-
## Error Handling
|
|
156
|
-
|
|
157
|
-
| Scenario | Resolution |
|
|
158
|
-
|----------|------------|
|
|
159
|
-
| Session file not found | Error, suggest re-initialization |
|
|
160
|
-
| Worker callback from unknown role | Log info, scan for other completions |
|
|
161
|
-
| Pipeline stall (no ready, no running, has pending) | Check blockedBy chains, report to user |
|
|
162
|
-
| GC loop exceeded | Accept current coverage with warning, proceed |
|
|
163
|
-
| Scout finds 0 issues | Skip to testing mode, proceed to QASTRAT |
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
# Coordinator Role
|
|
2
|
-
|
|
3
|
-
Orchestrate team-quality-assurance: 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: Edit/Write on project source files — worker work
|
|
17
|
-
WRONG: Bash("npm test"), Bash("tsc"), etc. — 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: Parse requirements -> Mode selection -> Create team -> Dispatch tasks -> Monitor progress -> Report results
|
|
27
|
-
|
|
28
|
-
## Boundaries
|
|
29
|
-
|
|
30
|
-
### MUST
|
|
31
|
-
- Parse task description and detect QA mode
|
|
32
|
-
- Create team and spawn team-worker agents in background
|
|
33
|
-
- Dispatch tasks with proper dependency chains
|
|
34
|
-
- Monitor progress via callbacks and route messages
|
|
35
|
-
- Maintain session state
|
|
36
|
-
- Handle GC loop (generator-executor coverage cycles)
|
|
37
|
-
- Execute completion action when pipeline finishes
|
|
38
|
-
- **Always proceed through full Phase 1-5 workflow, never skip to direct execution**
|
|
39
|
-
- Use `send_message` for supplementary context (non-interrupting) and `followup_task` for triggering new work
|
|
40
|
-
- Use `list_agents` for session resume health checks and cleanup verification
|
|
41
|
-
|
|
42
|
-
### MUST NOT
|
|
43
|
-
- Read source code or explore codebase (delegate to workers)
|
|
44
|
-
- Execute scan, test, or analysis work directly
|
|
45
|
-
- Modify test files or source code
|
|
46
|
-
- Spawn workers with general-purpose agent (MUST use team-worker)
|
|
47
|
-
- Generate more than 6 worker roles
|
|
48
|
-
- Call CLI tools (maestro delegate) — only workers use CLI
|
|
49
|
-
|
|
50
|
-
## Command Execution Protocol
|
|
51
|
-
When coordinator needs to execute a specific phase:
|
|
52
|
-
1. Read `commands/<command>.md`
|
|
53
|
-
2. Follow the workflow defined in the command
|
|
54
|
-
3. Commands are inline execution guides, NOT separate agents
|
|
55
|
-
4. Execute synchronously, complete before proceeding
|
|
56
|
-
|
|
57
|
-
## Entry Router
|
|
58
|
-
|
|
59
|
-
| Detection | Condition | Handler |
|
|
60
|
-
|-----------|-----------|---------|
|
|
61
|
-
| Worker callback | Message contains [scout], [strategist], [generator], [executor], [analyst] | -> handleCallback (monitor.md) |
|
|
62
|
-
| Status check | Args contain "check" or "status" | -> handleCheck (monitor.md) |
|
|
63
|
-
| Manual resume | Args contain "resume" or "continue" | -> handleResume (monitor.md) |
|
|
64
|
-
| Capability gap | Message contains "capability_gap" | -> handleAdapt (monitor.md) |
|
|
65
|
-
| Pipeline complete | All tasks completed | -> handleComplete (monitor.md) |
|
|
66
|
-
| Interrupted session | Active session in .workflow/.team/QA-* | -> Phase 0 |
|
|
67
|
-
| New session | None of above | -> Phase 1 |
|
|
68
|
-
|
|
69
|
-
For callback/check/resume/adapt/complete: load @commands/monitor.md, execute handler, STOP.
|
|
70
|
-
|
|
71
|
-
## Phase 0: Session Resume Check
|
|
72
|
-
|
|
73
|
-
1. Scan .workflow/.team/QA-*/session.json for active/paused sessions
|
|
74
|
-
2. No sessions -> Phase 1
|
|
75
|
-
3. Single session -> reconcile (audit tasks.json, reset in_progress->pending, rebuild team, kick first ready task)
|
|
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 and extract flags
|
|
83
|
-
2. **QA Mode Selection**:
|
|
84
|
-
|
|
85
|
-
| Condition | Mode |
|
|
86
|
-
|-----------|------|
|
|
87
|
-
| Explicit `--mode=discovery` flag | discovery |
|
|
88
|
-
| Explicit `--mode=testing` flag | testing |
|
|
89
|
-
| Explicit `--mode=full` flag | full |
|
|
90
|
-
| Task description contains: discovery/scan/issue keywords | discovery |
|
|
91
|
-
| Task description contains: test/coverage/TDD keywords | testing |
|
|
92
|
-
| No explicit flag and no keyword match | full (default) |
|
|
93
|
-
|
|
94
|
-
3. Clarify if ambiguous (request_user_input: scope, deliverables, constraints)
|
|
95
|
-
4. Delegate to @commands/analyze.md
|
|
96
|
-
5. Output: task-analysis.json
|
|
97
|
-
6. CRITICAL: Always proceed to Phase 2, never skip team workflow
|
|
98
|
-
|
|
99
|
-
## Phase 2: Create Team + Initialize Session
|
|
100
|
-
|
|
101
|
-
1. Resolve workspace paths (MUST do first):
|
|
102
|
-
- `project_root` = result of `Bash({ command: "pwd" })`
|
|
103
|
-
- `skill_root` = `<project_root>/.claude/skills/team-quality-assurance`
|
|
104
|
-
2. Generate session ID: QA-<slug>-<date>
|
|
105
|
-
3. Create session folder structure
|
|
106
|
-
4. Initialize session folder structure (replaces TeamCreate)
|
|
107
|
-
5. Read specs/pipelines.md -> select pipeline based on mode
|
|
108
|
-
6. Register roles in session.json
|
|
109
|
-
7. Initialize shared infrastructure (wisdom/*.md)
|
|
110
|
-
8. Initialize pipeline via team_msg state_update:
|
|
111
|
-
```
|
|
112
|
-
mcp__maestro-tools__team_msg({
|
|
113
|
-
operation: "log", session_id: "<id>", from: "coordinator",
|
|
114
|
-
type: "state_update", summary: "Session initialized",
|
|
115
|
-
data: {
|
|
116
|
-
pipeline_mode: "<discovery|testing|full>",
|
|
117
|
-
pipeline_stages: [...],
|
|
118
|
-
team_name: "quality-assurance",
|
|
119
|
-
discovered_issues: [],
|
|
120
|
-
test_strategy: {},
|
|
121
|
-
generated_tests: {},
|
|
122
|
-
execution_results: {},
|
|
123
|
-
defect_patterns: [],
|
|
124
|
-
coverage_history: [],
|
|
125
|
-
quality_score: null
|
|
126
|
-
}
|
|
127
|
-
})
|
|
128
|
-
```
|
|
129
|
-
9. Write session.json
|
|
130
|
-
|
|
131
|
-
## Phase 3: Create Task Chain
|
|
132
|
-
|
|
133
|
-
Delegate to @commands/dispatch.md:
|
|
134
|
-
1. Read dependency graph from task-analysis.json
|
|
135
|
-
2. Read specs/pipelines.md for selected pipeline's task registry
|
|
136
|
-
3. Topological sort tasks
|
|
137
|
-
4. Build tasks array as JSON entries in `<session>/tasks.json`; set deps via `blockedBy` field in each entry
|
|
138
|
-
5. Update session.json
|
|
139
|
-
|
|
140
|
-
## Phase 4: Spawn-and-Stop
|
|
141
|
-
|
|
142
|
-
Delegate to @commands/monitor.md#handleSpawnNext:
|
|
143
|
-
1. Find ready tasks (pending + all addBlockedBy dependencies resolved)
|
|
144
|
-
2. Spawn team-worker agents (see SKILL.md Spawn Template)
|
|
145
|
-
3. Output status summary
|
|
146
|
-
4. STOP
|
|
147
|
-
|
|
148
|
-
## Phase 5: Report + Completion Action
|
|
149
|
-
|
|
150
|
-
1. Generate summary (deliverables, pipeline stats, quality score, GC rounds)
|
|
151
|
-
2. Execute completion action per session.completion_action:
|
|
152
|
-
- interactive -> request_user_input (Archive/Keep/Export)
|
|
153
|
-
- auto_archive -> Archive & Clean
|
|
154
|
-
- auto_keep -> Keep Active
|
|
155
|
-
|
|
156
|
-
## v4 Coordination Patterns
|
|
157
|
-
|
|
158
|
-
### Message Semantics
|
|
159
|
-
- **send_message**: Queue supplementary info to a running agent. Does NOT interrupt current processing. Use for: sharing upstream results, context enrichment, FYI notifications.
|
|
160
|
-
- **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).
|
|
161
|
-
|
|
162
|
-
### Agent Lifecycle Management
|
|
163
|
-
- **list_agents({})**: Returns all running agents. Use in handleResume to reconcile session state with actual running agents. Use in handleComplete to verify clean shutdown.
|
|
164
|
-
- **Named targeting**: Workers spawned with `task_name: "<task-id>"` can be addressed by name in send_message, followup_task, and close_agent calls.
|
|
165
|
-
- **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`.
|
|
166
|
-
|
|
167
|
-
## Error Handling
|
|
168
|
-
|
|
169
|
-
| Error | Resolution |
|
|
170
|
-
|-------|------------|
|
|
171
|
-
| Task too vague | request_user_input for clarification |
|
|
172
|
-
| Session corruption | Attempt recovery, fallback to manual |
|
|
173
|
-
| Worker crash | Reset task to pending, respawn |
|
|
174
|
-
| Dependency cycle | Detect in analysis, halt |
|
|
175
|
-
| Scout finds nothing | Skip to testing mode |
|
|
176
|
-
| GC loop stuck > 3 | Accept current coverage with warning |
|
|
177
|
-
| quality_score < 60 | Report with WARNING, suggest re-run |
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
# Analyze Task
|
|
2
|
-
|
|
3
|
-
Parse user task -> detect review capabilities -> build dependency graph -> design pipeline.
|
|
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
|
-
| scan, lint, static analysis, toolchain | scanner | SCAN |
|
|
12
|
-
| review, analyze, audit, findings | reviewer | REV |
|
|
13
|
-
| fix, repair, remediate, patch | fixer | FIX |
|
|
14
|
-
|
|
15
|
-
## Pipeline Mode Detection
|
|
16
|
-
|
|
17
|
-
| Condition | Mode |
|
|
18
|
-
|-----------|------|
|
|
19
|
-
| Flag `--fix` | fix-only |
|
|
20
|
-
| Flag `--full` | full |
|
|
21
|
-
| Flag `-q` or `--quick` | quick |
|
|
22
|
-
| (none) | default |
|
|
23
|
-
|
|
24
|
-
## Dependency Graph
|
|
25
|
-
|
|
26
|
-
Natural ordering for review pipeline:
|
|
27
|
-
- Tier 0: scanner (toolchain + semantic scan, no upstream dependency)
|
|
28
|
-
- Tier 1: reviewer (deep analysis, requires scan findings)
|
|
29
|
-
- Tier 2: fixer (apply fixes, requires reviewed findings + user confirm)
|
|
30
|
-
|
|
31
|
-
## Pipeline Definitions
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
quick: SCAN(quick=true)
|
|
35
|
-
default: SCAN -> REV
|
|
36
|
-
full: SCAN -> REV -> [user confirm] -> FIX
|
|
37
|
-
fix-only: FIX
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Complexity Scoring
|
|
41
|
-
|
|
42
|
-
| Factor | Points |
|
|
43
|
-
|--------|--------|
|
|
44
|
-
| Per capability | +1 |
|
|
45
|
-
| Large target scope (>20 files) | +2 |
|
|
46
|
-
| Multiple dimensions | +1 |
|
|
47
|
-
| Fix phase included | +1 |
|
|
48
|
-
|
|
49
|
-
Results: 1-2 Low, 3-4 Medium, 5+ High
|
|
50
|
-
|
|
51
|
-
## Role Minimization
|
|
52
|
-
|
|
53
|
-
- Cap at 4 roles (coordinator + 3 workers)
|
|
54
|
-
- Sequential pipeline: scanner -> reviewer -> fixer
|
|
55
|
-
|
|
56
|
-
## Output
|
|
57
|
-
|
|
58
|
-
Write <session>/task-analysis.json:
|
|
59
|
-
```json
|
|
60
|
-
{
|
|
61
|
-
"task_description": "<original>",
|
|
62
|
-
"pipeline_mode": "<quick|default|full|fix-only>",
|
|
63
|
-
"target": "<path>",
|
|
64
|
-
"dimensions": ["sec", "cor", "prf", "mnt"],
|
|
65
|
-
"auto_confirm": false,
|
|
66
|
-
"capabilities": [{ "name": "<cap>", "prefix": "<PREFIX>" }],
|
|
67
|
-
"dependency_graph": { "<TASK-ID>": { "role": "<role>", "blockedBy": ["..."] } },
|
|
68
|
-
"roles": [{ "name": "<role>", "prefix": "<PREFIX>", "inner_loop": false }],
|
|
69
|
-
"complexity": { "score": 0, "level": "Low|Medium|High" }
|
|
70
|
-
}
|
|
71
|
-
```
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
# Dispatch Tasks
|
|
2
|
-
|
|
3
|
-
Create task chains from pipeline mode, write to tasks.json with proper deps relationships.
|
|
4
|
-
|
|
5
|
-
## Workflow
|
|
6
|
-
|
|
7
|
-
1. Read task-analysis.json -> extract pipeline_mode and parameters
|
|
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 with pipeline.tasks_total
|
|
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 - Target: <target>\n - Dimensions: <dimensions>\n - Upstream artifacts: <list>\nEXPECTED: <artifact path> + <quality criteria>\nCONSTRAINTS: <scope limits>\n---\nInnerLoop: <true|false>\nRoleSpec: <project>/.codex/skills/team-review/roles/<role>/role.md",
|
|
25
|
-
"role": "<role-name>",
|
|
26
|
-
"prefix": "<PREFIX>",
|
|
27
|
-
"deps": ["<upstream-task-id>"],
|
|
28
|
-
"status": "pending",
|
|
29
|
-
"findings": "",
|
|
30
|
-
"error": ""
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Pipeline Task Registry
|
|
36
|
-
|
|
37
|
-
### default Mode
|
|
38
|
-
```
|
|
39
|
-
SCAN-001 (scanner): Multi-dimension code scan
|
|
40
|
-
deps: [], meta: target=<target>, dimensions=<dims>
|
|
41
|
-
REV-001 (reviewer): Deep finding analysis and review
|
|
42
|
-
deps: [SCAN-001]
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### full Mode
|
|
46
|
-
```
|
|
47
|
-
SCAN-001 (scanner): Multi-dimension code scan
|
|
48
|
-
deps: [], meta: target=<target>, dimensions=<dims>
|
|
49
|
-
REV-001 (reviewer): Deep finding analysis and review
|
|
50
|
-
deps: [SCAN-001]
|
|
51
|
-
FIX-001 (fixer): Plan and execute fixes
|
|
52
|
-
deps: [REV-001]
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### fix-only Mode
|
|
56
|
-
```
|
|
57
|
-
FIX-001 (fixer): Execute fixes from manifest
|
|
58
|
-
deps: [], meta: input=<fix-manifest>
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### quick Mode
|
|
62
|
-
```
|
|
63
|
-
SCAN-001 (scanner): Quick scan (fast mode)
|
|
64
|
-
deps: [], meta: target=<target>, quick=true
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## InnerLoop Flag Rules
|
|
68
|
-
|
|
69
|
-
- true: fixer role (iterative fix cycles)
|
|
70
|
-
- false: scanner, reviewer roles
|
|
71
|
-
|
|
72
|
-
## Dependency Validation
|
|
73
|
-
|
|
74
|
-
- No orphan tasks (all tasks have valid owner)
|
|
75
|
-
- No circular dependencies
|
|
76
|
-
- All deps references exist in tasks object
|
|
77
|
-
- Session reference in every task description
|
|
78
|
-
- RoleSpec reference in every task description
|
|
79
|
-
|
|
80
|
-
## Log After Creation
|
|
81
|
-
|
|
82
|
-
```
|
|
83
|
-
mcp__maestro-tools__team_msg({
|
|
84
|
-
operation: "log",
|
|
85
|
-
session_id: <session-id>,
|
|
86
|
-
from: "coordinator",
|
|
87
|
-
type: "dispatch_ready",
|
|
88
|
-
data: { pipeline: "<mode>", task_count: <N>, target: "<target>" }
|
|
89
|
-
})
|
|
90
|
-
```
|
|
@@ -1,135 +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
|
-
- FAST_ADVANCE_AWARE: true
|
|
9
|
-
|
|
10
|
-
## Handler Router
|
|
11
|
-
|
|
12
|
-
| Source | Handler |
|
|
13
|
-
|--------|---------|
|
|
14
|
-
| "capability_gap" | handleAdapt |
|
|
15
|
-
| "check" or "status" | handleCheck |
|
|
16
|
-
| "resume" or "continue" | handleResume |
|
|
17
|
-
| All tasks completed | handleComplete |
|
|
18
|
-
| Default | handleSpawnNext |
|
|
19
|
-
|
|
20
|
-
## Role-Worker Map
|
|
21
|
-
|
|
22
|
-
| Prefix | Role | Role Spec | inner_loop |
|
|
23
|
-
|--------|------|-----------|------------|
|
|
24
|
-
| SCAN-* | scanner | `<project>/.codex/skills/team-review/roles/scanner/role.md` | false |
|
|
25
|
-
| REV-* | reviewer | `<project>/.codex/skills/team-review/roles/reviewer/role.md` | false |
|
|
26
|
-
| FIX-* | fixer | `<project>/.codex/skills/team-review/roles/fixer/role.md` | true |
|
|
27
|
-
|
|
28
|
-
## handleCheck
|
|
29
|
-
|
|
30
|
-
Read-only status report from tasks.json, then STOP.
|
|
31
|
-
|
|
32
|
-
Read tasks.json + team_msg (type="progress", last=50) + team_msg (type="blocker", last=10). Count tasks by status.
|
|
33
|
-
|
|
34
|
-
**Output format**:
|
|
35
|
-
```
|
|
36
|
-
[coordinator] Review Pipeline Status — Mode: <pipeline_mode> — Progress: <completed>/<total> (<percent>%)
|
|
37
|
-
[coordinator] Pipeline Graph: <task_id>: <done|run|wait|deleted> <summary> (per task) — done=completed >>>=running o=pending x=deleted
|
|
38
|
-
[coordinator] Active Workers: <task_id> <role> <milestone_phase> <pct>% "<summary>" <time_ago>
|
|
39
|
-
[coordinator] Blockers: <task_id> <role> "<blocker_summary>" <time_ago> (omit if none)
|
|
40
|
-
[coordinator] Ready to spawn: <subjects>
|
|
41
|
-
[coordinator] Commands: 'resume' to advance | 'check' to refresh
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
**CLI monitoring**: `maestro agent-msg list -s "<session_id>" --type progress --last 10`
|
|
45
|
-
|
|
46
|
-
Then STOP.
|
|
47
|
-
|
|
48
|
-
## handleResume
|
|
49
|
-
|
|
50
|
-
**Agent Health Check** (v4): Cross-check `list_agents()` against `active_agents`. Missing agents -> reset task to pending.
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
Load active_agents -> route:
|
|
54
|
-
none -> handleSpawnNext
|
|
55
|
-
has agents -> classify each: completed | in_progress | failed(reset to pending)
|
|
56
|
-
some completed -> handleSpawnNext
|
|
57
|
-
all running -> report status -> STOP
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## handleSpawnNext
|
|
61
|
-
|
|
62
|
-
Find ready tasks, spawn workers, wait for results, process.
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
Classify tasks: completed | in_progress | deleted | ready (pending + all deps completed)
|
|
66
|
-
|
|
67
|
-
Ready tasks -> route:
|
|
68
|
-
none + in_progress exists -> report waiting, STOP
|
|
69
|
-
none + nothing in_progress -> handleComplete
|
|
70
|
-
has ready -> take first ready task:
|
|
71
|
-
determine role from prefix (Role-Worker Map)
|
|
72
|
-
set status="in_progress", log task_unblocked, spawn team_worker, add to active_agents
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
**Spawn worker message template**:
|
|
76
|
-
```
|
|
77
|
-
## Role Assignment
|
|
78
|
-
role: <role> | role_spec: <skillRoot>/roles/<role>/role.md
|
|
79
|
-
session: <session-folder> | session_id: <session-id>
|
|
80
|
-
requirement: <task-description> | inner_loop: <true|false>
|
|
81
|
-
## Current Task
|
|
82
|
-
task_id: <taskId> | subject: <taskSubject>
|
|
83
|
-
Read role_spec for Phase 2-4 instructions. Execute Phase 1 -> role Phase 2-4 -> Phase 5 (report).
|
|
84
|
-
## Progress Milestones
|
|
85
|
-
Report progress via team_msg at phase boundaries. Blockers via type="blocker". Completion via type="task_complete" after report_agent_job_result.
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
**Result collection**: `wait_agent({ timeout_ms: 1800000 })` (30 min), drain progress from team_msg.
|
|
89
|
-
|
|
90
|
-
**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).
|
|
91
|
-
|
|
92
|
-
**Checkpoints after completion**:
|
|
93
|
-
- scanner: findings_count === 0 -> delete remaining REV-*/FIX-* -> handleComplete; > 0 -> handleSpawnNext
|
|
94
|
-
- reviewer (full mode): autoYes -> write fix-manifest.json, fix_scope='all'; else request_user_input (Fix all / Fix critical+high only / Skip fix -> delete FIX-* -> handleComplete). Write fix_scope to meta.json.
|
|
95
|
-
- fixer: -> handleSpawnNext (natural completion check)
|
|
96
|
-
|
|
97
|
-
Update tasks.json, output summary, STOP.
|
|
98
|
-
|
|
99
|
-
**Cross-Agent Supplementary Context** (v4): Use `send_message` (not `followup_task`) to deliver upstream results to running downstream workers as non-interrupting supplementary context.
|
|
100
|
-
|
|
101
|
-
## handleComplete
|
|
102
|
-
|
|
103
|
-
**Cleanup Verification** (v4): `list_agents()` -> close any still-running team agents.
|
|
104
|
-
|
|
105
|
-
Pipeline done. All tasks completed/deleted -> read meta.json, generate summary (mode, target, findings_count, stages, fix results, deliverables). Update session pipeline_status='complete'.
|
|
106
|
-
|
|
107
|
-
Route by completion_action: interactive (Archive/Keep/Export) | auto_archive | auto_keep.
|
|
108
|
-
|
|
109
|
-
## handleAdapt
|
|
110
|
-
|
|
111
|
-
Capability gap reported mid-pipeline.
|
|
112
|
-
|
|
113
|
-
1. Parse gap description
|
|
114
|
-
2. Check if existing role covers it -> redirect
|
|
115
|
-
3. Role count < 4 -> generate dynamic role-spec in <session>/role-specs/
|
|
116
|
-
4. Create new task in tasks.json, spawn worker
|
|
117
|
-
5. Role count >= 4 -> merge or pause
|
|
118
|
-
|
|
119
|
-
## Fast-Advance Reconciliation
|
|
120
|
-
|
|
121
|
-
On every wake: sync completed tasks and active_agents with actual state. No duplicate spawns.
|
|
122
|
-
|
|
123
|
-
## State Persistence
|
|
124
|
-
|
|
125
|
-
After every handler: reconcile active_agents with tasks.json, remove completed/deleted entries, write tasks.json, STOP.
|
|
126
|
-
|
|
127
|
-
## Error Handling
|
|
128
|
-
|
|
129
|
-
| Scenario | Resolution |
|
|
130
|
-
|----------|------------|
|
|
131
|
-
| Session file not found | Error, suggest re-initialization |
|
|
132
|
-
| 0 findings after scan | Delete remaining stages, complete pipeline |
|
|
133
|
-
| User declines fix | Delete FIX-* tasks, complete with review-only results |
|
|
134
|
-
| Pipeline stall | Check deps chains, report to user |
|
|
135
|
-
| Worker failure | Reset task to pending, respawn on next resume |
|