一键导入
dispatch
Use when multiple tasks are ready and you want to assign them to workers. Supports parallel (worktree-isolated) and sequential (direct on branch) modes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when multiple tasks are ready and you want to assign them to workers. Supports parallel (worktree-isolated) and sequential (direct on branch) modes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Iterative review-fix loop for accumulated milestone/branch changes. Runs parallel reviewers, fixes findings autonomously, repeats until clean. Use after multiple tasks merge to a milestone branch, or before merging to main. Invoke with /milestone-review --base-branch main. Supports --dry-run and --max-iterations.
This skill should be used when the user wants a comprehensive code review using multiple specialized reviewers in parallel. Invoked with /multi-review or when user asks for 'thorough review', 'full code review', or 'review from multiple perspectives'. Use --plan <path> to review an implementation plan pre-coding.
Use when facing a bug, test failure, or unexpected behavior that isn't immediately obvious
Use when starting a new feature or idea that needs thorough pre-execution planning. Use instead of calling /product-review, /spec, and review skills individually.
Use when you have an idea, goal, or feature description and need to turn it into an actionable plan with tasks
Use when you need measured performance evidence by running a repeatable command on the current branch and a baseline ref
| name | dispatch |
| description | Use when multiple tasks are ready and you want to assign them to workers. Supports parallel (worktree-isolated) and sequential (direct on branch) modes. |
| allowed-tools | Bash, Read, Glob, Grep, AskUserQuestion, Agent |
You are an orchestrator dispatching workers for tasks. By default, each worker runs in its own git worktree for true filesystem isolation. With --sequential, workers execute directly on the current branch without worktrees.
Arguments: $ARGUMENTS
Parse the following patterns:
--count N — Auto-select N ready tasks--sequential — Execute tasks one at a time on the current branch (no worktree isolation, no PR per task). Use for dependent/sequential tasks that need to see each other's changes.--plan-first — Force all workers into plan approval mode--no-plan — Disable auto risk detection, all use bypassPermissions--yes — Skip dispatch confirmation (used by /auto-run for autonomous operation)--model opus|sonnet — Override model selection for all tasks<task-id> — Specific task to dispatch<task-id>:"context" — Task with custom context (e.g., INT-15:"Use PriceCache")If no arguments provided, default to --count 3.
If --count N was specified (or defaulted):
Query ready tasks: call list_issues(state=Todo) to get candidate tasks. For each, call get_issue(id, includeRelations=true) and filter to those with empty blockedBy arrays. These are the "ready" tasks.
Select the first N tasks that are:
If specific tasks were provided:
Validate each task exists by calling get_issue(id=<task-id>, includeRelations=true).
If --sequential was specified, skip this step (no worktrees used).
Prune any orphaned worktrees before spawning new workers:
git worktree prune
git worktree list
Only if --sequential was specified.
CURRENT_BRANCH=$(git branch --show-current)
if [ "$CURRENT_BRANCH" = "main" ] || [ "$CURRENT_BRANCH" = "master" ]; then
echo "ERROR: Cannot use --sequential on main/master. Switch to a working branch first."
# STOP — do not proceed
fi
echo "Sequential mode: tasks will execute directly on branch $CURRENT_BRANCH"
If on main/master, abort dispatch with a clear error. Sequential mode commits directly to the current branch — never to main.
Skip if --no-plan was specified. If --plan-first was specified, mark ALL tasks [PLAN].
First, check for a project-level review config:
cat .claude/review.json 2>/dev/null || cat .claude/risk-tiers.json 2>/dev/null || echo "No review config found"
With review config: Match task file paths (from issue description or related files) against tier patterns. The highest matching tier determines the task's risk level:
| Risk Tier | Dispatch Mode |
|---|---|
| critical | [PLAN] |
| high | [PLAN] |
| medium | [AUTO] |
| low | [AUTO] |
Without review config (keyword fallback): For each task, check its title + description (from get_issue) for high-risk keywords (case-insensitive):
auth, authentication, authorization, encrypt, secret, password, token, credentialmigration, migrate, schema change, drop table, delete datapayment, billing, subscription, transactionarchitecture, redesign, rewrite, refactor coreMark matching tasks [PLAN], others [AUTO].
If --model flag was specified: Use that model for ALL tasks (overrides all other logic).
With review config:
| Risk Tier | Model |
|---|---|
| critical | opus |
| high | opus |
| medium | sonnet |
| low | sonnet |
Without review config (keyword fallback):
architecture, security, auth, migration, rewrite, redesign in task title/description → opussonnetDisplay the model in the dispatch summary: [AUTO/sonnet] or [PLAN/opus].
For each task without explicit context:
get_issue(id=<task-id>, includeRelations=true)list_issues(state="In Progress")Example contexts:
Present a summary to the user:
If --sequential:
Ready to dispatch N tasks SEQUENTIALLY on branch <current-branch>:
(Tasks execute one at a time, directly on this branch — no worktrees, no PRs per task)
1. <task-id> (P1 <type>) [SEQ/opus]: <title>
Context: "<generated or provided context>"
2. <task-id> (P2 <type>) [SEQ/sonnet]: <title>
Context: "<generated or provided context>"
...
If parallel (default):
Ready to dispatch N workers (worktree-isolated):
1. <task-id> (P1 <type>) [PLAN/opus]: <title>
Context: "<generated or provided context>"
2. <task-id> (P2 <type>) [AUTO/sonnet]: <title>
Context: "<generated or provided context>"
...
The [PLAN/AUTO/SEQ] tags indicate dispatch mode. The [opus/sonnet] tags indicate the model selection from Step 2.7.
If --yes was specified:
Skip the AskUserQuestion confirmation and proceed directly to Step 5.
Otherwise, use AskUserQuestion to confirm:
Ask: "Confirm dispatch of N workers?"
Wait for explicit user confirmation before proceeding.
If user selects "No, cancel", abort dispatch.
If --sequential: use the Sequential Spawn path below.
Otherwise: use the Parallel Spawn path (default).
Spawn each worker as a subagent with worktree isolation using the Agent tool. Launch all workers in a single message with multiple Agent tool calls for maximum parallelism.
For each task, use the Agent tool with:
isolation: "worktree" — Each worker gets its own git worktreerun_in_background: true — Workers run concurrentlymode: "bypassPermissions" for [AUTO] tasks, mode: "plan" for [PLAN] tasksmodel: "<selected>" from Step 2.7name: "<task-id>" — Addressable by task IDSpawn prompt for [AUTO] tasks:
You are an autonomous worker in your own isolated git worktree. Your task:
<task title and description from get_issue>
Context: <generated context>
Currently in progress (other workers): <list from list_issues state=In Progress, if any>
Instructions:
1. Run `/start-task <task-id>` to claim the task and verify your environment
2. Implement the task according to the acceptance criteria
3. Run `/finish-task <task-id>` when tests pass and implementation is complete
CRITICAL CONTRACT:
- You MUST run /finish-task before completing. A task without a session summary is invisible to coordination.
- If you cannot complete the task, write a partial session summary explaining why before exiting.
- Your worktree will be cleaned up automatically after you finish.
Spawn prompt for [PLAN] tasks:
You are an autonomous worker in your own isolated git worktree, spawned in PLAN MODE. Your task:
<task title and description from get_issue>
Context: <generated context>
Currently in progress (other workers): <list from list_issues state=In Progress, if any>
Instructions:
1. Run `/start-task <task-id>` to claim the task and gather context
2. Create a detailed implementation plan
3. Your plan will be reviewed before you can proceed to implementation
4. After approval, implement the task
5. Run `/finish-task <task-id>` when tests pass and implementation is complete
CRITICAL CONTRACT:
- You MUST run /finish-task before completing. A task without a session summary is invisible to coordination.
- If you cannot complete the task, write a partial session summary explaining why before exiting.
- Your worktree will be cleaned up automatically after you finish.
--sequential)Execute tasks one at a time, in order, directly on the current branch. Each worker sees the previous worker's commits.
For each task in order, use the Agent tool with:
isolation parameter — worker shares the orchestrator's filesystemrun_in_background: false — orchestrator waits for completion before starting the next taskmode: "bypassPermissions" (sequential tasks are pre-approved by dispatch confirmation)model: "<selected>" from Step 2.7name: "<task-id>" — Addressable by task IDSequential spawn prompt:
EXECUTION_MODE: sequential
BRANCH: <current branch name>
You are an autonomous worker executing DIRECTLY on branch <current-branch>. No worktree isolation — your changes are immediately visible to the orchestrator and subsequent workers.
Your task:
<task title and description from get_issue>
Context: <generated context>
Instructions:
1. Run `/start-task <task-id>` to claim the task and verify your environment
- You are already on the correct branch. Do NOT create a new task branch.
2. Implement the task according to the acceptance criteria
3. Run `/finish-task <task-id> --direct` when tests pass and implementation is complete
- The --direct flag skips PR creation — your commits go directly to this branch.
CRITICAL CONTRACT:
- You MUST run /finish-task with the --direct flag before completing.
- If you encounter merge conflicts or cannot complete the task, STOP immediately and report why. Do NOT retry merge strategies.
- Your commits accumulate on this branch for later review via /milestone-review.
After each sequential worker completes:
If all sequential tasks complete successfully: Proceed to Step 6.
If --sequential:
Sequential dispatch complete: N tasks executed on branch <current-branch>
Tasks completed:
1. <task-id> [SEQ/sonnet]: <title> ✓
2. <task-id> [SEQ/sonnet]: <title> ✓
...
All commits are on branch <current-branch>.
No PRs created — review accumulated changes with /milestone-review.
IMPORTANT: Before ending this session, run /reconcile-summary to sync
all worker results with the task board.
If parallel (default):
After all workers are spawned, provide a summary:
Dispatch complete: N workers spawned (worktree-isolated)
Workers:
1. <task-id> [AUTO/sonnet]: <title>
2. <task-id> [PLAN/opus]: <title>
...
Each worker has its own git worktree — no filesystem conflicts possible.
Workers will:
1. Run /start-task to claim the task
2. Implement the task
3. Run /finish-task when tests pass (creates PR, session summary)
Workers are running in the background. You will be notified as each completes.
After all workers finish, run /reconcile-summary to process their results.
IMPORTANT: Before ending this session, run /reconcile-summary to sync
all worker results with the task board.
/orient first to identify workAuto-select 3 tasks (default — parallel, worktree-isolated):
/dispatch
Auto-select specific count:
/dispatch --count 5
Specific tasks:
/dispatch INT-15 INT-16
With custom context:
/dispatch INT-15:"Use existing ticker format"
Force all tasks to use Opus:
/dispatch --count 3 --model opus
Sequential execution (tasks run one at a time on current branch):
/dispatch --sequential INT-14 INT-15 INT-16
Sequential with auto-run (autonomous):
/dispatch --sequential --count 3 --yes