smithery.ai

agent-worktrees

Git worktree based parallel agent workflow for running Codex CLI, Claude Code, OpenCode, and other coding agents concurrently without file conflicts.

First seen Apr 18, 2026

Installation

$ npx skills add https://smithery.ai

Summary

  • Git worktree based parallel agent workflow for running Codex CLI, Claude Code, OpenCode, and other coding agents concurrently without file conflicts.
  • Use when you need to (1) create/manage named worktrees (integrate/ui/brain[/docs]), (2) route a task to the correct worktree based on the files it will touch, (3) launch a tool in the chosen worktree, or (4) coordinate multiple agents via an integrator merge and review loop.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Declared
Cursor Not declared
Codex Declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Declared

Skill metadata

Parsed from SKILL.md frontmatter.

Declared agents claude-code codex opencode

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,655 B
  • docs SUMMARY.md 448 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Agent Worktrees

Quick Start

This repo uses named git worktrees as the main concurrency primitive: one writer per worktree/role, plus an integrator that merges and runs checks.

Create the standard worktrees (default root C:\pt-study-sop-worktrees):

cd C:\pt-study-sop
.\scripts\agent_worktrees.ps1 ensure

List the mapping:

.\scripts\agent_worktrees.ps1 list

Open a tool in a specific worktree (new PowerShell window):

.\scripts\agent_worktrees.ps1 open -Role ui -Tool claude
.\scripts\agent_worktrees.ps1 open -Role brain -Tool codex -ToolArgs "--search"
.\scripts\agent_worktrees.ps1 open -Role integrate -Tool opencode

Route a task by file paths, or dispatch automatically:

.\scripts\agent_worktrees.ps1 route -Paths dashboard_rebuild\\client\\src\\pages\\tutor.tsx
.\scripts\agent_worktrees.ps1 dispatch -Paths brain\\db_setup.py -Tool codex

Roles (Default Map)

Roles are meant to be obvious, not clever:

  • integrate (wt/integrate): merges, conflict resolution, running checks, and any cross-cutting change touching multiple areas.
  • ui (wt/ui): frontend work in dashboard_rebuild/.
  • brain (wt/brain): backend work in brain/ (Flask/API/db).
  • docs (wt/docs, optional): docs + meta-work in docs/, conductor/, scripts/, tests.

ASCII overview:

wt/ui      (Claude or Codex)  -> commits on wt/ui
wt/brain   (Codex)            -> commits on wt/brain
wt/integrate (you)            -> merges + runs checks -> main

Routing Rules (Which Role Gets the Task?)

Route by files touched, not by vibes:

  • If the change is entirely under dashboard_rebuild/ -> ui
  • If the change is entirely under brain/ -> brain
  • If it touches both (or involves build/sync, final QA, or conflicts) -> integrate
  • If it's docs-only and you created docs -> docs (otherwise integrate)

When in doubt, send it to integrate.

Collaboration Protocol (How They Work Together)

  1. Assign ownership: exactly one writer per role/worktree.
  2. Each worker commits on their role branch (wt/ui, wt/brain, etc.).
  3. Integrator merges to main and runs the repo's required checks.
  4. Review loop: use another tool to review what the integrator is about to merge (Codex review, Claude review, etc.).

Practical merge flow (run from wt/integrate):

cd C:\pt-study-sop-worktrees\integrate
git fetch
git merge wt/ui
git merge wt/brain
pytest brain/tests/   # when relevant

Can Each Tool Spawn Subagents?

Yes, but keep the concurrency model simple:

  • "Parallel agents" should usually mean multiple top-level sessions, one per worktree.
  • If a tool supports subagents/teams, use them for read-only work (repo scanning, research, test suggestions) or for work that stays inside the same worktree and does not fight over files.
  • Avoid recursive swarms where every agent spawns more agents that all write code; merge overhead dominates.

Repo Helpers

  • Create/manage named worktrees: scripts/agent_worktrees.ps1
  • One-off session worktrees (timestamped): scripts/launchcodexsession.ps1 (use -Tool opencode for Opencode sessions).