using-git-worktrees
Skill80 starsChanged 7 days agoMITView on GitHub
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools
- Installs packages
189 other projects use a version of this, 130 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
- REPOZY/superpowers-optimizedtheir own version, first seen Nov 8, 2026
- lingyired/status-trioedited, first seen Nov 8, 2026
- afawfawffaf/my-skillsedited, first seen Nov 8, 2026
- supermorkat/qawa-arenaedited, first seen Nov 8, 2026
Used with
Projects with it also use chinese-code-review, chinese-commit-conventions and 9 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
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
xfstudioSkillcontext-driven-development
Use this skill when working with Conductor's context-driven
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 · 130
- obra/superpowers★ 314k15% same
- openai/plugins★ 7.8k15% same
- farm-fe/farm★ 5.6k15% same
- lingyired/status-trio★ 1.8k15% same
- pcvelz/superpowers★ 1.3k13% same
- DemonDamon/AgenticX★ 1k10% same
- usewhale/DeepSeek-Code-Whale★ 93315% same
- usewhale/Whale★ 92815% same
- coco-research/coco★ 79710% same
- Ibrahim-3d/conductor-orchestrator-superpowers★ 38110% same
120 more not listed
Wrote their own version · 59
- jnMetaCode/superpowers-zh★ 8.4ksame name
- microsoft/FluidFramework★ 4.9ksame name
- silvertakana/worldwideview★ 1.9ksame name
- GanyuanRan/Aegis★ 1.4ksame name
- Innei/ryugi★ 378same name
- KbWen/agentic-os★ 229same name
- REPOZY/superpowers-optimized★ 146same name
- aaddrick/claude-pipeline★ 128same name
- shibit-net/xuanji-community★ 90same name
- GEd520/legados★ 75same name
49 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 repository16 other files it gives its agents.
- contributing-to-superpowersSkill
- brainstormingSkill
- browser-testingSkill
- diagnosing-superpowersSkill
- dispatching-parallel-agentsSkill
- executing-plansSkill
- finishing-a-development-branchSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- using-superpowersSkill
- verification-before-completionSkill
- writing-plansSkill
- writing-skillsSkill
The file
We split this skill into the rules it gives an agent
11 rules. 1 is common, 5 are distinctive, and 5 are very specific to this project.
1
Common
Most of the 182 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Ensure work happens in an isolated workspace using Antigravity 2.0's native workspace isolation.
- Very specific: line 20
Verify Git Repository Existence: run git rev-parse --is-inside-work-tree.
- Very specific: line 41
For parent orchestrator feature branches: Use git checkout -b <branch> directly.
- Common: line 57
Run tests to ensure workspace starts clean:
- Very specific: line 88
If agents write code at the same time → branch
- Very specific: line 89
If one agent at a time writes, or agents only read → inherit
- Very specific: line 94
Use git worktree add — use Workspace: "branch" for concurrent writers instead
- Distinctive: line 95
Create a worktree when Step 0 detects existing isolation
- Distinctive: line 100
Run Step 0 detection first
- Distinctive: line 101
Use native workspace isolation
- Distinctive: line 103
Verify clean test baseline
“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
Overview
Ensure work happens in an isolated workspace using Antigravity 2.0's native workspace isolation.
Core principle: Detect existing isolation first. Then isolate the session on a feature branch; give Workspace: "branch" only to subagents that write alongside other writers. Never use manual git worktree add.
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.
Verify Git Repository Existence: run git rev-parse --is-inside-work-tree. It prints true inside a repository. Anything else means you are not in one — you cannot use worktrees; check whether you need to run git init first.
Then run each of these on its own and note what it prints:
git rev-parse --path-format=absolute --git-dir --git-common-dir
git branch --show-currentThe first prints GIT_DIR, then GIT_COMMON; the two differ in a linked worktree. The second prints BRANCH, or nothing on a detached HEAD. (Git older than 2.31 lacks --path-format: resolve each printed path to an absolute one before comparing.)
Submodule guard: GIT_DIR != GIT_COMMON is also true inside git submodules. Verify with git rev-parse --show-superproject-working-tree: it prints a path inside a submodule, and nothing otherwise.
If GIT_DIR != GIT_COMMON (and not a submodule): Already isolated. Skip to Step 2.
If GIT_DIR == GIT_COMMON (or in a submodule): Normal repo. Proceed to Step 1.
Step 1: Create Isolated Workspace
For subagents that write concurrently (parallel agents editing overlapping files): Workspace: "branch" on invoke_subagent. The platform handles directory placement, branch creation, and cleanup. For plan implementers, which run one at a time: Workspace: "inherit" — they commit on your feature branch.
For parent orchestrator feature branches: Use git checkout -b <branch> directly. No worktree needed — the orchestrator works in place on a feature branch. On 2.0, a conversation started in a Project's New Worktree Mode already runs in its own worktree; Step 0 detects it.
Step 2: Project Setup
Auto-detect and run appropriate setup — if the repository root has one of these files, run its command:
| File | Command |
package.json | npm install |
Cargo.toml | cargo build |
requirements.txt | pip install -r requirements.txt |
pyproject.toml | poetry install |
go.mod | go mod download |
Step 3: Verify Clean Baseline
Run tests to ensure workspace starts clean:
npm test / cargo test / pytest / go test ./...If tests fail: Report failures, ask whether to proceed or investigate. If tests pass: Report ready.
Quick Reference
| Situation | Action |
| Already in linked worktree | Skip creation (Step 0) |
| In a submodule | Treat as normal repo (Step 0 guard) |
| Concurrent writing subagents | Workspace: "branch" on invoke_subagent |
| Plan implementer (one at a time) | Workspace: "inherit" on your feature branch |
| Parent orchestrator | git checkout -b <branch> |
| Tests fail during baseline | Report failures + ask |
Workspace Mode Decision Table
Antigravity 2.0 supports three workspace modes for subagents. Choose based on the agent's role:
| Mode | Syntax | Use for | Example |
branch | Workspace: "branch" | Agents that write concurrently with other writers | Parallel fixers on overlapping files |
inherit | Workspace: "inherit" | Agents that work in your checkout: reviewers, and writers that run one at a time | Reviewers, plan implementers |
share | Workspace: "share" | Documented only as 'share directory storage'; its path, lifetime and git state are unverified — not recommended | — |
Rules of thumb:
- If agents write code at the same time →
branch - If one agent at a time writes, or agents only read →
inherit
Red Flags
Never:
- Use
git worktree add— useWorkspace: "branch"for concurrent writers instead - Create a worktree when Step 0 detects existing isolation
- Skip baseline test verification
- Proceed with failing tests without asking
Always:
- Run Step 0 detection first
- Use native workspace isolation
- Auto-detect and run project 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.
Reviews can't be read right now.
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.

