/mstack:m-dispatchfrom mstack
Fans independent subtasks out to parallel subagents (Claude, DSH, Codex, Orca), then merges and verifies results. Use when a task decomposes into parts with no shared files or sequential dependencies.
Ships in mstack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Turn one large job into independent subtasks and run them in parallel. The main session only decomposes, merges, and adjudicates. Subagents do the reading and editing so your context stays small.
The default executor is this session's own subagent. Orca is the exception.
Use when the parts share no state and can be done without each other's context: separate modules, separate failing files, multi-angle review, the same brief on more than one model.
Do NOT use when:
m-debug).m-think, m-plan).m-team calls this skill once per round. Do not restate that loop here.First line you say: Using m-dispatch: split into independent slices, prove each one.
No worker result is merged, and no worktree is reused, until you have looked at it yourself.
Closed loopholes: a worker's "done", a completed notice, a tidy summary, a majority of identical patches, and a message to an idle worker asking how it is going all count as looking at nothing. Breaking the letter of this rule is breaking its spirit.
first pass: among workers on the same brief, the first result that meets VERIFY wins; later results are logged and not merged. rank all: wait for every worker, then order the non-gap results by the criterion you wrote next to the rule. best-of: wait for every worker and keep one winner by that criterion. Different files are coverage, not a race — every slice must return. A race is several workers on one brief.todo_write entry per subtask (several may be in_progress). Each prompt is self-contained. Never assign the same file to two subtasks. When two or more subtasks consume a type or interface that does not exist yet, one task lands it first and the fan-out starts from that commit. Fill references/subtask-prompt-template.md (GOAL / WHY / SCOPE / OUT OF SCOPE / CONTEXT / VERIFY / RETURN) before the first spawn.m-cua) or bulk (tests, reading, drafts). Send it to that role's route and put ROLE: <role> in the brief. Do not send bulk or operate work to the think route. Reshape the brief for the model family. Table and adapters: references/model-routing.md. An omitted model inherits the expensive default; light reading goes to a cheap route.agent-<task> (no / allowed; flow in references/harness-commands.md) when LayerFS is available, otherwise mola worktree new <task> (agent/<task>, set up from .mstack/worktree.json and rolled back if setup fails; plain git worktree add ../<repo>-wt/<task> -b agent/<task> without mola). Clean up later with mola worktree gc. The worker stays there. Where the tool cannot take a cwd (Harness notes), create the worktree yourself and put its path in the prompt. A LayerFS worker has no folder: give it the project and Branch names, and it writes only through file.* on that Branch. Never point two worktrees at one build output dir (one CARGO_TARGET_DIR): the project's own crates get the same artifact names, so a worker's test can link another worker's code and pass or fail on it. On a small machine, cap each worker's build jobs or run the builds in turn; a final check builds the merged tree in its own dir.git -C <worktree> status --short (LayerFS: branch.get and branch.diff on agent-<task>) twice, at least 10 s apart, and read the harness's agent list. Stopped = not running and both outputs identical. Still running or output moved → interrupt it, wait, look again. Never message an idle worker to ask for progress: the message restarts it. Progress shows in the worktree or Branch and its commits.group/*, auto/*). Commands: references/harness-commands.md. Use your own subagents unless you need another vendor's agent, or a worktree a human will keep using. When the person wants to watch or step into the workers and herdr runs, put each worker in a herdr pane (commands and rules: references/harness-commands.md, herdr). Orca only in those two cases, and only when orca is on PATH. After Orca worker-start, end this turn. Do not poll and do not write a watch script.node "<this skill dir>/scripts/cluster-diffs.mjs" <a.patch> <b.patch> .... <this skill dir> is the directory this SKILL.md was loaded from (Claude Code shows it as the skill base directory; in the mstack repo it is skills/m-dispatch). If the script cannot be found, cluster the normalized patch texts by hand and say so in the report. A strict majority (more than half the candidates, one cluster) is the leading patch, not proof. Show every candidate side by side — majority label included, or the tie — to a verifier from a family that no author used (references/model-routing.md, "Judge family"). It follows m-review (both orders, authors hidden) and returns APPROVE or REQUEST CHANGES; you adjudicate if verifier and majority disagree. See references/decisions.md..mstack/dispatch/rulings.md: Ruling: decision | reason | cost if wrong. Keep going; do not ask.| Claim | Evidence required | Evidence that is NOT enough |
|---|---|---|
| Worker finished | RETURN with command, output, files; git -C <worktree> status shows those files | "done"; a completed notice |
| Worktree free to reuse | two identical status reads 10 s apart, agent not running | one quiet read; the agent said it stopped |
| Patch is the best one | step 8 verifier verdict over all candidates | majority count alone |
| Merged result works | step 9 reviewer ran the real suite, exit 0 | each worker's own green run |
| You will be tempted to think… | Reality |
|---|---|
| "The brief is clear; no VERIFY/RETURN contract needed." | The template was once never linked, so workers could answer "done" with no evidence (reviews/2026-11-04-acceptance.md #7). Fill it. |
"The repo-relative skills/m-dispatch/scripts/ path will resolve." | Installed as a plugin that is MODULE_NOT_FOUND and the check quietly vanishes (reviews/2026-11-06-round2.md #1). Use the skill dir. |
| "It said completed, so the worktree is mine." | completed is a notice, not a process exit; background children keep writing (research/round3/pstack-craft.md T2). Step 5. |
| "I'll ask the idle worker for an update." | The message wakes it and it works again (pstack-craft T3). Read the worktree. |
| "One 402 only hits one worker." | It kills every worker on that route together (references/harness-commands.md). Re-route the rest. |
| "Teammates and workflow agents each get their own directory." | They share the lead's cwd (research/round3/dsh-team.md). Only subagent takes a cwd. |
Red flags — stop and redo the step: you wrote "should be merged"; two prompts name one file; a worker prompt carries the selection rule; you are about to poll Orca; the verifier shares a family with an author.
Chinese §4 report: one-line conclusion → what changed (file:line) → how it was verified (command + result) → what is left and the risks.
Also: the selection rule, the route chosen per subtask, the cluster JSON (or "not a patch race"), and every gap that did not count. Findings arrive as file:line + problem + failure scenario (cap about 8 per worker). Dedupe and confirm before you report them. Pass large artifacts as paths, not pasted text.
m-plan.orca is not on PATH → do not invent a command. Use this session's subagents.| Need | Executor |
|---|---|
| Parallel work in this session (default) | Claude Code Agent; DSH subagent / subagent_fork |
| A different model family, or a one-shot second opinion | subagent_claude_code / subagent_codex; codex exec |
| Headless batch on WSL | dsh --profile mola-cli via magpie |
| Another vendor's agent, or a worktree left for a human | Orca, only if orca is on PATH. End the turn after start. |
m-implementer (Claude Code subagent_type: "mstack:m-implementer"); read-only fan-out is m-explorer ("mstack:m-explorer"). In DSH use the same names as label or teammate name.Agent call in one message runs in parallel; a later message is sequential. run_in_background: true. The returned id is for a follow-up, not for polling Orca. Agent reaches only Claude models: a different-family judge comes from mola run or DSH, else mark the verdict same-family (references/model-routing.md, "In plain Claude Code").references/dsh-native.md. subagent takes a cwd; spawn_teammate and a workflow agent() do not, so isolated edits never go through them. Never a direct deepseek/* route. group/smart-split has no reasoning-effort field.references/decisions.md (opens in a new tab)references/dsh-native.md (opens in a new tab)references/harness-commands.md (opens in a new tab)references/model-routing.md (opens in a new tab)references/subtask-prompt-template.md (opens in a new tab)scripts/cluster-diffs.mjs (opens in a new tab)scripts/cluster-diffs.test.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
The task decomposes into 2+ parts with no shared files or sequential dependency, or the user asks to fan work out to parallel agents.
npx claudepluginhub mola-maker/mstack --plugin mstack17 skills in this plugin
/m-cuaDrive a real desktop app, Android device or browser to prove L3/L4 acceptance. Use for 点一下/操作界面/真机验收/computer use./m-debugRoot-cause a bug or failing test: reproduce, competing hypotheses, regression test. Use for debug一下/为什么报错/这个测试挂了./m-deslop删掉 AI 味和冗余——多余注释、死代码、无谓抽象、套话堆砌,先保护行为再减。Use when the user says "deslop / 去AI味 / 删冗余 / 这段太啰嗦 / 精简一下", or a diff feels bloated./m-goalLong-running goal loop: goal file, checkpoints, stop rules, mandatory closeout. Use for run-until-done work, 别停/一直做到完成./m-guardGuardrails: destructive-command checks, folder freeze, plugin vetting, loop brake, known traps. Use for 小心点/冻结目录/这插件安全吗/死循环了./m-handoffSave or restore working state in .mstack/handoff.md before compact, model switch or session end. Use for 存档/交接/接着上次/compact.Other plugins' skills for the same job