agentleFS
ForgeyClapForgeyClap/Forge-Core/.claude/skills/forge-worktrees/SKILL.md

forge-worktrees

Skill2 starsChanged 6 days agoMITView on GitHub

Use when 2+ Bosses write one repo at once (parallel bouwen, worktree).

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    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. Very specific:

    Only isolate genuinely independent subtasks (reference dispatching-parallel-agents).

    line 20
  2. Very specific:

    Never force-push, reset --hard, or otherwise destructively touch the integration branch without explicit owner approval, even when …

    line 22
  3. Distinctive:

    After a successful merge remove the worktree.

    line 39

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Forge playbook — Safe parallel work via git worktrees

Do not duplicate ECC skills — defer to: using-git-worktrees (detect existing isolation → native tools → git worktree fallback, mechanics and commands). This file is the Forge-specific orchestration wrapper: when Forge reaches for isolation, and who owns merging the result back.

Hard rules

  • Never let two agents write concurrently to the same working tree. If Head Chef dispatches parallel Bosses on the same repo, each gets its own worktree/branch — no exceptions, per the project's parallel-vs-serial doctrine (CLAUDE.md → "Parallel vs serial").
  • Detect existing isolation before creating anything new (per using-git-worktrees Step 0) — don't nest worktrees or fight a harness that already manages workspace lifecycle.
  • Only isolate genuinely independent subtasks (reference dispatching-parallel-agents). Dependent steps stay serial in the main tree — a worktree does not make a dependency parallel-safe.
  • Never force-push, reset --hard, or otherwise destructively touch the integration branch without explicit owner approval, even when resolving a merge conflict.
  • A non-source hotspot (event registries, sync manifests, dashboard files, doctor/config) that doesn't warrant a full worktree still needs the forge-lock-guard.cjs acquire/release protocol around its dispatch (see forge-router Step 4) — lock-guard and worktree isolation are complementary safeguards, not either/or.

When to isolate

Two or more Bosses writing the same repo at once, a large/risky change that must stay reviewable as its own diff, or any Codex write-delegation. Not for single-agent sequential work or a trivial 1-2 file edit. Full text of these four sections: references/isolation-and-integration.md.

Create & integrate

One worktree per independent Boss (git worktree add <path> -b <branch>), each Boss stays inside its own; the Lead merges each branch back and resolves conflicts itself.

Lead is the integration layer

A Boss never merges its own worktree into main while other parallel work is in flight; the Lead verifies the ASSEMBLED result with a real integration check before the parallel build counts as done.

Cleanup

After a successful merge remove the worktree; never delete a worktree/branch with unmerged, uncommitted or unreviewed work without explicit owner confirmation.

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.