Loading...
Loading...
Use when starting new feature work to create isolated git worktrees with smart directory selection and safety verification. Keeps main branch clean while developing.
npx skill4agent add bbeierle12/skill-mcp-claude using-git-worktrees# Check in priority order
ls -d .worktrees 2>/dev/null # Preferred (hidden)
ls -d worktrees 2>/dev/null # Alternative.worktreesgrep -i "worktree.*director" CLAUDE.md 2>/dev/nullNo worktree directory found. Where should I create worktrees?
1. .worktrees/ (project-local, hidden)
2. worktrees/ (project-local, visible)
3. ~/.config/superpowers/worktrees/<project-name>/ (global location)
Which would you prefer?# Check if directory pattern in .gitignore
grep -q "^\.worktrees/$" .gitignore || grep -q "^worktrees/$" .gitignoreecho ".worktrees/" >> .gitignore
# or
echo "worktrees/" >> .gitignore# Determine branch name from feature
BRANCH_NAME="feature/descriptive-name"
# Create worktree with new branch
git worktree add ".worktrees/$BRANCH_NAME" -b "$BRANCH_NAME"
# Navigate to worktree
cd ".worktrees/$BRANCH_NAME"git worktree add ".worktrees/$BRANCH_NAME" "$BRANCH_NAME"# Node.js
if [ -f package.json ]; then npm install; fi
# Rust
if [ -f Cargo.toml ]; then cargo build; fi
# Python
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then poetry install; fi
# Go
if [ -f go.mod ]; then go mod download; fi# Run test suite
npm test # or appropriate command
# Report statusgit worktree list# After merging feature branch
git worktree remove ".worktrees/feature/branch-name"
# Force remove (if needed)
git worktree remove --force ".worktrees/feature/branch-name"git worktree prunefeature/descriptive-namebugfix/issue-number-descriptionhotfix/critical-issue# In worktree, get latest from main
git fetch origin
git rebase origin/main# Full cleanup
git checkout main
git pull
git worktree remove ".worktrees/feature/name"
git branch -d feature/name"I'm using the using-git-worktrees skill to set up an isolated workspace for [feature name].""Worktree ready at [full-path]
Tests passing ([N] tests, 0 failures)
Ready to implement [feature-name]"