Use when starting a new task, feature, or bugfix that requires a clean, isolated development environment.
Git worktrees allow you to have multiple branches checked out at the same time in separate directories. This is essential for maintaining a clean, isolated development environment and preventing context contamination.
Look for existing worktree directories in the project root:
.worktrees/worktrees/Check for explicit instructions on where to store worktrees.
If no clear location exists, ask the user: "Where should I store git worktrees for this project? (Common locations: .worktrees/, worktrees/, or ../<project-name>-worktrees/)"
.worktrees/ or worktrees/)REQUIRED: Verify the directory is ignored by git.
git check-ignore <directory-path>
If NOT ignored, add it to .git/info/exclude or .gitignore before proceeding.
~/.config/superpowers/worktrees)Ensure the directory exists and is writable.
Use the current directory name or project configuration.
git worktree add -b <branch-name> <path-to-worktree> main
Navigate to the new worktree and run necessary setup commands (e.g., npm install).
Run tests to ensure a clean starting point.
npm test
Announce the new worktree location to the user.
| Command | Purpose |
|---|---|
git worktree list | List all active worktrees |
git worktree add <path> <branch> | Create a new worktree |
git worktree remove <path> | Remove a worktree |
git worktree prune | Clean up stale worktree information |
main or master.This skill is typically the first step in any new development task, setting the stage for writing-plans and executing-plans.