using-git-worktrees
Isolated git worktrees with smart directory selection and safety verification.
- Automatically detects worktree directory location by checking existing directories, CLAUDE.md preferences, or asking the user; supports both project-local (.worktrees) and global (~/.config/superpowers/worktrees) storage
- Verifies project-local directories are git-ignored before creation to prevent accidentally committing worktree contents
- Auto-detects and runs project setup (npm install, cargo build, pip install, go mod download) based on detected project files
- Runs baseline tests to ensure a clean starting state before proceeding with feature work
- Integrates with brainstorming, subagent-driven-development, and plan execution workflows to provide isolated workspaces
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 use native tools. Then fall back to git. Never fight the harness.
Announce at start: "I'm using the using-git-worktrees skill to set up an isolated workspace."
Step 0: Detect Existing Isolation
Before creating anything, check if you are already in an isolated workspace.
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)
More in Agent workflows
find-skills
Discover and install skills from skills.sh directly inside an agent session
vercel-labs/skillsagent-browser
Full browser automation: navigate, click, fill forms, extract data, and screenshot
vercel-labs/agent-browserskill-creator
Create, test, and publish new skills from within your agent
anthropics/skillsbrainstorming
Structured ideation and problem decomposition frameworks
obra/superpowersbrowser-use
Browser automation with visual understanding — interacts with pages based on what it sees
browser-use/browser-use