From autorun
Execute a staged master plan by decomposing into parallel stages
How this command is triggered — by the user, by Claude, or both
Slash command
/autorun:orchestrateopusThe summary Claude sees in its command listing — used to decide when to auto-load this command
# Orchestrate Master Plan You are tasked with executing a staged master plan by parsing its dependency graph and launching `start.md` for each stage in topological wave order. Each stage is triaged independently — `start.md` routes it to the appropriate pipeline (QUICK / MEDIUM / LARGE) based on scope. ## Arguments **MASTER_PLAN_PATH**: $ARGUMENTS (required) The path to a master plan file containing stages with dependency information OR instructions for the master plan. If no arguments are provided, write a review file asking for the master plan path, then wait. ## Review File Pattern...
You are tasked with executing a staged master plan by parsing its dependency graph and launching start.md for each stage in topological wave order. Each stage is triaged independently — start.md routes it to the appropriate pipeline (QUICK / MEDIUM / LARGE) based on scope.
MASTER_PLAN_PATH: $ARGUMENTS (required)
The path to a master plan file containing stages with dependency information OR instructions for the master plan.
If no arguments are provided, write a review file asking for the master plan path, then wait.
CRITICAL: Whenever you need to ask the user questions, you MUST use the review file pattern:
~/.autorun/review/YYYY-MM-DD-HHMMSS-summary.md
mkdir -p ~/.autorun/review**Your answer**: placeholdersbash ${CLAUDE_PLUGIN_ROOT}/scripts/watch-for-review.sh <file_path>Do NOT use AskUserQuestion — this is a headless autorun command. All work is delegated to contained Tasks for context isolation.
Spawn a single general-purpose Task to parse the master plan. Pass it:
$ARGUMENTSThe Task should:
create_plan later)PROJECT_ROOT=$(git rev-parse --show-toplevel)
BASE_BRANCH=$(git -C "$PROJECT_ROOT" rev-parse --abbrev-ref HEAD)
The BASE_BRANCH is the branch that was active when orchestration started — all stage worktrees will branch off it, and all merges will target it (NOT necessarily main/master).wave_2_master_plan.md → wave-2-master-planYYYY-MM-DD-)wave\d+-? prefix2026-02-20-wave2-token-design-audit → token-audit, wave2-pixel-perfect-visual-qa → pixel-qaThe Task should return:
PLAN_NAME - derived kebab-case namePROJECT_SLUG - short slug for session namingPLAN_PATH - absolute path to the master planPROJECT_ROOT - absolute path to the project rootBASE_BRANCH - the branch that was active when orchestration started (merge target)STAGES - a list of stages, each with: number, name, dependencies, and a scope description summarizing that stage's goals and deliverablesWAVES - the computed wave groups (array of arrays of stage numbers)TOTAL_STAGES - count of stagesTOTAL_WAVES - count of wavesIf the plan cannot be parsed or has circular dependencies, return the error details so a review file can be written.
Spawn a single general-purpose Task to create the orchestration directory structure and write stage context files. Pass it all values from Step 1 (including PROJECT_SLUG).
The Task should:
Create the orchestration directory:
ORCH_DIR="$HOME/.autorun/orchestration/$PLAN_NAME"
mkdir -p "$ORCH_DIR/stages"
Write a context file for each stage at $ORCH_DIR/stages/stage-N-context.md:
# Stage N: Stage Name Here
## Scope
[The stage's scope description extracted from the master plan]
## Dependencies
- Depends on: Stage X, Stage Y (or "None" for wave 1 stages)
## Orchestration
orchestration_dir: ~/.autorun/orchestration/plan-name/
stage_number: N
status_file: ~/.autorun/orchestration/plan-name/status.json
base_branch: <branch>
These are NOT implementation plans — they're context documents that start.md will use to triage the stage and route it to the appropriate pipeline. The detailed phases will be determined by create_plan after research.
Write the initial status.json at $ORCH_DIR/status.json:
{
"plan_path": "<absolute path to master plan>",
"plan_name": "<plan-name>",
"project_slug": "<slug>",
"project_root": "<project root>",
"base_branch": "<branch active when orchestration started>",
"created_at": "<ISO 8601 timestamp>",
"stages": {
"1": {
"status": "pending",
"name": "<stage name>",
"depends_on": [],
"branch": null,
"context_file": "<absolute path to stage-1-context.md>",
"plan_file": null,
"started_at": null,
"completed_at": null,
"phases": {
"research": { "started_at": null, "completed_at": null },
"create_plan": { "started_at": null, "completed_at": null },
"implement": { "started_at": null, "completed_at": null, "current_phase": null, "total_phases": null },
"merge": { "started_at": null, "completed_at": null }
}
}
},
"current_wave": 1,
"waves": [[1], [2,3,4], ...]
}
Emit orchestration_started event to $ORCH_DIR/events.jsonl alongside the status.json write:
import json, datetime, os
events_path = os.path.join(ORCH_DIR, "events.jsonl")
with open(events_path, "a") as f:
f.write(json.dumps({
"ts": datetime.datetime.now(datetime.UTC).strftime("%Y-%m-%dT%H:%M:%SZ"),
"type": "orchestration_started",
"plan_name": plan_name,
"project_slug": project_slug,
"project_root": project_root,
"total_stages": len(stages),
"total_waves": len(waves),
"waves": waves,
"orch_dir": ORCH_DIR,
}) + "\n")
The Task should return:
ORCH_DIR - absolute path to orchestration directorySTATUS_FILE - absolute path to status.jsonPROJECT_SLUG - the project slug (passed through from Step 1)CONTEXT_FILES - list of stage context file paths writtenFor each stage in wave 1, create a tmux session directly via Bash (do NOT spawn Tasks for this). Run all stage launches in parallel as separate Bash tool calls:
SESSION_NAME="${PROJECT_SLUG}_stage-${STAGE_NUM}"
CONTEXT_FILE="$ORCH_DIR/stages/stage-${STAGE_NUM}-context.md"
tmux new-session -d -s "$SESSION_NAME" -n "s${STAGE_NUM}" \
"claude --worktree 'stage-${STAGE_NUM}' '/autorun:start $CONTEXT_FILE'"
start.md will triage the stage scope and route to the appropriate pipeline. --worktree provides isolation for parallel stages.
This kicks off the pipeline: start.md triages → routes to appropriate pipeline → merge.
After all wave 1 sessions are created, start the monitor as a background process in the current session so the user can see progress without attaching elsewhere:
bash ${CLAUDE_PLUGIN_ROOT}/scripts/monitor-orchestration.sh $ORCH_DIR &
echo "Monitor started (PID $!) — logging to ~/.autorun/logs/${PROJECT_SLUG}-monitor.log"
The monitor runs in the background of the current session alongside the orchestration:
continue to sessions stuck at an idle ❯ prompt (common after API errors or rate limits)~/.autorun/logs/${PROJECT_SLUG}-monitor.logAfter all Tasks complete, print a summary:
Orchestration launched:
Master Plan: <plan-path>
Plan Name: <plan-name>
Orchestration: ~/.autorun/orchestration/<plan-name>/
Status File: ~/.autorun/orchestration/<plan-name>/status.json
Total Stages: N
Total Waves: M
Waves: [[1], [2,3,4], [5], ...]
Wave 1 launched (N stages):
Stage 1: <stage-name>
Branch: stage-1-<name>
Session: ${PROJECT_SLUG}_stage-1
Pipeline: start.md → triage → appropriate pipeline → merge
Pending waves (will be launched by merge.md as dependencies complete):
Wave 2: stages 2, 3, 4
Wave 3: stages 5
...
Monitor log: ~/.autorun/logs/${PROJECT_SLUG}-monitor.log
Sessions: tmux list-sessions | grep ${PROJECT_SLUG}
Status: cat ~/.autorun/orchestration/<plan-name>/status.json
orchestrate (parse plan, write stage context files, launch wave 1)
→ start.md (per stage — triages scope, routes to pipeline)
→ [QUICK: implement_plan]
→ [MEDIUM: create_plan → implement_plan]
→ [LARGE: research_codebase → create_plan → implement_plan]
→ merge (merges branch, checks wave completion, launches next wave)
→ start.md (next wave stages — triage and route again)
→ ... until all waves complete
start.md with --worktreechain_on_complete to the plan frontmatterchain_on_completestart.mdWhen something isn't working as expected:
npx claudepluginhub codefilabs/marketplace --plugin autorun/orchestrateGenerates test orchestration configs for staged workflows with dependencies, parallel execution, smart selection of affected tests, retries, and CI/CD optimization.
/orchestrateDecomposes complex tasks into ordered sub-tasks with dependencies and parallel execution, tracks progress and failures, verifies results, and outputs a status summary table.
/orchestrateAnalyzes complex user requests, splits them into steps, assembles agent teams, executes with verification, and retries up to 5 times per step on failure.
/orchestrateOrchestrates parallel task execution via Agent Teams API, parsing prompt_plan.md tasks, analyzing dependencies, and coordinating across Node.js, Python, Rust, Go, .NET projects.
/orchestrateOrchestrates sequential agent workflows for complex tasks like feature development, bug fixes, refactoring, and security reviews, producing handoff documents between agents and a final report.
/orchestrateRoutes arguments to orchestration subcommands for multi-agent workflows: menu, help, explain, examples, templates, or inline syntax execution with visual feedback.