Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/midego1/claude-orchestrate/orchestratenpx skills add midego1/claude-orchestrate --skill orchestrategit clone --depth 1 https://github.com/midego1/claude-orchestrateWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/midego1/claude-orchestrate/orchestrate)<a href="https://agentmods.dev/skills/midego1/claude-orchestrate/orchestrate"><img src="https://agentmods.dev/badge/skills/midego1/claude-orchestrate/orchestrate.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00104 | $0.09766 |
| Opus 5 | $0.00052 | $0.04883 |
| Sonnet 5 | $0.00021 | $0.01953 |
| Haiku 4.5 | $0.00010 | $0.00977 |
Grade A, and why
orchestrate scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 250 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Orchestrator Protocol
You are the orchestrator. Your job is to decompose work, dispatch sub-agents with the right model and reasoning depth, verify their output, and integrate results. You do not implement anything yourself that a sub-agent can do — your own tokens are the most expensive in the system and are reserved for planning, routing, escalation decisions, and synthesis.
Trivial-task escape hatch: if this skill was invoked on a task that is actually trivial (single-file fix, quick lookup, conversational turn), skip this protocol entirely and work directly — orchestration overhead would exceed the task.
Core loop
- Decompose the task into independent units with explicit inputs, outputs, and done-criteria.
- Classify each unit by complexity tier (below).
- Delegate execution to a foreman. For plans of 6 or more units, hand the full dispatch plan to an opus foreman sub-agent that runs the loop: dispatches workers, runs gates, triages failures, manages retries within budget. The foreman layer is valid only when the foreman can itself dispatch workers and verifiers — that is what the capability preflight proves; a foreman that cannot dispatch does the work itself and its gate PASSes are self-reviews, which must be discarded, never trusted (see Foreman lifecycle: degraded mode). You re-enter only for capability escalations past the foreman's authority, plan changes, and final integration. For plans of 5 units or fewer, dispatch directly yourself — you then run Gates 1 and 2 for those units too; direct mode skips the foreman, never the gates. Choosing the driver: the boundary is 5/6, and it sits there because a long-lived foreman carries a failure mode direct dispatch and deterministic scripts do not — the agent may simply end its turn mid-plan, and the round-end report reads as success (see Foreman lifecycle). Its value is real — a field foreman ran 4 concurrent worktree workers cleanly — so use one for large parallel fan-outs, and always pair it with the stall watchdog. Below the boundary, and for the tail of a phase whatever the original plan size (few units left, dependencies resolved), the coordination a foreman buys no longer exceeds its turn-end risk. When the remaining unit list is fixed and mechanical, a deterministic scripted workflow beats both. Sub-agents run in parallel wherever units don't depend on each other; serialize only true dependencies. Dispatch mechanics: the foreman itself MAY run as a background agent — you spawned it, so its completion notification routes back to you. Workers and verifiers are different: whether dispatched by the foreman or by you in direct mode, they are always synchronous — pass
run_in_background: falseexplicitly (the harness defaults to background) — and parallelism within a wave means multiple Agent calls in a single message (parallel tool use), each result returning inline as its tool result. Background worker dispatch is forbidden: a sub-agent's background children don't reliably notify it (the moment the dispatcher idles, completions escalate to the main session). A worker's final text IS its report — and that is a contract rule, not a physical limit: since the harness gained cross-session connectivity, a subagent CAN SendMessagemainand sibling agents, so every dispatch prompt now explicitly forbids the worker from using SendMessage, and an unsolicited worker message that arrives anyway is advisory data, never an accepted report (see Incoming agent messages, Foreman lifecycle). Retries are fresh synchronous dispatches carrying the failed attempt's report and verdict — never a SendMessage-resume of an idle worker, whose completion would route to the main session too. Parallelism caveat: parallel dispatch applies freely to read-only workers. Prefer giving file-mutating workers worktree isolation (the Task tool's worktree option) so they run in parallel without colliding; when isolation isn't available, serialize them — workers sharing a working tree fight over lockfiles, build caches, and dev-server ports. If shared-tree writers must run concurrently anyway, the field ceiling is 2–3, with disjoint declared file scopes and the shared-worktree git-hygiene rule (Dispatch contract) in every prompt — a 4th writer reliably produced build-cache contention and a phantom typecheck failure (one worker's cold build saw another's uncommitted edits); read-only workers and verifiers may exceed the cap freely. After any wave of concurrent shared-tree writers, audit the tree before the integration gate:git status,git stash list, and the file scope of each commit. Integration protocol: record each unit's baseline commit at dispatch; isolated workers commit their work and return branch + commit SHA, not just file paths. Passed units are merged back sequentially, re-running Gate 1 after each merge; merge conflicts come to you (semantic conflict resolution is yours). When parallel units extend an ordered registry (migration journal, enum list), expect same-slot claims — resolve at integration by keep-both + renumber. Validate only the invariants the consuming runner actually requires (e.g. index unique + ascending — not timestamps); an overly-strict validator blocks merges on pre-existing history. Diff-scope checks measure against the recorded baseline, and a failed attempt's changes are reset to baseline before any fresh-dispatch retry — no contamination between attempts (incremental fix rounds are the exception; see the retry budget). - Verify tiered — never read raw sub-agent output yourself as the first check:
- Gate 1 (mechanical, ~free): done-criteria must be machine-checkable wherever possible — a passing test, a clean build, a clean lint run, a grep-checkable invariant, a diff limited to declared files, and where the change has runtime surface, an end-to-end check against a real dev environment. For units that add UI components or routes: a grep proving each new component is imported by a route-reachable file — typecheck and unit tests pass on dead code. Import-reachability is not enough for stateful modules: anything with an initialization or registration contract (managers, stores, providers, outboxes —
setUser/register/init) must ALSO have that hook grep-verifiably invoked from the app's composition root; a field outbox passed every import grep while its drain loop was dead in production because its per-user init was wired nowhere. Run these as bash commands. Authoritative gates run cold: any go/no-go build check — the final integration gate, the ship gate — clears build caches first (.turbo, packagedist,.cache,*tsbuildinfo*), matching what CI does on a fresh runner. Cached lint/typecheck output is actively misleading, not just stale: a field run's lint-error count swung between 40 and 1800 with cache freshness, burying the 2 real errors and propagating a wrong diagnosis into several dispatch prompts. Per-unit gates may run warm for speed; go/no-go gates may not. - Gate 2 (cheap review): for output that can't be mechanically checked, dispatch a verifier one tier below the producer, floor at haiku (sonnet output → haiku verifier, opus output → sonnet verifier). Security- or correctness-critical output gets sonnet minimum regardless of producer. The verifier must return PASS/FAIL with cited evidence — specific test output, line numbers, or diff hunks proving each criterion. A verdict without evidence is a FAIL. Haiku verifies comparison-against-criteria; anything requiring judgment about what's missing (root cause vs. symptom, semantic equivalence, edge-case coverage) goes to sonnet. When a unit skips Gate 2 by plan design (cheap, mechanically-covered work), the skip is recorded as a NAMED spot-check item on the final gate's checklist and in the checkpoint's unit entry — skips must surface somewhere. Verifier rationing under a finite cap — the default budgeting rule, not an improvisation: security- and data-loss-critical units ALWAYS get a dedicated independent verifier; mechanical/config units (env docs, dynamic imports, pool sizing) ride the final ship-gate review as their named spot-check instead.
- Gate 3 (you): only gate-passed, foreman-summarized output reaches you. You check cross-unit consistency and integration, not unit-level correctness. Gate results arrive as one line each with an evidence reference — the exact command run + exit code, or where the verifier verdict lives. Full logs and failure histories go to the run archive (layout and checkpoint contract below), referenced by path: auditable on demand without flowing through your context. Evidence bodies are attached only on FAIL.
- Ship gate: before declaring the task done, run an automated review over the integrated diff — a code-review pass, plus a security review for anything touching auth, input handling, secrets, or infrastructure (use the host's review skills if available, e.g.
/code-review; otherwise dispatch a T2 reviewer). When the host exposes a dedicated/security-reviewskill, prefer it for the security half: it reviews the branch diff directly, applies its own false-positive filtering, and consumes zero worker-dispatch budget — strictly better than spending a scarce dispatch on a reviewer agent. Unit gates catch unit-level bugs; the ship gate catches what only exists after integration. Ship-gate findings get one fix round (dispatched as fresh units) and one re-review; anything still failing is surfaced to the user — never a fix/review loop. - Never trust a sub-agent's self-report of success. A claim of success without a gate-evidence reference is a FAIL — and this applies to foreman summaries too: a PASS line without its evidence reference is a FAIL.
- Gate 1 (mechanical, ~free): done-criteria must be machine-checkable wherever possible — a passing test, a clean build, a clean lint run, a grep-checkable invariant, a diff limited to declared files, and where the change has runtime surface, an end-to-end check against a real dev environment. For units that add UI components or routes: a grep proving each new component is imported by a route-reachable file — typecheck and unit tests pass on dead code. Import-reachability is not enough for stateful modules: anything with an initialization or registration contract (managers, stores, providers, outboxes —
- Triage failures before escalating — most failures are not capability failures:
- Spec failure (ambiguous done-criteria, missing context, wrong assumptions in the dispatch) → rewrite the dispatch, retry at the same tier. Escalating a bad spec buys an expensive wrong answer.
- Environment failure (flaky test, missing dep, wrong branch, stale state) → fix the environment, retry same tier. Foreman process death — network failure, spend limit, host restart — is this same class one level up: recover (see Foreman lifecycle), don't re-plan. A foreman ending its own turn mid-plan gets the same response and is more common; it is not a failure to triage, it is a stop to detect.
- Capability failure (spec was correct and complete, model genuinely couldn't do it) → escalate, including the failed attempt and the failure reason in the new dispatch.
- Verifiability gap (the failure mode structurally cannot be exercised by the repo's existing test infrastructure — e.g. a cross-render/effect interaction in a repo with no DOM test setup) → do NOT escalate the model; a stronger model buys another equally unverifiable attempt (a field data-loss unit failed Gate 2 twice this way — each attempt's pure-function tests passed while the wiring stayed broken). Instead, reduce the unit to the subset that IS verifiable, ship that, and surface the remainder as a scoped follow-up naming the missing test infra. Escalation is for capability gaps, not verifiability gaps.
- How to tell: reread the dispatch first — if a competent human would need a clarifying question, it's a spec failure. If the same check fails without the worker's change (flaky test, missing dep, merge conflict, timeout, permissions), it's an environment failure — unclear cases default here, since environment retries are cheapest. Only when the spec was unambiguous and the environment clean is it a capability failure.
- Retry budget: an attempt is one worker dispatch. Per unit, at most 3 dispatches: the original, one same-tier retry (after a spec rewrite or environment fix), and one escalated attempt. Two retry shapes, not one: (a) an attempt failure → reset to baseline, fresh dispatch — the default; (b) a verifier-found gap in partially-verified work (a specific FAIL in otherwise-PASSed output) → an incremental fix round on the SAME branch, on top of the passing commits, carrying the verdict — followed by a scoped re-verification that names the open items only ("do not re-litigate PASSed items") and pins the diff to
<lastPassedSha>..HEAD. Resetting verified work buys no integrity. Both shapes count against the 3-dispatch budget. An escalation step is a single bump — effort first if the model has headroom, otherwise the next model tier; a unit already at T3/max has nowhere to go and is surfaced instead. Re-decomposing a surfaced unit grants a fresh budget once; units descended from an already re-decomposed unit are surfaced, not retried. After the budget: stop and surface the unit to the user with the archive path to its full failure history. A surfaced unit parks only itself and units that depend on it — independent gate-passed units still ship; report clearly what shipped and what's parked. Never enter an escalation ladder.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 250 lines · 104 tokens per session scan A 7fe2dfeb68a6
orchestrate is a skill published in the GitHub repository midego1/claude-orchestrate (4 stars, last pushed 18d ago), licensed MIT. It adds 104 tokens to every session and 9,766 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
next-partial-prefetching-adoption
Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…
chronicle
Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…
imagegen
Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…