using-git-worktrees

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

Updated Dec 20, 2025
One-click install
npx skills add https://github.com/cristoslc/LLM-personal-agent-patterns --skill using-git-worktrees-cristoslc
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/cristoslc/LLM-personal-agent-patterns/tree/main/L3-agents-core/.agents/skills/using-git-worktrees
Command: npx skills add https://github.com/cristoslc/LLM-personal-agent-patterns --skill using-git-worktrees-cristoslc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working on a new feature often requires switching branches or stashing changes, which disrupts your current workspace. This Skill sets up isolated git worktrees so you can develop on separate branches simultaneously without touching your main working directory. ## Core Features & Use Cases - Smart Directory Selection: Follows a priority order (existing .worktrees/ or worktrees/ directory, then CLAUDE.md preference, then asks the user) to pick a consistent worktree location. - Safety Verification: Checks with git check-ignore that project-local worktree directories are gitignored, and automatically fixes and commits the .gitignore entry if not. - Automated Project Setup: Auto-detects Node.js, Rust, Python, or Go projects and runs the appropriate dependency installation, then runs the test suite to verify a clean baseline. - Use Case: Before implementing an approved feature design, create a worktree at .worktrees/auth on a new feature/auth branch, install dependencies, and confirm all 47 existing tests pass before writing any code. ## Quick Start Set up an isolated git worktree for my new feature branch and verify the project tests pass before I start implementing.

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, and dependency setup.

Where should git worktrees be stored in a project?▼

This Skill checks for an existing .worktrees or worktrees directory first, then any CLAUDE.md preference, then asks you to choose between a project-local .worktrees/ directory or a global ~/.config/superpowers/worktrees location.

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 verifies the directory is ignored with git check-ignore and commits a .gitignore fix before creating the worktree.

Does this work with Python, Rust, or Go projects?▼

Yes, the setup step auto-detects the 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.

What happens if baseline tests fail in a new worktree?▼

The Skill reports the test failures and asks whether to proceed or investigate rather than continuing silently. This prevents confusing pre-existing failures with bugs introduced by new feature work.