using-git-worktrees

Creates isolated git worktrees with directory selection and safety verification.

Updated Jan 12, 2025
One-click install
npx skills add https://github.com/rinbarpen/NeuroTrain --skill using-git-worktrees-rinbarpen
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/rinbarpen/NeuroTrain/tree/main/.cursor/commands/using-git-worktrees
Command: npx skills add https://github.com/rinbarpen/NeuroTrain --skill using-git-worktrees-rinbarpen

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 user prompt—to place worktrees consistently. - Safety Verification: Checks that project-local worktree directories are git-ignored before creation, and automatically fixes .gitignore if not, preventing accidental commits of worktree contents. - Automated Setup and Baseline Testing: Auto-detects project type (Node.js, Rust, Python, Go) to install dependencies and runs the test suite to confirm a clean baseline before work begins. - Use Case: You are mid-way through debugging on main when a new feature request arrives. Use this Skill to spin up an isolated worktree at .worktrees/feature-auth with dependencies installed and tests verified, leaving your current workspace untouched. ## Quick Start Ask the AI to set up an isolated git worktree for your new feature branch using the using-git-worktrees skill.

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, creation, dependency installation, and baseline testing.

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 like .worktrees are preferred, with a global ~/.config/superpowers/worktrees location as an alternative.

Why must the worktree directory be in .gitignore?▼

If a project-local worktree directory is not git-ignored, its contents can appear in git status and be accidentally committed to the repository. The Skill verifies this with git check-ignore and adds the entry to .gitignore 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 verify 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 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 Python installs, and go.mod triggers go mod download.