Skip to content
Back to skills

Parallel Worktrees

ASecurity

Run several agents on one repository at once without collisions — a git worktree and branch per task, non-overlapping file claims, and landing one task at a time with tests after each merge.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 22, 2026
ai-agentsbashnodegitapi

Works with

  • api

Security analysis

A100/100

Scanned October 22, 2026

npx -y skills add gaurav8936/oneroof --skill parallel-worktrees --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Parallel Worktrees?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Parallel Worktrees
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gaurav8936-parallel-worktrees/badge)](https://www.skillsdirectory.com/skills/gaurav8936-parallel-worktrees)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: parallel-worktrees
description: Run several agents on one repository at once without collisions — a git worktree and branch per task, non-overlapping file claims, and landing one task at a time with tests after each merge.
runtime: [shared]
dependencies: [fan-out-or-not]
triggers: [worktree, parallel agents, run in parallel, roof swarm]
---

# parallel-worktrees — separate copies, separate files, one landing at a time

## By hand

```bash
git worktree add .worktrees/<task> -b work/<task>      # one per task, from your working branch
cd .worktrees/<task>                                     # the agent works and commits only here
# ...when done, from the main checkout:
git merge --no-ff work/<task> && <run the tests>         # one task at a time
git worktree remove .worktrees/<task> && git branch -d work/<task>
```

Add `.worktrees/` to `.gitignore`. Each worktree installs its own dependencies and uses its own port; never share a
`node_modules` or a dev server between them.

## With the kit: `roof swarm`

Write a spec with one entry per task, each naming the files it may change:

```json
{"repo": ".", "max_parallel": 2, "timeout_s": 900, "retries": 1,
 "tasks": [{"id": "api", "files": ["src/api"], "cmd": "codex exec 'add the /health route'", "check": "npm test"},
           {"id": "docs", "files": ["docs/health.md"], "cmd": "kimi -p 'document the /health route'"}]}
```

```bash
roof swarm run spec.json --dry-run     # validates claims, shows the plan
roof swarm run spec.json               # worktree per task, timeouts, retries; refuses overlapping claims
roof swarm merge .fanout/<run-id>      # merges green tasks one by one; stops at the first conflict
roof swarm clean .fanout/<run-id>
```

A task that edits a file outside its claim fails. One Roof shows each task's claims live, so you can see who owns
which file.

## Rules

- Claims never overlap. If two tasks need the same file, they are one task.
- Land one at a time and run the tests after each merge.
- Never push task branches; they are scratch.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.