Mola-maker/mstack / skills/m-dispatch
m-dispatch
VerifiedFan independent subtasks out to Claude subagents, DSH headless, Codex or Orca; isolate, merge, verify. Use for 分派/并行/开N个agents.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 10.7 KB |
| references/decisions.md | markdown | 1.1 KB |
| references/dsh-native.md | markdown | 4.9 KB |
| references/harness-commands.md | markdown | 8.7 KB |
| references/model-routing.md | markdown | 7.4 KB |
| references/subtask-prompt-template.md | markdown | 2.2 KB |
| scripts/cluster-diffs.mjs | script | 2.5 KB |
| scripts/cluster-diffs.test.mjs | script | 2.2 KB |
references/model-routing.md
View on GitHub# Model routing (m-dispatch, m-team, m-review)
Read this at step 3 of m-dispatch, when m-team picks a judge, or when m-review picks a reviewer. One file holds the data: `config/model-routing.json` at the mstack repo or plugin root. `mola run` reads the same file, so what you do by hand here is what the CLI does by code. If the file is not reachable from where you run, use the table below and note it in the dispatch note.
## What the file contains
- `tasks.<kind>.picks` — magpie routes for that kind of work, best first. `evidence` says why; `unverified: true` means no dedicated leaderboard backs the pick, so treat it as a default you may override with a local result.
- `families.<name>` — `match` substrings that classify a route id, a `style` (xml, markdown, xml-or-markdown) and `rules` for writing a brief to that family. Classify a route by the first family whose `match` appears in its id (`auto/claude-opus-5-5` → claude, `group/smart-split` → group).
- The ranks come from a leaderboard snapshot dated in the file. They go stale; when your own eval disagrees with the file, your eval wins and the disagreement is a Ruling line.
## Roles (v2)
Work goes to the model that is good at it: strong models think, models that are steady with tools operate, cheap models do volume.
| Role | Kinds | Route | What it needs |
|---|---|---|---|
| think | plan, review, debug | `group/m-think` | the strongest reasoning; cost is accepted |
| build | implement, frontend, long-context, vision | `group/m-build` | strong at code |
| operate | operate (drive a UI, device or tool: `m-cua`, QA flows, release mechanics) | `group/m-operate` | reliable tool calls, fast, follows steps |
| bulk | test, explore, research reading, zh-writing | `group/m-bulk` | cheap and good enough |
- Each role is one magpie routing group. Which models are in it, in what order, and what happens on a 402 are magpie's: `magpie group m-think` shows it, `magpie group set m-think models=…` changes it. Do not rebuild that fallback by hand.
- `roles.<name>.unverified: true` means the membership is a starting guess. Replace it with a measurement, not with an opinion.
- DSH: `dsh --profile mola-cli --patch "<mstack root>/config/dsh-roles/m-<role>.yml" "<task>"`. The overlay declares the group itself, so it works when the profile's model list does not show it.
- A group missing on this machine (the request fails with an unknown model) → use the kind's next pick and say so in the report; `mola run` does this by itself. `magpie group add m-<role> models=<roles.<role>.members, comma separated> routing=order` creates it.
- For the judge rule below, a role group counts as the family in `roles.<name>.leads`, not as a family of its own (`mola go` applies the same rule). With claude leading both think and build, the reviewer of build work is the first `review` pick that is not claude-led.
## Choosing a route
1. Name the kind per subtask: plan, implement, operate, debug, review, test, frontend, long-context, research, explore, zh-writing, vision. A subtask that fits none gets `implement` if it edits and `explore` if it only reads.
2. Take `picks[0]` (in v2 this is the role group). On a 402/429 or a missing route, take the next entry; do not retry the same one. When the list is spent, stop and report (m-dispatch stop conditions).
3. Never route to `deepseek/*` directly. Only `group/*` and `auto/*` are allowed.
4. Same brief on several models (a race): take one route per family from `picks`, so the candidates differ in training, not only in size.
| Kind | First pick (role group) | Behind it, when the group is missing or spent | Next family worth trying |
|---|---|---|---|
| plan, review, debug | `group/m-think` | claude-opus | gemini |
| implement, frontend, long-context, vision | `group/m-build` | claude-opus or sonnet | deepseek / gemini |
| operate | `group/m-operate` | gpt | kimi |
| test | `group/m-bulk` | claude-sonnet | deepseek flash |
| explore | `group/m-bulk` | gemini flash | deepseek flash |
| research | `group/m-bulk` | group/smart-split | claude-opus |
| zh-writing | `group/m-bulk` | kimi | deepseek |
The table is a map to the file, not a copy of it. Read the file for the exact route ids.
## Judge family
The judge of a patch, a plan or a team round must come from a family that none of its authors used. Tiers inside one family (opus versus haiku) are the same family and do not count.
1. List the family of every author route (rules above).
2. Take the `review` picks and use the first whose family is absent from that list.
3. If every family in `picks` was used by an author, use the next family in the file that is not (kimi, glm, deepseek). If you still have none, mark the verdict `same-family` in the report; it is weaker evidence and you must say so.
4. The judge sees labels and artifacts only (m-review rules).
## In plain Claude Code
The `Agent` tool accepts only Claude aliases (opus, sonnet, haiku), so only the claude picks are reachable and every candidate and judge is one family. To get a different family, send the judging through `mola run --kind review` (it picks the route and writes the family brief), through DSH (`subagent` or a `workflow` `agent()` with a magpie `provider`), or through `subagent_codex`. Name the route you used in the report. If none of these is available, the run is `same-family`: say so, score anyway, and make no claim of a team gain or a verified judgement. Never invent a route id the tool will reject.
## Adapting the brief per family
Write the brief once with the five template parts (GOAL / SCOPE / CONTEXT / VERIFY / RETURN), then change only the wrapping.
- **claude** — each part in an XML tag (`<goal>`, `<scope>`, `<context>`, `<verify>`, `<return>`). Long material first, the question last. Plain "use X when…" instead of capitals and MUST. No prefilled reply. State the length you want, because Opus-class models run long. Control depth through the route's effort, not prose.
- **gpt** — markdown headings for the five parts. Say to keep going until the goal is met, except for destructive actions. Ask for short paragraphs if you do not want lists.
- **gemini** — constraints and role first, then the long context, then the task, joined by a sentence such as "Based on the material above…". One delimiter style per prompt. Ask for detail when you need it; the default is short.
- **deepseek, kimi, glm, minimax, grok** — markdown, numbered steps, explicit output shape. Kimi: role in the system message, counts of bullets or paragraphs rather than words. DeepSeek thinks by default and ignores sampling knobs, so do not rely on temperature. The last three have `unverified` rules; keep prompts short and literal.
- **group/*** — the model behind it varies. Use neutral markdown with explicit steps and an explicit RETURN shape.
Example, claude wrapping of the template:
```
<goal>Make the 3 failing tests in tests/parse.test.mjs pass.</goal>
<scope>Read: src/parse/. Write: src/parse/tokens.mjs only.</scope>
<context>Failure text is in .mstack/dispatch/fail-1.txt.</context>
<verify>node --test "tests/*.test.mjs" → 0 failures, exit 0.</verify>
<return>Changed files; the verify command and the output you saw. Under 200 words.</return>
```
The same content for a markdown family uses `## GOAL`, `## SCOPE`… headings. Do not mix both styles in one brief.
`mola run` applies these rewrites itself. In a plain session you do it by hand; skipping the adapter costs quality, not correctness, so it is a Ruling line when you skip it for speed.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 469k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |