
Git Worktree Isolation Setup
Sets up an isolated git worktree for a feature, then installs dependencies and runs baseline tests.
- Repository
- jnMetaCode/superpowers-zh
- Stars
- 8,444
- Licence
- MIT
- Files
- 1 file
What it does
Before an agent starts coding a feature, this skill makes it check whether it is already in an isolated copy of the project. If not, it prefers the platform's built-in worktree tool; only when none exists does it fall back to creating a git worktree in a folder like .worktrees/, after confirming that folder is git-ignored. It then installs project dependencies, runs the existing tests to confirm a clean starting point, and reports readiness.
Great for
- Developers who let an AI agent work on several features in one repository without touching their main checkout
- Teams using agent harnesses that already provide native worktree commands and want the agent to use them consistently
Skip it if
- Projects where you have not committed or do not understand git worktrees: the skill creates branches and folders and can add lines to .gitignore and commit them, which is hard to undo without git knowledge
- Repositories where dependency install or tests are slow or unsafe to run automatically, since the skill runs npm install, pip install, cargo build or go mod download and the project's test command without a separate confirmation
Try asking
- “Start a new feature in an isolated worktree before implementing the plan”
- “Set up a separate workspace for this bug fix and make sure the tests pass first”
- “Check whether I am already inside a worktree before creating another one”
Install in 3 steps
- 1
Download the skill
The ZIP contains the 1 original files, the MIT licence and an attribution note.
using-git-worktrees.zip - 2
Add it to your agent
Claude Code (all projects)
mkdir -p ~/.claude/skills && unzip using-git-worktrees.zip -d ~/.claude/skills/Claude Code / Agent SDK (this project only)
mkdir -p .claude/skills && unzip using-git-worktrees.zip -d .claude/skills/Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.
- 3
Ask for the task
No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.
Get better results
- State your worktree location preference in your instructions so the agent does not ask or pick a folder on its own
- Review the git status and .gitignore changes the skill proposes before letting it commit anything
- Run the skill in a disposable clone first if the project's install or test scripts are unfamiliar
What's inside
- SKILL.md
Redistributed unmodified from jnMetaCode/superpowers-zh under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.