superpowers-using-git-worktrees
Skill101 starsChanged 30 days agoMITView on GitHub
Feature work needing an isolated workspace, or executing a plan? Load first.
- Installs packages
2 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- EvovexAI/EvoFlowedited, first seen Oct 8, 2026
- host452b/polishedited, first seen Sep 30, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- EvovexAI/EvoFlow★ 61236% same
- host452b/polish★ 234% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- superpowers-brainstormingSkill
- superpowers-diagnosing-superpowersSkill
- superpowers-executing-plansSkill
- superpowers-finishing-a-development-branchSkill
- superpowers-receiving-code-reviewSkill
- superpowers-sync-upstreamSkill
- superpowers-systematic-debuggingSkill
- superpowers-test-driven-developmentSkill
- superpowers-verification-before-completionSkill
- superpowers-writing-plansSkill
- superpowers-writing-skillsSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 57
Check instructions for declared directory preference: Use it, no asking.
- Very specific: line 69
No other guidance: default to .worktrees/ at project root.
- Very specific: line 79
If NOT ignored: add to .gitignore, commit, proceed.
- Very specific: line 106
Run tests, ensure clean baseline (npm test / cargo test / pytest / go test ./...).
- Distinctive: line 134
Create a worktree when Step 0 detects existing isolation
- Distinctive: line 135
Use git worktree add when a native worktree tool exists — #1 mistake
- Distinctive: line 137
Create project-local worktree without verifying it's ignored
- Distinctive: line 141
Always: run Step 0 first; prefer native tools.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Using Git Worktrees
Overview
Work in isolated workspace. Prefer native worktree tools; manual git worktrees only when none.
Core principle: Detect existing isolation first. Then native tools. Then git fallback. Never fight harness.
Announce at start: "I'm using the superpowers-using-git-worktrees skill to set up an isolated workspace."
Step 0: Detect Existing Isolation
Before creating anything, check if already in isolated workspace. Via bash:
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)Submodule guard: GIT_DIR != GIT_COMMON also true inside submodules. Verify not a submodule before concluding "worktree":
# If this returns a path, you're in a submodule, not a worktree — treat as normal repo
git rev-parse --show-superproject-working-tree 2>/dev/nullIf GIT_DIR != GIT_COMMON (and not a submodule): Already in linked worktree. Skip to Step 3, do NOT create another. Report branch state:
- On a branch: "Already in isolated workspace at
<path>on branch<name>." - Detached HEAD: "Already in isolated workspace at
<path>(detached HEAD, externally managed). Branch creation needed at finish."
If GIT_DIR == GIT_COMMON (or in a submodule): Normal repo checkout. Preference declared? Honor it, no asking. Else ask consent:
"Would you like me to set up an isolated worktree? It protects your current branch from changes."
Declines: work in place, skip to Step 3 — do NOT start editing feature code on the current branch first.
Step 1: Create Isolated Workspace
1a. Native Worktree Tools (preferred)
Already have a worktree mechanism — a tool named EnterWorktree, WorktreeCreate, a /worktree command, or a --worktree flag? Use it, skip to Step 3.
Native tools handle placement, branch creation, cleanup. Using git worktree add when a native tool exists creates phantom state the harness can't manage. No native tool: proceed to Step 1b.
1b. Git Worktree Fallback
Only use if Step 1a does not apply. Explicit user preference always beats filesystem state.
Directory Selection
- Check instructions for declared directory preference. Use it, no asking.
- Check for existing project-local worktree directory:
Both exist?ls -d .worktrees 2>/dev/null # Preferred (hidden) ls -d worktrees 2>/dev/null # Alternative.worktreeswins. - Check for existing global directory:
project=$(basename "$(git rev-parse --show-toplevel)") ls -d ~/.config/reasonix/worktrees/$project 2>/dev/null - No other guidance: default to
.worktrees/at project root.
Safety Verification (project-local directories only)
MUST verify directory ignored before creating worktree:
git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/nullIf NOT ignored: add to .gitignore, commit, proceed. Why critical: prevents committing worktree contents. Global directories need no verification.
Create the Worktree
# For project-local: path="$LOCATION/$BRANCH_NAME"
# For global: path="~/.config/reasonix/worktrees/$project/$BRANCH_NAME"
git worktree add "$path" -b "$BRANCH_NAME"
cd "$path"Sandbox fallback: git worktree add fails with permission error (sandbox denial — Reasonix confines writes to [sandbox] workspace_root)? Tell the user the sandbox blocked it, working in the current directory instead. Run setup and baseline tests in place.
Step 3: Project Setup
Auto-detect and run setup, bash:
if [ -f package.json ]; then npm install; fi
if [ -f Cargo.toml ]; then cargo build; fi
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then poetry install; fi
if [ -f go.mod ]; then go mod download; fiStep 4: Verify Clean Baseline
Run tests, ensure clean baseline (npm test / cargo test / pytest / go test ./...).
Tests fail: report failures, ask whether to proceed or investigate. Pass: report ready.
Worktree ready at <full-path>
Tests passing (<N> tests, 0 failures)
Ready to implement <feature-name>Quick Reference
| Situation | Action |
| Already in linked worktree | Skip creation (Step 0) |
| In a submodule | Treat as normal repo (Step 0 guard) |
| Native worktree tool available | Use it (Step 1a) |
| No native tool | Git worktree fallback (Step 1b) |
.worktrees/ exists | Use it (verify ignored) |
Both .worktrees/ and worktrees/ exist | Use .worktrees/ |
| Neither exists | Check instruction file, then default .worktrees/ |
| Directory not ignored | Add to .gitignore + commit |
| Permission error on create | Sandbox fallback, work in place |
| Tests fail during baseline | Report failures + ask |
Red Flags
Never:
- Create a worktree when Step 0 detects existing isolation
- Use
git worktree addwhen a native worktree tool exists — #1 mistake - Skip Step 1a, jump straight to git commands
- Create project-local worktree without verifying it's ignored
- Skip baseline test verification
- Proceed with failing tests without asking
Always: run Step 0 first; prefer native tools; follow directory priority (existing > global legacy > instruction file > default); verify ignored for project-local; auto-detect and run setup; verify clean test baseline.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

