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 from obra/superpowers
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
152.3Kusing-superpowers
Use when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions
92.7Ksystematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
92.0Kwriting-plans
Use when you have a spec or requirements for a multi-step task, before touching code
91.3Krequesting-code-review
Use when completing tasks, implementing major features, or before merging to verify work meets requirements
80.4Ktest-driven-development
Use when implementing any feature or bugfix, before writing implementation code
79.8K
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/skillsbrowser-use
Browser automation with visual understanding — interacts with pages based on what it sees
browser-use/browser-useexecuting-plans
Execute a plan step-by-step with checkpoints and verification at each stage
obra/superpowers