using-git-worktrees
Skill146 starsChanged 7 months agoMITView on GitHub
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.
- Installs packages
189 other projects use a version of this, 81 of them edited.
Adopted by
Most recently taken up by
- DemonDamon/AgenticXedited, first seen Nov 9, 2026
- chrysogonus/power-agentstheir own version, first seen Nov 8, 2026
- roundpilot/superpowers-antigravitytheir own version, first seen Nov 8, 2026
- lingyired/status-triotheir own version, first seen Nov 8, 2026
- afawfawffaf/my-skillstheir own version, first seen Nov 8, 2026
- supermorkat/qawa-arenatheir own version, first seen Nov 8, 2026
Used with
Projects with it also use chinese-code-review, chinese-commit-conventions and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Leodorareluctant259Skillchinese-code-review
中文代码审查规范——在保持专业严谨的同时,用符合国内团队文化的方式给出有效反馈
Also in 8 projects that use this
Leodorareluctant259Skillchinese-commit-conventions
中文 Git 提交规范 — 适配国内团队的 commit message 规范和 changelog 自动化
Also in 8 projects that use this
obraSkilldiagnosing-superpowers
Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.
Also in 20 projects that use this
frankxaiSkilldefense-in-depth
Use when invalid data causes failures deep in execution, requiring validation at multiple system layers - validates at every layer data passes through to make bugs structurally impossible
Also in 4 projects that use this
xfstudioSkilltest-fixing
Run tests and systematically fix all failing tests using smart error grouping. Use when user asks to fix failing tests, mentions test failures, runs test suite and failures occur, or requests to make tests pass.
Also in 3 projects that use this
kntismSkillcondition-based-waiting
Use when tests have race conditions, timing dependencies, or inconsistent pass/fail behavior - replaces arbitrary timeouts with condition polling to wait for actual state changes, eliminating flaky tests from timing guesses
Also in 3 projects that use this
- +3 more from Leodorareluctant259
Other versions189 projects use a version of this.
Word for word · 0
None found.
Edited · 81
- jnMetaCode/superpowers-zh★ 8.4k13% same
- DemonDamon/AgenticX★ 1k15% same
- coco-research/coco★ 79716% same
- Ibrahim-3d/conductor-orchestrator-superpowers★ 38116% same
- Ibrahim-3d/orchestrator-supaconductor★ 37816% same
- totvs/engpro-advpl-tlpp-skills★ 16616% same
- haojing8312/WorkClaw★ 14116% same
- ARounder-183/HiFiShifter★ 9315% same
- shibit-net/xuanji-community★ 9011% same
- GEd520/legados★ 7518% same
71 more not listed
Wrote their own version · 108
- obra/superpowers★ 314ksame name
- openai/plugins★ 7.8ksame name
- farm-fe/farm★ 5.6ksame name
- microsoft/FluidFramework★ 4.9ksame name
- silvertakana/worldwideview★ 1.9ksame name
- lingyired/status-trio★ 1.8ksame name
- GanyuanRan/Aegis★ 1.4ksame name
- pcvelz/superpowers★ 1.3ksame name
- usewhale/DeepSeek-Code-Whale★ 933same name
- usewhale/Whale★ 928same name
98 more not listed
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 repository23 other files it gives its agents.
- brainstormingSkill
- claude-md-creatorSkill
- context-managementSkill
- deliberationSkill
- dependency-managementSkill
- dispatching-parallel-agentsSkill
- error-recoverySkill
- executing-plansSkill
- finishing-a-development-branchSkill
- frontend-designSkill
- performance-investigationSkill
- premise-checkSkill
- receiving-code-reviewSkill
- refactoringSkill
- requesting-code-reviewSkill
- self-consistency-reasonerSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- token-efficiencySkill
- using-superpowersSkill
- verification-before-completionSkill
- writing-plansSkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 5 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 182 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Create an isolated branch workspace with safe defaults.
- Very specific: line 26
If .worktrees/ exists — use it.
- Very specific: line 27
If worktrees/ exists — use it.
- Distinctive: line 28
Check project guidance file (e.g.
- Very specific: line 43
Add the appropriate line to .gitignore.
- Very specific: line 44
Commit the
.gitignorechange immediately: before proceeding — an uncommitted ignore entry is easy to lose and leaves the worktree … - Distinctive: line 83
If none of these files exist, skip dependency installation and note it in the output.
- Distinctive: line 87
Run the project-appropriate test command to confirm the worktree starts clean:
- Distinctive: line 99
If baseline tests fail, report the failures and ask whether to continue or investigate before proceeding.
“Common” is measured: kept by at least 6 in 10 of the 182 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Using Git Worktrees
Create an isolated branch workspace with safe defaults.
Required Start
Announce: I'm using the using-git-worktrees skill to set up an isolated workspace.
Directory Selection Priority
Check in order:
ls -d .worktrees 2>/dev/null # Preferred (hidden)
ls -d worktrees 2>/dev/null # Alternative- If
.worktrees/exists — use it. If both exist,.worktrees/wins. - If
worktrees/exists — use it. - Check project guidance file (e.g.
CLAUDE.md) for a stated preference:grep -i "worktree.*director" CLAUDE.md 2>/dev/null - Ask user.
Safety Check
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/nullIf not ignored:
- Add the appropriate line to
.gitignore. - Commit the
.gitignorechange immediately before proceeding — an uncommitted ignore entry is easy to lose and leaves the worktree contents exposed to accidental staging.
Creation Steps
1. Detect project root and branch name
project=$(basename "$(git rev-parse --show-toplevel)")Choose a descriptive BRANCH_NAME for the feature being isolated.
2. Create worktree and branch
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.
3. Run project setup
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; fiIf none of these files exist, skip dependency installation and note it in the output.
4. Run baseline tests
Run the project-appropriate test command to confirm the worktree starts clean:
# Use whichever applies
npm test
cargo test
pytest
go test ./...Failure Handling
If baseline tests fail, report the failures and ask whether to continue or investigate before proceeding.
Success Output
Report:
- Worktree path (full absolute path)
- Branch name
- Ecosystem detected and setup command(s) run
- Baseline test status (passing count or failure summary)
Integration
Use with:
writing-planssubagent-driven-development— REQUIRED before executing any tasksexecuting-plans— REQUIRED before executing any tasks
Cleanup is handled by finishing-a-development-branch.
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.

