skills/git-worktree/SKILL.md
Manages Git worktrees for isolated parallel development. Creates worktrees in .github/worktrees/ with symlinked .env files.
npx skillsauth add skinnyandbald/fish-skills git-worktreeInstall 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.
Manage isolated Git worktrees for parallel development, following project conventions.
| Command | Description |
|---------|-------------|
| create <name> [base] | Create worktree with symlinked .env |
| list | List all worktrees |
| cleanup | Remove inactive worktrees |
| switch <name> | Switch to a worktree |
NEVER call git worktree add directly. Always use the script.
# CORRECT
bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh create feature-name
# WRONG - Never do this directly
git worktree add .github/worktrees/feature-name -b feature-name develop
The script handles:
.env file (not copy) from project root.github/worktrees/ is in .gitignore.github/worktrees/After creating a worktree, STOP. Do NOT implement anything in the current session. Do NOT cd into the worktree and keep working.
Your job in this session is ONLY:
All planning, brainstorming, and implementation happens in the new Claude Code instance inside the worktree — NOT here.
Why: Claude Code's working directory and statusline are set at launch time. If you work here after creating a worktree, auto-compact will lose the worktree context and revert to the main repo mid-work.
develop (not main).env files, not copies — single source of truth.github/worktrees/create <branch-name> [from-branch]Creates worktree in .github/worktrees/<branch-name>. Defaults to branching from develop.
# Create from develop (default)
bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh create feature/pipeline-steps
# Create from specific branch
bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh create hotfix/auth main
What happens:
.github/worktrees/ directory if needed.env from project rootlist or lsbash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh list
Shows:
*switch <name> or go <name>bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh switch feature/pipeline-steps
cleanup or cleanRemoves inactive worktrees interactively.
bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh cleanup
Safety: Won't remove current worktree.
# 1. Create worktree from develop
bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh create feature/auth-system
# Script output:
# ━━━ Launch Claude Code in this worktree ━━━
# cd /path/to/.github/worktrees/feature-auth-system && claude
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# 2. CLAUDE STOPS HERE. Tells user to copy-paste the command above into a new terminal.
# DO NOT continue with any work in this session.
# 3. User pastes command → new Claude Code instance starts in the worktree
# User brainstorms, plans, and implements in that fresh session
# 4. When done, cleanup from main repo
cd "$(git rev-parse --show-toplevel)"
bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh cleanup
# Create worktree from PR branch
bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh create pr-42-auth-fix origin/pr-branch
# CLAUDE STOPS HERE. Tells user to copy-paste the launch command into a new terminal.
# Cleanup after review
cd "$(git rev-parse --show-toplevel)"
bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh cleanup
project-root/
├── .env # Source of truth
├── .github/
│ └── worktrees/ # All worktrees live here
│ ├── feature-auth/
│ │ ├── .env -> ../../.. # Relative symlink to root .env
│ │ ├── src/
│ │ └── ...
│ └── feature-pipeline/
│ ├── .env -> ../../.. # Relative symlink to root .env
│ └── ...
└── .gitignore # Includes .github/worktrees
Switch to it instead:
bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh switch <name>
Return to main repo first:
cd "$(git rev-parse --show-toplevel)"
bash ~/.claude/skills/git-worktree/scripts/worktree-manager.sh cleanup
Recreate manually from the worktree directory:
cd .github/worktrees/<name>
rm .env
# Compute relative path to project root .env
GIT_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
ln -s "$(python3 -c "import os; print(os.path.relpath('$GIT_ROOT/.env', '$(pwd)'))")" .env
ls -la .env # Verify
Claude Code's CWD and statusline are set at launch. If you cd into a worktree from an existing session, the statusline stays wrong, and auto-compact causes Claude to revert to the main repo.
The script outputs a copy-paste command that:
cds to the worktreeclaude instanceThis ensures correct statusline and stable context throughout the session.
development
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
tools
Verify worktree plugin patches are intact after plugin updates. Checks compound-engineering and superpowers skills for Claude Code launch instructions.
development
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
development
Reviews the feature you just built and adds missing test coverage. Focuses on behavior that matters — not coverage metrics. Use after completing a feature to identify untested code paths, edge cases, and risk areas.