Skip to content
Development
Command

/dispatch

| Input | Source | Required | |-------|--------|----------| | User requirement | From coordinator Phase 1 | Yes | | Session folder | From coordinator Phase 2 | Yes | | Pipeline definition | From SKILL.md Pipeline Definitions | Yes | | Parallel mode | From team-session.json

From plugin
maestro-flow
51129 skills25 agents29 commands3 MCP
Install
$ npx -y skills add catlog22/maestro-flow --agent claude-code

How 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/dispatch

Context preview

What this command does when you run it.

| Input | Source | Required | |-------|--------|----------| | User requirement | From coordinator Phase 1 | Yes | | Session folder | From coordinator Phase 2 | Yes | | Pipeline definition | From SKILL.md Pipeline Definitions | Yes | | Parallel mode | From team-session.json

Command definition

dispatch.md

Command: Dispatch

Phase 2: Context Loading

| Input | Source | Required | |-------|--------|----------| | User requirement | From coordinator Phase 1 | Yes | | Session folder | From coordinator Phase 2 | Yes | | Pipeline definition | From SKILL.md Pipeline Definitions | Yes | | Parallel mode | From team-session.json `parallel_mode` | Yes | | Max branches | From team-session.json `max_branches` | Yes | | Independent targets | From team-session.json `independent_targets` (independent mode only) | Conditional |

1. Load user requirement and refactoring scope from team-session.json 2. Load pipeline stage definitions from SKILL.md Task Metadata Registry 3. Read `parallel_mode` and `max_branches` from team-session.json 4. For `independent` mode: read `independent_targets` array from team-session.json

Phase 3: Task Chain Creation (Mode-Branched)

Task Description Template

Every task description uses structured format for clarity:

TaskCreate({
  subject: "<TASK-ID>",
  description: "PURPOSE: <what this task achieves> | Success: <measurable completion criteria>
TASK:
  - <step 1: specific action>
  - <step 2: specific action>
  - <step 3: specific action>
CONTEXT:
  - Session: {run_dir}/work/team
  - Scope: <refactoring-scope>
  - Branch: <branch-id or 'none'>
  - Upstream artifacts: <artifact-1>, <artifact-2>
  - Shared memory: {run_dir}/work/team/wisdom/.msg/meta.json
EXPECTED: <deliverable path> + <quality criteria>
CONSTRAINTS: <scope limits, focus areas>
---
InnerLoop: <true|false>
BranchId: <B01|A|none>"
})
TaskUpdate({ taskId: "<TASK-ID>", addBlockedBy: [<dependency-list>], owner: "<role>" })

Mode Router

| Mode | Action | |------|--------| | `single` | Create 5 tasks (ANALYZE → DESIGN → REFACTOR → VALIDATE + REVIEW) -- unchanged from linear pipeline | | `auto` | Create ANALYZE-001 + DESIGN-001 only. **Defer branch creation to CP-2.5** after design completes | | `fan-out` | Create ANALYZE-001 + DESIGN-001 only. **Defer branch creation to CP-2.5** after design completes | | `independent` | Create M complete pipelines immediately (one per target) |

---

Single Mode Task Chain

Create tasks in dependency order (backward compatible, unchanged):

**ANALYZE-001** (analyzer, Stage 1):

TaskCreate({
  subject: "ANALYZE-001",
  description: "PURPOSE: Analyze codebase architecture to identify structural issues | Success: Baseline metrics captured, top 3-7 issues ranked by severity
TASK:
  - Detect project type and available analysis tools
  - Execute analysis across relevant dimensions (dependencies, coupling, cohesion, layering, duplication, dead code)
  - Collect baseline metrics and rank architecture issues by severity
CONTEXT:
  - Session: {run_dir}/work/team
  - Scope: <refactoring-scope>
  - Branch: none
  - Shared memory: {run_dir}/work/team/wisdom/.msg/meta.json
EXPECTED: {run_dir}/outputs/architecture-baseline.json + {run_dir}/outputs/architecture-report.md | Quantified metrics with evidence
CONSTRAINTS: Focus on <refactoring-scope> | Analyze before any changes
---
InnerLoop: false"
})
TaskUpdate({ taskId: "ANALYZE-001", owner: "analyzer" })

**DESIGN-001** (designer, Stage 2):

TaskCreate({
  subject: "DESIGN-001",
  description: "PURPOSE: Design prioritized refactoring plan from architecture analysis | Success: Actionable plan with measurable success criteria per refactoring
TASK:
  - Analyze architecture report and baseline metrics
  - Select refactoring strategies per issue type
  - Prioritize by impact/effort ratio, define success criteria
  - Each refactoring MUST have a unique REFACTOR-ID (REFACTOR-001, REFACTOR-002, ...) with non-overlapping target files
CONTEXT:
  - Session: {run_dir}/work/team
  - Scope: <refactoring-scope>
  - Branch: none
  - Upstream artifacts: architecture-baseline.json, architecture-report.md
  - Shared memory: {run_dir}/work/team/wisdom/.msg/meta.json
EXPECTED: {run_dir}/outputs/refactoring-plan.md | Priority-ordered with structural improvement targets, discrete REFACTOR-IDs
CONSTRAINTS: Focus on highest-impact refactorings | Risk assessment required | Non-overlapping file targets per REFACTOR-ID
---
InnerLoop: false"
})
TaskUpdate({ taskId: "DESIGN-001", addBlockedBy: ["ANALYZE-001"], owner: "designer" })

**REFACTOR-001** (refactorer, Stage 3):

TaskCreate({
  subject: "REFACTOR-001",
  description: "PURPOSE: Implement refactoring changes per design plan | Success: All planned refactorings applied, code compiles, existing tests pass
TASK:
  - Load refactoring plan and identify target files
  - Apply refactorings in priority order (P0 first)
  - Update all import references for moved/renamed modules
  - Validate changes compile and pass existing tests
CONTEXT:
  - Session: {run_dir}/work/team
  - Scope: <refactoring-scope>
  - Branch: none
  - Upstream artifacts: refactoring-plan.md
  - Shared memory: {run_dir}/work/team/wisdom/.msg/meta.json
EXPECTED: Modified source files + validation passing | Refactorings applied without regressions
CONSTRAINTS: Preserve existing behavior | Update all references | Follow code conventions
---
InnerLoop: true"
})
TaskUpdate({ taskId: "REFACTOR-001", addBlockedBy: ["DESIGN-001"], owner: "refactorer" })

**VALIDATE-001** (validator, Stage 4 - parallel):

TaskCreate({
  subject: "VALIDATE-001",
  description: "PURPOSE: Validate refactoring results against baseline | Success: Build passes, tests pass, no metric regressions, API compatible
TASK:
  - Load architecture baseline and plan success criteria
  - Run build validation (compilation, type checking)
  - Run test validation (existing test suite)
  - Compare dependency metrics against baseline
  - Verify API compatibility (no dangling references)
CONTEXT:
  - Session: {run_dir}/work/team
  - Scope: <refactoring-scope>
  - Branch: none
  - Upstream artifacts: architecture-baseline.json, refactoring-plan.md
  - Shared memory: {run_dir}/work/team/wisdom/.msg/meta.json
EXPECTED: {run_dir}/outputs/validation-results.json
Read more
Ships withmaestro-flow

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

Get the whole plugin