using-git-worktrees

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

Updated Dec 19, 2024
One-click install
npx skills add https://github.com/DNepovim/yadm --skill using-git-worktrees-dnepovim
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/DNepovim/yadm/tree/main/.claude/plugins/cache/claude-plugins-official/superpowers/5.0.6/skills/using-git-worktrees
Command: npx skills add https://github.com/DNepovim/yadm --skill using-git-worktrees-dnepovim

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 creates 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/ directories, then CLAUDE.md preferences, then asks the user—so worktrees land in a consistent location. - Safety Verification: Checks that project-local worktree directories are git-ignored before creation, and automatically fixes the .gitignore if not, preventing accidental commits of worktree contents. - 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 about to implement an approved feature design. The Skill creates .worktrees/feature-auth on a new branch, runs npm install, verifies all 47 tests pass, and reports the workspace is ready. ## Quick Start Set up an isolated git worktree for my new feature branch and verify the 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. The Skill automates this along with dependency installation and test verification.

Where should git worktrees be stored in a project?▼

The Skill checks for existing .worktrees or worktrees directories first, then any CLAUDE.md preference, then asks the user. Project-local directories must be git-ignored; a global location under ~/.config/superpowers/worktrees is also supported.

Why must worktree directories be added to .gitignore?▼

Without ignore rules, worktree contents appear in git status and can be accidentally committed to the repository. The Skill verifies this with git check-ignore and automatically adds and commits the .gitignore entry if missing.

What happens if tests fail when setting up a worktree?▼

The Skill reports the test failures and asks whether to proceed or investigate rather than continuing silently. This ensures you can distinguish pre-existing issues from bugs introduced by new work.

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.