using-git-worktreeslisted
Install: claude install-skill StielChancellor/VibeGod-Tech-Team
<!-- Adapted from superpowers (https://github.com/obra/superpowers), MIT (c) Jesse Vincent. -->
# Using Git Worktrees
## Overview
Ensure work happens in an isolated workspace. Prefer your platform's native worktree tools. Fall back to manual git worktrees only when no native tool is available.
**Core principle:** Detect existing isolation first. Then native tools. Then git fallback. Never fight the harness.
**Announce at start:** "I'm using the using-git-worktrees skill to set up an isolated workspace."
## Fits in the pipeline
Sets up isolation BEFORE **Stage 6 (Build)** — required by `executing-plans`, `subagent-driven-development`, and `dispatching-parallel-agents` so parallel coding agents don't collide. Cleanup is handled by `finishing-a-development-branch`. Priority: **user > skills > default**; `_shared/vibegod-principles.md` apply.
## Step 0: Detect Existing Isolation
Before creating anything, check whether you're already isolated.
```bash
GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
BRANCH=$(git branch --show-current)
```
**Submodule guard:** `GIT_DIR != GIT_COMMON` is also true inside submodules. Verify you're not in one:
```bash
git rev-parse --show-superproject-working-tree 2>/dev/null # returns a path → submodule, treat as normal repo
```
- **`GIT_DIR != GIT_COMMON` (not a submodule):** already in a linked worktree → skip to Step 3. Don't create another. Repor