using-git-worktrees

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

Updated Jun 8, 2026
One-click install
npx skills add https://github.com/Avistian/nba --skill using-git-worktrees-avistian
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/Avistian/nba/tree/main/.cursor/skills/using-git-worktrees
Command: npx skills add https://github.com/Avistian/nba --skill using-git-worktrees-avistian

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 checkout, while preventing common mistakes like committing worktree contents to the repository. ## 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 that project-local worktree directories are git-ignored before creation, and automatically fixes the .gitignore if they are not. - Automated Setup and Baseline Validation: Auto-detects the project type (Node.js, Rust, Python, Go) to install dependencies, then runs the test suite to confirm a clean baseline before work begins. - Use Case: Before implementing an approved feature plan, ask the assistant to create an isolated workspace; it will create a worktree on a new branch, install dependencies, run tests, and report the ready path. ## Quick Start Ask the assistant to set up an isolated git worktree for your new feature branch before starting implementation work.

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

Where should git worktrees be stored in a project?▼

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

Why must worktree directories be added to .gitignore?▼

Project-local worktree directories that are not git-ignored can have their contents accidentally tracked and committed, polluting the repository. The Skill verifies ignore status with git check-ignore and fixes the .gitignore before creating the worktree.

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, so pre-existing issues are not confused with new bugs.

Does git worktree setup support Python and 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.