dispatch
Skill2 starsChanged 58 days agoApache-2.0View on GitHub
Orchestrate verified worker loops with `pillbox dispatch` — fork-k best-of-k diversity and/or in-session segment chains, selected by an execution-grounded reward. Use when deciding whether to delegate a task to forked workers vs work inline, how to author a segment spec, and how to read a verdict without drowning in transcripts. Libkrun-only.
26 other projects use a version of this.
Adopted by
Most recently taken up by
- mb-89/quackitecttheir own version, first seen Oct 3, 2026
- s2b-dev/smart-second-braintheir own version, first seen Sep 27, 2026
- SantiagoVqz/claude-skillstheir own version, first seen Sep 23, 2026
- ntorga/agent-starter-kittheir own version, first seen Sep 12, 2026
- renzrollon/interlocktheir own version, first seen Sep 10, 2026
- fuzzyfox/skillstheir own version, first seen Sep 10, 2026
Used with
Projects with it also use orient, spec and 5 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
moredipSkillorient
Orient yourself to this codebase by reading the README and documentation
Also in 3 projects that use this
SentrySkillspec
Produce a verified spec — problem, desired outcome, and acceptance criteria — before building. Use when given a GitHub/Linear issue link, when starting from a fuzzy in-conversation idea, or asked to "figure out what to do" / "scope this" / "what should I build" — whenever the *what* isn't yet pinned down. Grills the ambiguities, checks the premise against the code, and produces acceptance criteria you sign off on — then hands to design-first.
Also in 3 projects that use this
AWSSkillship
Finalize dev work on an issue branch — update docs, push, and open a PR.
Also in 3 projects that use this
AWSSkilltdd
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
Also in 4 projects that use this
MicrosoftSkillhandoff
Compact the current conversation into a handoff document for another agent to pick up.
Also in 4 projects that use this
SentrySkillcommit
Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.
Also in 3 projects that use this
Other versions26 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 26
- s2b-dev/smart-second-brain★ 1.3ksame name
- bassimeledath/dispatch★ 411same name
- epilande/ccmux★ 213same name
- ntorga/agent-starter-kit★ 146same name
- fagemx/edda★ 36same name
- phj128/autoworker★ 19same name
- clonable-eden/cekernel★ 17same name
- renzrollon/interlock★ 17same name
- BigY0shi/super-skills★ 4same name
- fuzzyfox/skills★ 4same name
16 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- brief-amendSkill
- brief-author-decisionSkill
- brief-backfillSkill
- brief-feature-mapSkill
- brief-reviewSkill
- ghostSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 1 is distinctive, and 4 are very specific to this project.
0
Common
Most of the 24 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 55
Default mental model: if the task decomposes, segment it.
- Very specific: line 97
Write each gate to test only what *this* segment produced (pytest -k <segment>, not the whole suite), so a checkpoint fails for the right …
- Very specific: line 114
Run with --json and read the envelope (full schema in docs/dispatch.md):
- Very specific: line 132
Read winner + per-worker score/status/segments — the trajectory stays in each worker's §0 log so your context doesn't drown in fan-out.
- Very specific: line 153
Don't session rm a loser before you've read its evidence — rm removes the record, which orphans its log from the read surface.
“Common” is measured: kept by at least 6 in 10 of the 24 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Dispatching verified worker loops
You are the interactive seat (a chat orchestrator). pillbox dispatch is your
delegation primitive: it forks detached worker sessions from a snapshot bookmark,
drives each to idle, grades each with an execution-grounded reward, retries the
ones that fail, then selects the highest-scoring worker and pulls its result
workspace. You consume the verdict (winner + per-segment outcomes), not the
transcripts. Contract: docs/dispatch.md — program against that, never invent flags.
Libkrun-only today (PILLBOX_BACKEND=libkrun). On any other backend dispatch is
not wired — do the work inline instead.
When to dispatch vs work inline
Dispatch when all hold:
- The task is verifiable — you can write a command or rubric that passes/fails it objectively (tests green, a build clean, a script exits 0, an invariant holds). A task with no machine-checkable success signal has no reward → don't dispatch it.
- The work is self-contained in a workspace you can snapshot to a bookmark.
- Either variance/luck matters (fork-k), or the task has a real sequential decomposition (segments), or both.
Work inline when the task is exploratory, conversational, needs your judgment in the loop, or has no objective grader. Dispatch is for closing a well-posed unit of work, not for thinking out loud.
The two axes (the load-bearing distinction)
Dispatch has two orthogonal levers. They are not the same thing; keep them straight.
| Axis | Flag | What it buys | Use when |
| diversity (best-of-k) | -k N + --temperature F | k independent attempts at one prompt, select the best | one horizon, but variance/luck matters — pick the lucky run |
| segmentation | --segments SPEC | drive focused, checkpoint-gated sub-prompts sequentially in ONE session | the task has a genuine sequential decomposition |
- fork-k is diversity, not decomposition.
kworkers each attempt the whole task; you keep the best. With identical deterministic workers allkscore the same and best-of-k buys nothing — so pair-kwith--temperature(e.g.0.7) to make the attempts diverge. --segmentsis the proven variance-cutter + mean-lifter (the σ̂ experiments). Context accumulates across segments; the horizon never resets. This is NOT fork-per-segment — it is one session walking a checkpoint-gated chain. If a task naturally splits into "do A, verify A, then do B, verify B," segment it.- They compose.
--segments -k NrunsNindependent segmented chains and selects the best chain by the final reward — best-of-k over decomposed work. Reach for this when a decomposed task also has run-to-run variance.
Default mental model: if the task decomposes, segment it; if it's one horizon with luck variance, fork it; if both, compose.
The Goodhart line (do not conflate gate and reward)
There are two distinct grading channels — keep them separate or the loop games itself:
- Per-segment gate (
gate_rubric/gate_cmdin the spec) — only steers progression within a chain and feeds distilled retry feedback. A failed gate does not abort the chain; it advances. The gate is a checkpoint, not the verdict. - Run-level reward (
--rubric/--cmdon the dispatch command) — the authoritative, forge-resistant selector. This picks the winner. It is required in every mode, including--segments.
Reward = session score (execution-grounded), never self-report. An agent saying
"done" is not a pass. Never let a gate substitute for the reward, and never let the
reward be a model's opinion of its own work where a real verifier exists.
Authoring a segment spec
The spec is TOML — an ordered list of [[segment]], each a focused sub-prompt and a
gate. See rubrics/example-segments.toml for the canonical copy-me example.
[[segment]]
name = "reroot"
prompt_file = "segments/01-reroot.txt" # xor: prompt = "..."
gate_rubric = "segments/01-reroot.rubric" # xor: gate_cmd = "python3 -m pytest -k reroot"
[[segment]]
name = "pathfind"
prompt = "Implement Tree.path_to(from, to) so it returns the node list."
gate_cmd = "python3 -m pytest -k path"Rules (from the contract):
- Each segment needs
promptxorprompt_file, andgate_rubricxorgate_cmd. Unknown keys are a parse error. - Relative paths resolve against the spec file's directory — keep prompt/rubric files next to the spec.
- Gates are self-contained — they run against the worker's live workspace as-is.
Write each gate to test only what this segment produced (
pytest -k <segment>, not the whole suite), so a checkpoint fails for the right reason. - Segments are ordered and cumulative — segment N may rely on N-1's output. Order them so each gate is checkable the moment that segment finishes.
Sensible defaults
-k 3for short horizons (k=3–5 saturates; diversity gains flatten beyond).-k 1(the default) = pure segmentation with no diversity.--retries 1(the default) — one distilled retry per failing gate. Raise only for flaky/hard checkpoints; it costs a full re-drive each.--temperature 0.7whenever-k > 1— without it the forks are degenerate.- Reward is always required — give exactly one of
--cmd/--rubric(a missing or doubled grader is a usage error, exit 2).
Consume the verdict, not the transcripts
Run with --json and read the envelope (full schema in docs/dispatch.md):
pillbox dispatch --from-bookmark base --segments spec.toml -k 3 --temperature 0.7 \
--rubric rubrics/rust-change.rubric --agent opencode --json \
-- "Refactor the parser into staged passes."{ "version": 1, "dispatch": {
"winner": "abc123…", // selected worker, or null if none passed
"workers": [ { "session": "abc123…", "score": 1.0, "passed": true,
"retries_used": 1, "status": "scored",
"segments": [ {"name":"reroot","passed":true,"score":1.0} ] } ],
"pulled_to": "/path/to/session-abc123…", // winner workspace; check this, not just exit code
"selection_rationale": "only passing worker (score 1.00)" } }- Read winner + per-worker
score/status/segments— the trajectory stays in each worker's §0 log so your context doesn't drown in fan-out. - Check
pulled_to, not just the exit code: exit0reports the winner even if its pull failed (thenpulled_tois null; recover withpillbox session pull). - Exit codes:
0= a winner was selected and pulled;1= no winner (read per-workerstatusto tell all-failedfrom all-errored);2= usage error. - Need why a worker passed/failed? Each worker writes a
dispatch.worker_summary§0 artifact on its own log:pillbox session log <worker-id> --type artifact→pillbox session artifact get <worker-id> --ref <blobRef>.
Cleanup (workers are left running)
dispatch does not auto-kill workers — the winner and every loser stay live so their §0 evidence stays readable. Reap them yourself:
- One-off: inspect losers, then
pillbox session rm <id>each when done. - Campaign: pass
--ttl 24h(30m/24h/7d) so every worker gets anexpires_at, thenpillbox session prune(cron/orchestrator) reaps the expired ones — evidence-safe until prune.
Don't session rm a loser before you've read its evidence — rm removes the record,
which orphans its log from the read surface.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

