agentsclimarketplace

Worktree isolation

Skill 0SxD/openrouter-swarm-orch-agent/agentic_auto_buildX_ai_bundle_repos/sagex_plugin_v0.1_example_copy/skills/worktree-isolation

Install
npx -y skills add 0SxD/openrouter-swarm-orch-agent --skill worktree-isolation

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Create and manage git worktrees for parallel coding agent isolation. Invoke when two independent coding tasks need to run simultaneously (max 2).

SKILL.md

3.1 KB, 755 tokens by cl100k_base, as published. Nobody here has run it

Worktree Isolation Pattern

When to Use

  • Two independent coding tasks can run in parallel (no shared files)
  • Each task is self-contained (different feature branches)
  • Max 2 worktrees active at any time (= max 2 concurrent agents)

Step 1 — Create Worktree

Use the EnterWorktree tool or bash equivalent:

git worktree add _worktrees/{task-id} -b feature/{task-id}-{short-description}

Each worktree gets its own:

  • Working directory: _worktrees/{task-id}/
  • Feature branch: feature/{task-id}-{short-description}
  • Complete copy of the codebase (shares .git objects, not files)

Step 2 — Dispatch Agent to Worktree

In Agent tool call, direct the agent to work within the worktree path:

  • Agent reads/writes ONLY within _worktrees/{task-id}/
  • Agent has NO access to main working tree files
  • Agent has NO knowledge of what the other worktree agent is doing

Step 3 — Stage 1 Audit (before merge)

Each worktree's output goes through the full 5-gate audit pipeline:

  1. Semgrep (plugin)
  2. CodeRabbit (plugin)
  3. Code-review + pr-review-toolkit (plugins)
  4. Security-guidance (plugin)
  5. Clone repo comparison (_repos/)

ALL gates must PASS before merge is allowed.

Step 4 — Merge Back

After Stage 1 PASS + Austin approval:

# Return to main working tree
git checkout main

# Merge the feature branch (no fast-forward for audit trail)
git merge feature/{task-id}-{short-description} --no-ff

# Clean up
git worktree remove _worktrees/{task-id}
git branch -d feature/{task-id}-{short-description}

Step 5 — Stage 2 (GitHub PR Airlock)

After merge to local main:

  1. Push branch → open PR (Austin approval required)
  2. GitHub Actions: remote semgrep + CodeRabbit
  3. Austin reviews → merges

Rules

  • NEVER share files between worktrees
  • NEVER run more than 2 worktrees simultaneously
  • ALWAYS delete worktree after merge (no stale worktrees)
  • ALWAYS run full audit before merge
  • Worktree directory: _worktrees/ (gitignored)

Multi-Agent Worktree Usage

All coding agents use worktrees — not just Claude sub-agents:

AgentWorktree?Branch patternNotes
Claude (Opus)NO — stays on mainn/aOrchestrator. Never leaves main working tree.
Claude (Sonnet)YESfeature/{task-id}-claude-{desc}Dispatched by Opus
Gemini (AntiGravity)YESfeature/{task-id}-gemini-{desc}Works in IDE on its own worktree
CodexYESfeature/{task-id}-codex-{desc}Works in IDE on its own worktree
  • Opus NEVER works in a worktree — it stays on main to orchestrate and review
  • Each coding agent gets its own worktree and feature branch
  • No two agents share a worktree
  • All worktree output goes through Claude's 5-gate audit pipeline before merge

Emergency Cleanup

git worktree list              # see all active worktrees
git worktree remove --force _worktrees/{task-id}  # force remove
git worktree prune             # clean up stale entries

Gives 0 of the 12 instructions most agent orchestration skills give in 755 tokens

Counted across 742 of the 995 authors here whose files we hold, read 2026-08-06

  • run the full test suite after integrating changesin 53 of 742, across 20 files
  • reference existing artifacts by path or URLin 52 of 742, across 22 files
  • dispatch one agent per independent problem domainin 50 of 742, across 17 files
  • verify fixes do not conflictin 45 of 742, across 13 files
  • include a suggested skills section in the documentin 45 of 742, across 15 files
  • redact sensitive informationin 41 of 742, across 11 files
  • save to the temporary directory of the operating systemin 39 of 742, across 9 files
  • tailor the document to user-provided focus argumentsin 39 of 742, across 9 files
  • spot check agent changes for systematic errorsin 34 of 742, across 7 files
  • write a handoff document summarising the current conversationin 31 of 742, across 6 files
  • assign each agent a specific scopein 23 of 742, across 8 files
  • provide specific scope and clear goalin 23 of 742, across 5 files

Said here and by no other author read

  • restrict each agent to its own worktree directory
  • pass all five audit gates before merging
  • merge the feature branch into main locally
  • keep the orchestrator agent on the main branch

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.