Install any skill in seconds. Free to start, no credit card required.
Get Started Free →openteams-lab/using-git-worktrees
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools, git worktree fallback, or non-git copy fallback
Passed 17 of 21 test cases with the skill, and 11 of 21 without it.
and 3 more in the full report
6 fixed12 passed either way4 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 6 test cases the skill fixed. Same model, same prompt, with and without the skill.
We are creating a project-local worktree at `.worktrees/bugfix-1`. Running `git check-ignore -q .worktrees` returns exit code 1 (not ignored). What must be done before creating the worktree?
| Checked | Without skill | With skill |
|---|---|---|
| The response adds .worktrees to .gitignore before creating the worktree. | Passed | Passed |
| The response commits the .gitignore change before creating the worktree. | Missed | Passed |
The instructions your model reads when the skill loads.
Ensure work happens in an isolated workspace. Prefer your platform's native worktree tools. Fall back to manual git worktrees only when no native tool is available. If git is unavailable or the project is not a git repository, create an isolated filesystem copy instead.
Core principle: Detect existing isolation first. Then use native tools. Then fall back to git. Then use a non-git copy fallback. Never fight the harness.
Announce at start: "I'm using the using-git-worktrees skill to set up an isolated workspace."
Before creating anything, check whether git can be used here.
command -v git >/dev/null 2>&1
git rev-parse --is-inside-work-tree >/dev/null 2>&1
If git is not installed: Skip git-specific detection and go to Step 2 (Non-Git Copy Fallback).
If the current directory is not inside a git work tree: Skip git-specific detection and go to Step 2 (Non-Git Copy Fallback).
If git is available and the project is a git repository, check if you are already in an isolated workspace.
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 is also true inside git submodules. Before concluding "already in a worktree," verify you are not in a submodule:
# 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/null
If GIT_DIR != GIT_COMMON (and not a submodule): You are already in a linked worktree. Skip to Step 3 (Project Setup). Do NOT create another worktree.
test cases passed, vs 11 / 21 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.