Use when starting new feature work to create isolated git worktrees with smart directory selection and safety verification. Keeps main branch clean while developing.
Isolate feature work. Keep main clean.
Git worktrees let you work on multiple branches simultaneously in separate directories.
# Check in priority order
ls -d .worktrees 2>/dev/null # Preferred (hidden)
ls -d worktrees 2>/dev/null # Alternative
If found: Use that directory.
If both exist: .worktrees wins.
grep -i "worktree.*director" CLAUDE.md 2>/dev/null
If preference specified: Use it without asking.
Ask the user:
No 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/$" .gitignore
If not present, add it:
echo ".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 status
If tests fail: Report failures, ask whether to proceed or investigate. If tests pass: Report ready.
git 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 prune
feature/descriptive-name for featuresbugfix/issue-number-description for bugshotfix/critical-issue for urgent fixes# In worktree, get latest from main
git fetch origin
git rebase origin/main
When feature is complete:
# Full cleanup
git checkout main
git pull
git worktree remove ".worktrees/feature/name"
git branch -d feature/name
At start of worktree creation:
"I'm using the using-git-worktrees skill to set up an isolated workspace for [feature name]."
On completion:
"Worktree ready at [full-path]
Tests passing ([N] tests, 0 failures)
Ready to implement [feature-name]"
下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer