From PACT
Creates isolated git worktree with feature branch for PACT workflows. Use for starting new features, orchestrate/comPACT, ATOMIZE sub-scope isolation, or manual work isolation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/PACT:worktree-setupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create an isolated git worktree with a feature branch for PACT workflows. This provides filesystem isolation so multiple features or sub-scopes can run in parallel without interference.
Create an isolated git worktree with a feature branch for PACT workflows. This provides filesystem isolation so multiple features or sub-scopes can run in parallel without interference.
/PACT:orchestrate, /PACT:comPACT)Follow these steps in order. Stop and report any errors to the user.
Before creating anything, check if a worktree already exists for this branch.
git worktree list
git worktree prune first and proceed to create a new one.{branch} already exists. Check out existing branch, or create a new branch name?".worktrees/ DirectoryAll worktrees live in .worktrees/ relative to the repo root.
# Get main repo root (from a worktree, returns absolute path; from main repo, returns relative .git — the cd && pwd wrapper normalizes both to absolute)
MAIN_GIT_DIR=$(git rev-parse --git-common-dir)
REPO_ROOT=$(cd "$(dirname "$MAIN_GIT_DIR")" && pwd)
# Create directory and ensure gitignored
mkdir -p "$REPO_ROOT/.worktrees"
grep -q '\.worktrees' "$REPO_ROOT/.gitignore" 2>/dev/null || echo '.worktrees/' >> "$REPO_ROOT/.gitignore"
git worktree add "$REPO_ROOT/.worktrees/{branch}" -b {branch}
Where {branch} is the feature branch name (e.g., feature-auth or feature-auth--backend for sub-scopes).
If creation fails:
git worktree add "$REPO_ROOT/.worktrees/{branch}" {branch} without -b)Output the result:
Worktree ready at {REPO_ROOT}/.worktrees/{branch}
Branch: {branch}
Return the worktree path so it can be passed to subsequent phases and agents.
| Case | Handling |
|---|---|
| Already in a worktree for this feature | Detect via git worktree list, reuse existing |
| Worktree directory exists but is stale | Run git worktree prune first, then retry |
| Branch name already exists | Ask user: check out existing or create new name |
| Creation fails (disk/permissions) | Surface error, offer fallback to main repo |
npx claudepluginhub synaptic-labs-ai/pact-plugin --plugin PACTSets up an isolated git worktree for feature work, preferring native tools and falling back to manual git worktrees. Detects existing isolation and submodules.
Creates isolated git worktrees for parallel feature development, with automated directory selection and safety checks to prevent accidental commits.
Creates isolated Git worktrees for parallel feature work, handling directory selection, safety verification, and project setup.