/monitor
- SPAWN_MODE: background - ONE_STEP_PER_INVOCATION: true - FAST_ADVANCE_AWARE: true - WORKER_AGENT: team-worker
$ npx -y skills add catlog22/maestro-flow --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/monitor
Context preview
What this command does when you run it.
- SPAWN_MODE: background - ONE_STEP_PER_INVOCATION: true - FAST_ADVANCE_AWARE: true - WORKER_AGENT: team-worker
Command definition
monitor.mdMonitor Pipeline
Constants
- SPAWN_MODE: background
- ONE_STEP_PER_INVOCATION: true
- FAST_ADVANCE_AWARE: true
- WORKER_AGENT: team-worker
Handler Router
| Source | Handler | |--------|---------| | Message contains [analyzer], [designer], [refactorer], [validator], [reviewer] | handleCallback | | Message contains branch tag [refactorer-B01], etc. | handleCallback (branch-aware) | | Message contains pipeline tag [analyzer-A], etc. | handleCallback (pipeline-aware) | | "consensus_blocked" | handleConsensus | | "capability_gap" | handleAdapt | | "check" or "status" | handleCheck | | "resume" or "continue" | handleResume | | All tasks completed | handleComplete | | Default | handleSpawnNext |
handleCallback
Worker completed. Process and advance.
1. Parse message to identify role, task ID, and branch/pipeline label:
| Message Pattern | Branch Detection | |----------------|-----------------| | `[refactorer-B01]` or task ID `REFACTOR-B01` | Branch `B01` (fan-out) | | `[analyzer-A]` or task ID `ANALYZE-A01` | Pipeline `A` (independent) | | `[analyzer]` or task ID `ANALYZE-001` | No branch (single) |
2. Mark task as completed: `TaskUpdate({ taskId: "<task-id>", status: "completed" })` 3. Record completion in session state 4. **CP-2.5 check** (auto/fan-out mode only):
- If completed task is DESIGN-001 AND parallel_mode is `auto` or `fan-out`:
- Execute CP-2.5 Branch Creation from dispatch.md
- After branch creation, proceed to handleSpawnNext (spawns all REFACTOR-B* in parallel)
- STOP after spawning
5. Check stage checkpoints:
| Completed Task | Checkpoint | Action | |---------------|------------|--------| | ANALYZE-001 / ANALYZE-{P}01 | CP-1 | Notify user: architecture report ready | | DESIGN-001 / DESIGN-{P}01 | CP-2 | Notify user: refactoring plan ready | | DESIGN-001 (auto/fan-out) | CP-2.5 | Execute branch creation, notify with branch count | | VALIDATE-* or REVIEW-* | CP-3 | Check verdicts per branch (see Review-Fix Cycle) |
6. Proceed to handleSpawnNext
handleCheck
Read-only status report, then STOP.
**Worker Progress** (from message bus):
Before generating status output, read worker milestones:
const progressMsgs = mcp__maestro__team_msg({
operation: "list", session_id: sessionId, type: "progress", last: 50
})
const blockerMsgs = mcp__maestro__team_msg({
operation: "list", session_id: sessionId, type: "blocker", last: 10
})
// Aggregate latest milestone per task
const taskProgress = {}
for (const msg of (progressMsgs.result?.messages || [])) {
const tid = msg.data?.task_id
if (tid && (!taskProgress[tid] || msg.ts > taskProgress[tid].ts)) {
taskProgress[tid] = { phase: msg.data.phase, pct: msg.data.progress_pct, ts: msg.ts }
}
}Include in status output:
- Per-worker latest milestone (phase + progress_pct) next to task status
- Active blockers section (if any blockerMsgs found)
Output (single mode):
[coordinator] Pipeline Status
[coordinator] Progress: <done>/<total> (<pct>%)
[coordinator] Active: <workers with elapsed time>
[coordinator] Ready: <pending tasks with resolved deps>
[coordinator] Commands: 'resume' to advance | 'check' to refresh
Fan-out mode adds per-branch grouping. Independent mode adds per-pipeline grouping.
handleResume
1. Audit task list: Tasks stuck in "in_progress" -> reset to "pending" 2. For fan-out/independent: check each branch/pipeline independently 3. Proceed to handleSpawnNext
handleSpawnNext
Find ready tasks, spawn workers, STOP.
1. Collect: completedSubjects, inProgressSubjects, readySubjects 2. No ready + work in progress -> report waiting, STOP 3. No ready + nothing in progress -> handleComplete 4. Has ready -> for each: a. Check inner_loop: parse task description `InnerLoop:` field (NOT role.md default)
- InnerLoop: true AND same-role worker already active -> skip (worker picks up)
- InnerLoop: false OR no active same-role worker -> spawn new worker
b. TaskUpdate -> in_progress c. team_msg log -> task_unblocked d. Spawn team-worker (see SKILL.md Spawn Template):
Agent({
subagent_type: "team-worker",
description: "Spawn <role> worker for <task-id>",
team_name: "arch-opt",
name: "<role>",
run_in_background: true,
prompt: `## Role Assignment
role: <role>
role_spec: ~ or <project>/.claude/skills/team-arch-opt/roles/<role>/role.md
session: {run_dir}/work/team
session_id: <run-id>
team_name: arch-opt
requirement: <task-description>
inner_loop: <true|false>
## Progress Milestones
session_id: <run-id>
Report progress via team_msg at natural phase boundaries (context loaded -> core work done -> verification).
Report blockers immediately via team_msg type="blocker".
Report completion via team_msg type="task_complete" after final SendMessage.
Read role_spec file to load Phase 2-4 domain instructions.
Execute built-in Phase 1 (task discovery) -> role Phase 2-4 -> built-in Phase 5 (report).`
})e. Add to active_workers 5. Parallel spawn rules by mode:
| Mode | Scenario | Spawn Behavior | |------|----------|---------------| | Single | Stage 4 ready | Spawn VALIDATE-001 + REVIEW-001 in parallel | | Fan-out (CP-2.5 done) | All REFACTOR-B* unblocked | Spawn ALL REFACTOR-B* in parallel | | Fan-out (REFACTOR-B{NN} done) | VALIDATE + REVIEW ready | Spawn both for that branch in parallel | | Independent | Any unblocked task | Spawn all ready tasks across all pipelines in parallel |
6. Update session, output summary, STOP
Review-Fix Cycle (CP-3)
**Per-branch/pipeline scoping**: Each branch/pipeline has its own independent fix cycle.
When both VALIDATE-* and REVIEW-* are completed for a branch/pipeline:
1. Read validation verdict from scoped meta.json namespace 2. Read review verdict from scoped meta.json namespace
| Validate Verdict | Review Verdict | Action | |-----------------|---
Read more
Monitor Pipeline
Constants
- SPAWN_MODE: background
- ONE_STEP_PER_INVOCATION: true
- FAST_ADVANCE_AWARE: true
- WORKER_AGENT: team-worker
Handler Router
| Source | Handler | |--------|---------| | Message contains [analyzer], [designer], [refactorer], [validator], [reviewer] | handleCallback | | Message contains branch tag [refactorer-B01], etc. | handleCallback (branch-aware) | | Message contains pipeline tag [analyzer-A], etc. | handleCallback (pipeline-aware) | | "consensus_blocked" | handleConsensus | | "capability_gap" | handleAdapt | | "check" or "status" | handleCheck | | "resume" or "continue" | handleResume | | All tasks completed | handleComplete | | Default | handleSpawnNext |
handleCallback
Worker completed. Process and advance.
1. Parse message to identify role, task ID, and branch/pipeline label:
| Message Pattern | Branch Detection | |----------------|-----------------| | `[refactorer-B01]` or task ID `REFACTOR-B01` | Branch `B01` (fan-out) | | `[analyzer-A]` or task ID `ANALYZE-A01` | Pipeline `A` (independent) | | `[analyzer]` or task ID `ANALYZE-001` | No branch (single) |
2. Mark task as completed: `TaskUpdate({ taskId: "<task-id>", status: "completed" })` 3. Record completion in session state 4. **CP-2.5 check** (auto/fan-out mode only):
- If completed task is DESIGN-001 AND parallel_mode is `auto` or `fan-out`:
- Execute CP-2.5 Branch Creation from dispatch.md
- After branch creation, proceed to handleSpawnNext (spawns all REFACTOR-B* in parallel)
- STOP after spawning
5. Check stage checkpoints:
| Completed Task | Checkpoint | Action | |---------------|------------|--------| | ANALYZE-001 / ANALYZE-{P}01 | CP-1 | Notify user: architecture report ready | | DESIGN-001 / DESIGN-{P}01 | CP-2 | Notify user: refactoring plan ready | | DESIGN-001 (auto/fan-out) | CP-2.5 | Execute branch creation, notify with branch count | | VALIDATE-* or REVIEW-* | CP-3 | Check verdicts per branch (see Review-Fix Cycle) |
6. Proceed to handleSpawnNext
handleCheck
Read-only status report, then STOP.
**Worker Progress** (from message bus):
Before generating status output, read worker milestones:
const progressMsgs = mcp__maestro__team_msg({
operation: "list", session_id: sessionId, type: "progress", last: 50
})
const blockerMsgs = mcp__maestro__team_msg({
operation: "list", session_id: sessionId, type: "blocker", last: 10
})
// Aggregate latest milestone per task
const taskProgress = {}
for (const msg of (progressMsgs.result?.messages || [])) {
const tid = msg.data?.task_id
if (tid && (!taskProgress[tid] || msg.ts > taskProgress[tid].ts)) {
taskProgress[tid] = { phase: msg.data.phase, pct: msg.data.progress_pct, ts: msg.ts }
}
}Include in status output:
- Per-worker latest milestone (phase + progress_pct) next to task status
- Active blockers section (if any blockerMsgs found)
Output (single mode):
[coordinator] Pipeline Status [coordinator] Progress: <done>/<total> (<pct>%) [coordinator] Active: <workers with elapsed time> [coordinator] Ready: <pending tasks with resolved deps> [coordinator] Commands: 'resume' to advance | 'check' to refresh
Fan-out mode adds per-branch grouping. Independent mode adds per-pipeline grouping.
handleResume
1. Audit task list: Tasks stuck in "in_progress" -> reset to "pending" 2. For fan-out/independent: check each branch/pipeline independently 3. Proceed to handleSpawnNext
handleSpawnNext
Find ready tasks, spawn workers, STOP.
1. Collect: completedSubjects, inProgressSubjects, readySubjects 2. No ready + work in progress -> report waiting, STOP 3. No ready + nothing in progress -> handleComplete 4. Has ready -> for each: a. Check inner_loop: parse task description `InnerLoop:` field (NOT role.md default)
- InnerLoop: true AND same-role worker already active -> skip (worker picks up)
- InnerLoop: false OR no active same-role worker -> spawn new worker
b. TaskUpdate -> in_progress c. team_msg log -> task_unblocked d. Spawn team-worker (see SKILL.md Spawn Template):
Agent({
subagent_type: "team-worker",
description: "Spawn <role> worker for <task-id>",
team_name: "arch-opt",
name: "<role>",
run_in_background: true,
prompt: `## Role Assignment
role: <role>
role_spec: ~ or <project>/.claude/skills/team-arch-opt/roles/<role>/role.md
session: {run_dir}/work/team
session_id: <run-id>
team_name: arch-opt
requirement: <task-description>
inner_loop: <true|false>
## Progress Milestones
session_id: <run-id>
Report progress via team_msg at natural phase boundaries (context loaded -> core work done -> verification).
Report blockers immediately via team_msg type="blocker".
Report completion via team_msg type="task_complete" after final SendMessage.
Read role_spec file to load Phase 2-4 domain instructions.
Execute built-in Phase 1 (task discovery) -> role Phase 2-4 -> built-in Phase 5 (report).`
})e. Add to active_workers 5. Parallel spawn rules by mode:
| Mode | Scenario | Spawn Behavior | |------|----------|---------------| | Single | Stage 4 ready | Spawn VALIDATE-001 + REVIEW-001 in parallel | | Fan-out (CP-2.5 done) | All REFACTOR-B* unblocked | Spawn ALL REFACTOR-B* in parallel | | Fan-out (REFACTOR-B{NN} done) | VALIDATE + REVIEW ready | Spawn both for that branch in parallel | | Independent | Any unblocked task | Spawn all ready tasks across all pipelines in parallel |
6. Update session, output summary, STOP
Review-Fix Cycle (CP-3)
**Per-branch/pipeline scoping**: Each branch/pipeline has its own independent fix cycle.
When both VALIDATE-* and REVIEW-* are completed for a branch/pipeline:
1. Read validation verdict from scoped meta.json namespace 2. Read review verdict from scoped meta.json namespace
| Validate Verdict | Review Verdict | Action | |-----------------|---
Intent-driven workflow orchestration for multi-agent AI development — adaptive lifecycle engine, self-reinforcing knowledge graph, and visual dashboard for Claude Code, Gemini, Codex & more
Repo: catlog22/maestro-flow
Other commands on maestro-flow.
- /maestro-companion
Quick execution for small tasks — minimal run lifecycle (start + done) with evidence recording. Full LLM capability, scoped to mechanically clear tasks.
Open command - /maestro-fork
Create or sync session worktree for parallel dev
Open command - /maestro-guard
Manage editing boundary restrictions
Open command - /maestro-impeccable
Use when designing, auditing, polishing, improving, or codifying frontend UI — websites, dashboards, landing pages, components, design systems
Open command - /maestro-init
Initialize project with auto state detection
Open command - /maestro-issue
Intent-driven issue lifecycle management — describe what you want in natural language (报告一个 bug / 列出开放 issue / 关掉 ISS-xxx / 关联到 task / 扫描发现问题) and the workflow routes to the right operation. Operates on .workflow/issues/. 知识管理走 /maestro-knowledge;knowhow 沉淀走
Open command

