agentleFS
jollyroger1480jollyroger1480/claude-code-worker-harness/skills/parallelize/SKILL.md

parallelize

Skill1 starsChanged 11 days agoMITView on GitHub

When work splits into independent, substantial subtasks (research N topics, analyze N files, test N scenarios), consider parallel agents instead of doing them one after another in the main context. Pick the pattern by dependency shape: fan-out, pipeline, or map-reduce. Claude sub-agents go through the model-router workers (quick-worker, routine-worker, opus-worker, architect). Small or quick work stays inline.

2 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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    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:

    Use for: research multiple topics, analyze multiple files, N independent checks.

    line 31
  2. Distinctive:

    NO barrier between stages.

    line 35
  3. Distinctive:

    Use for: design, implement, test per feature.

    line 36
  4. Distinctive:

    Use for: codebase-wide analysis then summary, dedup across all findings, count or rank.

    line 41
  5. Distinctive:

    Default to pipeline unless the reduce step genuinely needs all results at once.

    line 43
  6. Distinctive:

    Do N independent, substantial subtasks sequentially in the main context when they can fan out.

    line 59
  7. Distinctive:

    Use a map-reduce barrier when a pipeline (no barrier) would finish faster.

    line 61
  8. Distinctive:

    Keep only conclusions in the main context.

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “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

Parallelize

<purpose> Doing independent subtasks one at a time in the main context burns tokens and wall-clock time, and fills the main window with intermediate results. Offload to parallel agents; keep only the conclusions. The only real difference between "fan out", "map-reduce" and "pipeline" is the dependency shape, captured below. </purpose>

When To Activate

  • A task has more than 3 independent subtasks (research, file analysis, test scenarios).
  • A batch job has more than 30 items OR will run longer than 15 seconds.
  • Any "do X to everything, then summarize" shape.

Pick the pattern by dependency shape

Fan-out (subtasks fully independent, you want all results): Spawn one agent per subtask, run concurrently, aggregate. Barrier at the end. Use for: research multiple topics, analyze multiple files, N independent checks.

Pipeline (each item flows through ordered stages, items independent of each other): Each item goes stage1, stage2, and so on; item A can be in stage 3 while item B is in stage 1. NO barrier between stages. Wall-clock = slowest single chain, not sum of stages. Use for: design, implement, test per feature; find, verify per finding.

Map-reduce (process all, THEN combine; the combine needs the full set): Map: process each item independently (parallel). Reduce: aggregate all results. The barrier between map and reduce is REQUIRED (reduce needs everything). Use for: codebase-wide analysis then summary, dedup across all findings, count or rank.

Default to pipeline unless the reduce step genuinely needs all results at once.

Where to run it: model-router workers

A Claude sub-agent spawn is routed by the model-router PreToolUse hook (guard_agent_model.py, table in routing.json). Name the worker that fits:

  • quick-worker (cheapest tier): status, grep, where-is lookups.
  • routine-worker (mid tier): read a document or log and report what it says.
  • opus-worker (top coding tier): a file has to change or code has to be written.
  • architect (top reasoning tier): system design, an architecture decision, a plan review.
  • Code or security review: not a sub-agent. Run ocr review --audience agent.
  • Odd chores (a blurb, a rename list, a one-file summary): skill lowtier, which either does it inline or hands it to the optional cheap lane (bin/grok-leaf).

NEVER

  • Do N independent, substantial subtasks sequentially in the main context when they can fan out.
  • Spawn an agent for a handful of tool calls or a lookup whose target you already know.
  • Use a map-reduce barrier when a pipeline (no barrier) would finish faster.

ALWAYS

  • Name the dependency shape first, then pick fan-out, pipeline or map-reduce.
  • Keep only conclusions in the main context; let agents hold the intermediate data.
  • Probe ONE item end to end before fanning out a batch (see [[probe-before-batch]]).
  • Fan out only when the work is truly independent and worth the cost. When in doubt, do it inline.

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.

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.