brainstorming
MUST USE when the user wants new features, behavior changes, refactoring with new capabilities, or architecture decisions and no…
Use before implementation when work should be isolated from the current branch. Triggers on: "use a worktree", "isolate this work", "don't touch main", experimental or risky changes that need isolation.
$ npx -y skills add REPOZY/superpowers-optimized --skill using-git-worktrees --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/using-git-worktreesContext preview
The summary Claude sees to decide when to auto-load this skill.
Use before implementation when work should be isolated from the current branch. Triggers on: "use a worktree", "isolate this work", "don't touch main", experimental or risky changes that need isolation.
name: using-git-worktrees description: > Use before implementation when work should be isolated from the current branch. Triggers on: "use a worktree", "isolate this work", "don't touch main", experimental or risky changes that need isolation.
Create an isolated branch workspace with safe defaults.
Announce: `I'm using the using-git-worktrees skill to set up an isolated workspace.`
Check in order:
ls -d .worktrees 2>/dev/null # Preferred (hidden) ls -d worktrees 2>/dev/null # Alternative
1. If `.worktrees/` exists — use it. If both exist, `.worktrees/` wins. 2. If `worktrees/` exists — use it. 3. Check project guidance file (e.g. `CLAUDE.md`) for a stated preference:
grep -i "worktree.*director" CLAUDE.md 2>/dev/null
4. Ask user.
For project-local worktree directories, verify ignore rules before creating:
git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null
If **not** ignored: 1. Add the appropriate line to `.gitignore`. 2. **Commit the `.gitignore` change immediately** before proceeding — an uncommitted ignore entry is easy to lose and leaves the worktree contents exposed to accidental staging.
project=$(basename "$(git rev-parse --show-toplevel)")
Choose a descriptive `BRANCH_NAME` for the feature being isolated.
git worktree add <path> -b <BRANCH_NAME>
**Critical:** The `cd <path>` in this step does not persist across separate shell calls. Use the full worktree path — `cd <path> && <command>` — in every subsequent Bash call rather than assuming the working directory carried over.
Auto-detect the project ecosystem and run the appropriate setup:
# 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
If none of these files exist, skip dependency installation and note it in the output.
Run the project-appropriate test command to confirm the worktree starts clean:
# Use whichever applies npm test cargo test pytest go test ./...
If baseline tests fail, report the failures and ask whether to continue or investigate before proceeding.
Report:
Use with:
Cleanup is handled by `finishing-a-development-branch`.
The production-grade fork of obra/superpowers — same trusted workflow, dramatically leaner, safer, and more intelligent.
MUST USE when the user wants new features, behavior changes, refactoring with new capabilities, or architecture decisions and no…
Creates minimal, high-signal CLAUDE.md and AGENTS.md context files based on empirical best practices. Invoke on /init command,…
Use in long or noisy sessions to persist durable state across session boundaries via state.md. Also generates project-map.md when…
Use BEFORE brainstorming when facing a complex architectural, technology, or design decision where the options are not yet…
MUST USE when updating, migrating, or auditing project dependencies: upgrading packages, fixing security vulnerabilities (CVEs),…
Use when 2+ tasks are independent and can run concurrently without file or state conflicts or sequential dependencies. Triggers…