using-git-worktrees

Creates isolated git worktrees with directory selection, gitignore verification, and baseline test validation.

Updated Mar 2, 2026
One-click install
npx skills add https://github.com/LeroyAdonis/kitfix-2.0 --skill using-git-worktrees-leroyadonis
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/LeroyAdonis/kitfix-2.0/tree/main/.github/skills/using-git-worktrees
Command: npx skills add https://github.com/LeroyAdonis/kitfix-2.0 --skill using-git-worktrees-leroyadonis

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working on multiple branches simultaneously often requires stashing changes or cloning the repository again, which disrupts your current workspace. This Skill sets up isolated git worktrees so you can develop features in parallel without switching branches or polluting your main checkout. ## Core Features & Use Cases - Smart Directory Selection: Follows a priority order—existing .worktrees/ or worktrees/ directories, then CLAUDE.md preferences, then user prompt—to pick a consistent worktree location. - Safety Verification: Checks with git check-ignore that project-local worktree directories are gitignored before creation, and fixes the .gitignore automatically if not. - Automated Setup and Baseline Validation: Auto-detects project type (Node.js, Rust, Python, Go), installs dependencies, and runs the test suite to confirm a clean baseline before work begins. - Use Case: You are mid-review on one branch when a design gets approved for implementation. Use this Skill to spin up an isolated worktree at .worktrees/feature-auth, install dependencies, and verify all 47 tests pass before writing any code. ## Quick Start Set up an isolated git worktree for the new authentication feature branch and verify the test baseline is clean.

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 a git worktree for a new feature branch?▼

Run git worktree add with a target path and the -b flag to create a new branch, for example git worktree add .worktrees/auth -b feature/auth. This Skill automates path selection, branch creation, dependency installation, and test verification.

Where should git worktrees be stored in a project?▼

This Skill checks for existing .worktrees or worktrees directories first, then any CLAUDE.md preference, then asks the user. Project-local directories must be gitignored; a global location under ~/.config/superpowers/worktrees avoids that requirement.

Why must worktree directories be added to .gitignore?▼

Project-local worktree contents would otherwise appear in git status and risk being committed to the repository. The Skill runs git check-ignore before creation and automatically adds and commits a .gitignore entry if the directory is not ignored.

What happens if tests fail in a new worktree?▼

The Skill runs the project's test suite after setup to establish a clean baseline. If tests fail, it reports the failures and asks whether to proceed or investigate, preventing confusion between pre-existing issues and new bugs.

Does git worktree setup work with Python or Rust projects?▼

Yes, the Skill auto-detects project type from marker files: package.json triggers npm install, Cargo.toml triggers cargo build, requirements.txt or pyproject.toml trigger pip or poetry install, and go.mod triggers go mod download.