agentleFS
BK202503BK202503/open-claude-all/skills/parallel-dev/SKILL.md

parallel-dev

Skill7 starsChanged 4 months agoMITView on GitHub

When the user asks for MULTIPLE INDEPENDENT development features/tasks in one turn ("build A, B, C in parallel", "spin up three features at once"), fan out to N general-purpose subagents, each in its own git worktree with strictly non-overlapping file scopes, then review and merge sequentially. Distinct from parallel-dispatch (which handles read-only status/lookup fan-out). Use this when the units require WRITES (code changes, migrations, new files).

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

9 rules. 0 are common, 8 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Do NOT trigger when:

    line 22
  2. Distinctive:

    Only ONE unit — no parallelism needed.

    line 26
  3. Distinctive:

    This is the critical step: Before spawning, list every directory each unit will touch.

    line 39
  4. Distinctive:

    Do not sit idle if the user stacked unrelated one-liners in the same turn.

    line 81
  5. Distinctive:

    Read the diff — reject scope creep, unrequested refactors, dead code.

    line 88
  6. Very specific:

    If OK: git checkout main && git merge --no-ff <branch> back in the main repo.

    line 89
  7. Distinctive:

    If conflict: resolve manually — do not delegate this to another agent.

    line 90
  8. Distinctive:

    Never merge without reading the diff.

    line 93
  9. Distinctive:

    Run the project's full verify command (typecheck, tests, build) on main post-merge.

    line 97

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

parallel-dev — multi-feature fan-out with worktree isolation

The default failure mode is (a) implementing multi-feature requests sequentially, or (b) fanning out without isolation and eating merge conflicts. This skill enforces:

  • one worktree per feature
  • non-overlapping file scopes stated in the prompt
  • one assistant response emits all agents in parallel
  • parent reviews + merges each branch back into main sequentially after all complete

When to trigger

Trigger when the user's turn contains ≥ 2 independent development units. Examples:

  • "build A, B, C in parallel with 3 agents"
  • "spin up all three of these features at once"

Do NOT trigger when:

  • The task is read-only or lookup-heavy → use parallel-dispatch instead.
  • The units share a file that would cause obvious merge conflicts.
  • Any unit depends on another's output.
  • Only ONE unit — no parallelism needed.

Phase 1 — Enumerate units

Split the request into concrete, independently-shippable features. If the user gave a number, match it. If not, pick the natural split — usually 2–4.

For each unit write a one-line spec:

  • Unit name
  • Primary directories it will touch
  • Any schema / config file changes (yes/no)

Phase 2 — Partition scope

This is the critical step. Before spawning, list every directory each unit will touch. If two units both need to write to the SAME file, either:

  • Give ownership to one unit and route the other around it, OR
  • Serialize the two (spawn one, wait, spawn the next), OR
  • Refuse parallelism for the pair and tell the user.

Common conflict zones (project-dependent):

  • Shared router / dispatcher files (a switch-statement often shared across features).
  • DB schema — at most ONE unit touches per fan-out.
  • Shared protocol / API contract — ask each unit to add its own file and export.
  • CI config — one unit per fan-out.

Phase 3 — Brief each unit

Each subagent prompt MUST include:

  1. Project rules — copy the strict rules from CLAUDE.md.
  2. Current state — verified facts about what exists in the codebase for this unit. Include file paths and function names the agent can grep. Don't let the agent rediscover this.
  3. Scope — numbered list of what to build.
  4. Do NOT — explicit list of other units' file territory, naming the other units.
  5. Verification — the exact commands to run (typecheck, tests, build).
  6. Deliverable — commit locally, report worktree path + branch + commit SHA + short summary, cap at 300 words.

Prompt length: 400–800 words per agent. Terse prompts produce shallow work.

Phase 4 — Spawn — ONE assistant response

Emit every Agent call in the same response. Every agent MUST use isolation: "worktree" and run_in_background: true. Use subagent_type: "general-purpose" for coding.

Agent(subagent_type="general-purpose",
      description="...",
      isolation="worktree",
      run_in_background=true,
      prompt=<self-contained brief per Phase 3>)

Never spawn parallel dev agents without isolation: "worktree". They will collide on the same working tree.

Concurrency cap: 4 dev agents. Beyond 4, sequential merge review becomes the bottleneck. If more asked, do 4 first, queue the rest.

Phase 5 — While agents run

Do not sit idle if the user stacked unrelated one-liners in the same turn. Do NOT poll agents — you get completion notifications.

Phase 6 — Review + merge (sequential)

For each returned worktree, in the order the user prioritised (or in the order they finished):

  1. cd <worktree> and git log <base>..HEAD — see what the agent committed.
  2. Read the diff — reject scope creep, unrequested refactors, dead code.
  3. If OK: git checkout main && git merge --no-ff <branch> back in the main repo.
  4. If conflict: resolve manually — do not delegate this to another agent.
  5. Remove worktree: git worktree remove <path>.

Never merge without reading the diff.

Phase 7 — Final verification

Run the project's full verify command (typecheck, tests, build) on main post-merge. If red, bisect: which agent's merge introduced it, revert, re-brief that agent.

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.