using-git-worktrees

Creates isolated git worktree workspaces before starting feature implementation work.

Updated Aug 2, 2026
One-click install
npx skills add https://github.com/kxnzee/multi-repo-specs --skill using-git-worktrees-kxnzee
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/kxnzee/multi-repo-specs/tree/main/extensions/superpowers/skills/using-git-worktrees
Command: npx skills add https://github.com/kxnzee/multi-repo-specs --skill using-git-worktrees-kxnzee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Starting feature work directly in your main checkout risks polluting your current branch, mixing unrelated changes, and losing track of experiments. This Skill ensures every implementation task runs in an isolated workspace, either through your platform's native worktree tooling or a manual git worktree fallback. ## Core Features & Use Cases - Isolation Detection: Checks whether you are already inside a linked worktree by comparing git directory paths, preventing nested or duplicate worktrees. - Native Tool Preference: Uses platform-provided worktree tools (like EnterWorktree or /worktree commands) when available, falling back to git worktree add only when necessary. - Safe Directory Conventions: Follows a priority order for worktree placement (explicit instructions, existing .worktrees/ or worktrees/ directories, then default) and verifies the directory is git-ignored before creation. - Clean Baseline Verification: Runs project setup and the test suite to confirm the workspace starts green before implementation begins. - Use Case: Before implementing a new API endpoint, activate this Skill to spin up an isolated worktree on a fresh branch, install dependencies, and verify tests pass, keeping your main checkout untouched. ## Quick Start Set up an isolated git worktree for my new feature branch and verify the test baseline is clean before I start coding.

Frequently Asked Questions about using-git-worktrees

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an isolated workspace with git worktree?▼

Run `git worktree add <path> -b <branch-name>` to create a linked worktree on a new branch. First verify the target directory is git-ignored with `git check-ignore` so worktree contents never pollute the repository status.

How do I check if I am already inside a git worktree?▼

Compare `git rev-parse --git-dir` with `git rev-parse --git-common-dir`. If the resolved paths differ, you are in a linked worktree; if they match, you are in a normal repository checkout.

Should I use git worktree add or a native worktree tool?▼

Prefer the platform's native worktree tool (such as EnterWorktree or a /worktree command) whenever one is available. Manual `git worktree add` creates state the harness cannot track, so it should only be a fallback.

Where should git worktrees be placed in a project?▼

Follow this priority: an explicit user instruction first, then an existing `.worktrees/` or `worktrees/` directory (`.worktrees/` wins if both exist), and finally default to `.worktrees/` at the project root.

Why verify tests before starting work in a new worktree?▼

Running the test suite establishes a clean baseline so you can distinguish new bugs from pre-existing failures. If tests fail, report the failures and get explicit permission before proceeding with implementation.