herdr-swarm
Run a small agent swarm (3-8 workers) through Herdr or herdr-core for large tasks that one agent cannot hold in context — goal decomposition into an ownership-split task tree, merge queue with neutral arbitration, shared decision log, field guide memory, hidden benchmarks. Use when the user wants a swarm, fan-out implementation of a big spec, multi-agent build from a spec, or says swarm/蜂群. Built strictly on top of the herdr-dispatch skill.
arronKler · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add arronKler/herdr-skills --skill herdr-swarm技能说明
name: herdr-swarm description: Run a small agent swarm (3-8 workers) through Herdr or herdr-core for large tasks that one agent cannot hold in context — goal decomposition into an ownership-split task tree, merge queue with neutral arbitration, shared decision log, field guide memory, hidden benchmarks. Use when the user wants a swarm, fan-out implementation of a big spec, multi-agent build from a spec, or says swarm/蜂群. Built strictly on top of the herdr-dispatch skill. license: MIT metadata: version: "0.3" runtime: herdr | herdr-core
Herdr Swarm
Small-scale swarm protocol, distilled from Cursor's "Agent swarms and the new model economics" (Jul 2026): scalability comes from context efficiency and coordination discipline, not raw parallelism. This skill is the orchestration layer; it never touches herdr or hc directly — all spawning, collecting, and messaging goes through the herdr-dispatch skill's verbs (doctor, assign, watch, collect, send, handoff, stop).
Preconditions
- herdr-dispatch must be installed and its
doctormust pass under whichever runtime the captain is in (herdr or herdr-core). If not, stop and tell the human. - The task must be big enough that one agent would lose context: multiple modules, a full spec, hours of work. For a single-file fix, use herdr-dispatch directly instead.
--worktreeisolation is mandatory for every implementation leaf. Read-only leaves may share the main tree.
Roles
- Captain (this session) = planner. Decomposes, decides, arbitrates merge order, reviews. The captain never implements code itself and never hand-waves a design decision into a brief — undecided design questions stop the tree until the captain decides them (or asks the human).
- Workers = executors. One leaf each. Workers do not plan, do not dispatch, and do not talk to each other. All cross-worker information flows through files the captain points at.
- Depth is at most 2 (captain → leaf). Nested captains are forbidden by herdr-dispatch; do not ask for them.
Scale limits
- 3–8 leaves total in the task tree. More means the captain becomes the bottleneck; split the goal into sequential swarms instead.
- At most 10 workers
workingat once (herdr-dispatch cap). Dispatch what fits, supervise withwatch, collect settled jobs, then dispatch the next wave.
Model mix
Follow the blog's model economics: very little of a big task truly needs frontier intelligence — the initial decomposition, the design decisions, the key trade-offs. Everything else is execution against a settled spec, which cheaper models do well:
- Planning: the strongest model available — that is this captain session.
- Implementation leaves: prefer fast, cheap kinds (see herdr-dispatch routing defaults). Once the captain has collapsed uncertainty into frozen contracts, leaf work is mechanical.
- Arbiter and reviewers: cheap kinds first; only bump up if a round fails.
All-frontier runs cost several times more for roughly the same quality; a second-rate planner that reasons efficiently can beat a pricier one by generating less work.
Protocol
1. Plan the tree
Decompose the goal recursively. Every leaf brief (see templates/leaf-brief.md) must carry:
- Ownership: the exact directories/files this leaf may create or modify. Ownership sets must be disjoint across concurrent leaves. Two leaves deciding the same thing = split brain; the fix is to move the decision to the captain, not to add a second owner.
- Contract: the interface this leaf exposes to others (function signatures, file formats, module names), frozen in the brief before any worker starts.
- Required reading: paths to
decisions.mdand.field-guide/entries relevant to this leaf.
If two leaves would need the same file, either serialize them (second leaf starts after the first merges) or split the file now, not during the merge.
2. Open the swarm state
Create once, at the repository root:
.herd-swarm/decisions.md— the shared design record. The captain appends one dated entry per decision. Workers read it; workers never write to it. If a worker needs a decision, it reports the question in its deliverable and stops short of guessing..field-guide/(repository root) — stigmergy memory, see references/field-guide.md..herd-swarm/tree.md— the current task tree: leaves, owners, status (planned/working/merged/failed)..herd-swarm/runs.md— only when there is an eval; see references/benchmarking.md.
3. Dispatch wave by wave
For each ready leaf: build the brief with the template, then use herdr-dispatch assign --worktree (async) — never handoff for implementation leaves; the captain must stay free to arbitrate. After dispatch, supervise every leaf with bounded watch calls. A prompt stall is unconfirmed delivery, not evidence that it is safe to resend. Keep the captain active until collection and integration are handled, unless a real continuation mechanism is armed or the user pauses the task.
4. Collect and merge in order
Monitor all leaves together using herdr-dispatch watch on a 30–60s cadence. Collect each ready leaf with collect --name without waiting on a slower sibling. Then process collected leaves one at a time through the merge queue — see references/merge-queue.md. Never merge two leaves concurrently, even if they own disjoint paths: the captain must see each merge result before deciding the next step.
5. Review
Default: one reviewer, a different kind from the author, via herdr-dispatch handoff, on the merged tree. For high-risk merges (core modules, many conflicts, oversized files touched), stack a second reviewer of a different kind; take the union of findings. See references/review.md.
6. Finish
Update tree.md, write the final summ