agentleFS
atgreenatgreen/hackinator/skills/dispatching-subagents/SKILL.md

dispatching-subagents

Skill1 starsChanged 3 months agoMITView on GitHub

Chooses whether and how widely to parallelize permitted work. Use for fan-out search, independent build/spike/review tasks, adversarial verification, or host-budget decisions. Not for isolating writers after parallelism is chosen — that's using-worktrees

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Only after the host permits subagents:

    line 26
  2. Distinctive:

    Pipeline over barrier: Don't make fast agents idle waiting for the slowest before *any* result moves on.

    line 63
  3. Distinctive:

    Read-only fan-out is safe.

    line 84
  4. Distinctive:

    Delegating a dependent step, then blocking on it: No parallelism gained — just dispatch overhead.

    line 97

“Common” is measured: kept by at least 6 in 10 of the 4 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Dispatching Subagents

Overview

Core principle: Delegate to go faster and to keep your own context clean — but treat the host as a budget, not an infinite pool. The goal is lower wall-clock, not maximum concurrency. Ten agents that make the machine swap are slower than three that don't.

First check the authority and capability boundary. This skill never grants permission to spawn an agent. If the host or active instructions forbid subagents, use batched read-only tool calls where available or execute the same dependency order serially.

Two wins from delegating, and they're different:

  • Parallelism — independent work runs at once, so wall-clock ≈ the slowest chain, not the sum.
  • Context hygiene — a subagent reads the haystack and hands you the needle; the file dumps never enter your context. Reach for this even when you don't need speed.

Reach for a Subagent When

Only after the host permits subagents:

  • Fan-out search / exploration — "where is X handled", sweeping many files or naming conventions. Delegate; keep the conclusion, not the excerpts.
  • Independent tasks — spikes of two rival approaches, reviewing N files, building M targets — anything with no ordering dependency between the pieces.
  • Adversarial verification — spawn independent skeptics to try to refute a claim (behavior unchanged? bug real?). Diverse lenses catch what one pass misses.
  • Anything that would flood your context with output you won't keep.

Don't When

  • Steps depend on each other — B needs A's output. Delegating then blocking on it buys nothing but overhead.
  • It's one known lookup — you know the file and symbol. Just read it.
  • The work is smaller than the dispatch cost — spawning an agent to save five seconds loses.

Free Parallelism First

Independent tool calls in a single message run concurrently — no subagent needed. Before spawning anything, batch the handful of independent reads/greps into one message. Use subagents when you need context isolation or genuine fan-out beyond a few calls.

The Host Budget

Classify every unit of work before deciding how wide to go:

ClassExamplesHow wide
Cheap / read-onlyRead, Grep, Glob, search agents, analysisFan out — but cap ~5–8. More adds coordination churn, not speed.
Heavy / computebuild, compile, full test suite, install, render, containers, DBSerialize, or cap to ≤ (cores − 2). Never run N full builds at once.

Heuristic: heavy jobs concurrent ≤ nproc − 2; cheap agents a flat ~5–8. When mixing, the heavy class sets the limit — a single build can saturate the machine on its own.

Before a Permitted Wide Fan-Out

  1. Scout first. Send one agent (or one check) to confirm the approach before launching twelve down the same dead end. Cheap insurance against expensive mistakes.
  2. Know the machine. nproc for cores; check current load. On a busy laptop, dial it down — your fan-out shares the host with the user's editor, browser, and running app.
  3. Pipeline over barrier. Don't make fast agents idle waiting for the slowest before any result moves on. Let each result flow to its next stage as it lands; wall-clock drops and fewer agents sit live at once.
  4. Chunk huge lists. 200 files is not 200 agents (a thundering herd). Batch into a handful of agents each handling a slice.

Craft Each Agent's Task

A subagent starts blank — it does not inherit your context, so hand it exactly what it needs and nothing it doesn't:

  • Focused scope. One domain per agent ("fix the abort tests in X"), not "fix everything." Broad scope loses the agent.
  • Self-contained. Paste the error text, the file path, the relevant facts. Don't assume it saw your session.
  • Constraints. Say what not to touch — "tests only", "don't refactor production code" — or it may reshape the world.
  • Named output. Tell it what to return (a summary, a verdict, the patch). Its final text is the result you get back — vague ask, vague result.

Dispatch all independent tasks in one message so they run at once. When they return: read each summary, check the changes don't conflict, and run the full suite once to confirm they compose.

Parallel Edits Need Isolation

Read-only fan-out is safe. Concurrent edits are not — two agents writing the same tree race and corrupt each other. If permitted parallel tasks mutate files, use host-provided isolation, separate worktrees, or a partition proven not to overlap. If isolation is unavailable or forbidden, parallelize the reading/analysis and serialize the writing.

→ CONDITIONAL SUB-SKILL: Use using-worktrees when permitted concurrent writers actually need isolation. Do not load it for read-only fan-out or a serial fallback.

Common Mistakes

  • One agent per item for hundreds of items. Thundering herd. Chunk it.
  • 8 parallel test suites on a 4-core laptop. Swap death; slower than running them in twos.
  • Fanning out before the approach is proven. Scout with one, then widen.
  • Delegating a dependent step, then blocking on it. No parallelism gained — just dispatch overhead.
  • Maximizing agent count. Wall-clock is set by the slowest chain and the host's limits, not by how many agents you launched.
  • Treating this skill as spawn authority. Host and active instructions decide whether subagents exist and may be used; this skill only decides whether they would help.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

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.