using-git-worktrees

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

Updated Aug 5, 2026
One-click install
npx skills add https://github.com/pd-phuc/laravel-template --skill using-git-worktrees-pd-phuc
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/pd-phuc/laravel-template/tree/main/.claude/skills/using-git-worktrees
Command: npx skills add https://github.com/pd-phuc/laravel-template --skill using-git-worktrees-pd-phuc

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 touching your main checkout. ## 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 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 need to implement an authentication feature while your main workspace has uncommitted changes. The Skill creates .worktrees/auth on a new feature/auth branch, installs dependencies, and verifies all tests pass before you start coding. ## Quick Start Ask the AI to set up an isolated git worktree for your new feature branch before starting implementation.

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. The Skill automates this along with dependency installation and baseline test verification.

Where should git worktrees be stored in a project?▼

The Skill checks for an existing .worktrees or worktrees directory first, then looks for a preference in CLAUDE.md, and otherwise asks you to choose between a project-local .worktrees folder or a global location under ~/.config/superpowers/worktrees.

Why must the worktree directory be in .gitignore?▼

If a project-local worktree directory is not ignored, its contents can be accidentally tracked and pollute git status. The Skill verifies this with git check-ignore and commits a .gitignore fix before creating the worktree.

What happens if tests fail when setting up a 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, so pre-existing issues are not confused with new bugs.

Does git worktree setup support projects other than Node.js?▼

Yes, the Skill auto-detects the project type from marker files. It runs npm install for package.json, cargo build for Cargo.toml, pip or poetry install for Python, and go mod download for go.mod.