pact-plugin/skills/worktree-setup/SKILL.md
Create an isolated git worktree with a feature branch for PACT workflows. Use when: starting a new feature, beginning orchestrate or comPACT, creating sub-scope isolation for ATOMIZE, or manually isolating work. Triggers on: worktree setup, feature isolation, parallel workflow, new worktree.
npx skillsauth add synaptic-labs-ai/pact-plugin worktree-setupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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 |
data-ai
Record your teammate identity (name@team) at session start so later hooks can recover your friendly name. Invoke as your first action when your spawn prompt directs it.
testing
Testing strategies, test pyramid guidance, and quality assurance patterns for PACT Test phase. Use when: designing test suites, implementing unit tests, integration tests, E2E tests, performance testing, security testing, or determining test coverage priorities. Triggers on: test design, unit testing, integration testing, E2E testing, test coverage, test pyramid, mocking, fixtures, performance testing, test phase.
data-ai
Command-style teachback protocol for PACT teammates. Invoking this skill directly instructs you to store your teachback in task metadata and idle on awaiting_lead_completion before any implementation work.
development
Persistent memory for PACT agents. Save context, goals, lessons learned, decisions, and entities. Semantic search across sessions. Use when: saving session context, recalling past decisions, searching lessons. Triggers: memory, save memory, search memory, lessons learned, remember, recall