using-git-worktrees

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

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/erwinv2k-TKG/AgentesVSC --skill using-git-worktrees-erwinv2k-tkg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/erwinv2k-TKG/AgentesVSC/tree/main/packs/superpowers/skills/using-git-worktrees
Command: npx skills add https://github.com/erwinv2k-TKG/AgentesVSC --skill using-git-worktrees-erwinv2k-tkg

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 a separate branch without touching your main working directory, while preventing common mistakes like committing worktree contents or starting from a broken baseline. ## Core Features & Use Cases - Smart Directory Selection: Detects existing .worktrees/ or worktrees/ directories, respects CLAUDE.md preferences, and asks the user only when no convention exists. - Safety Verification: Confirms project-local worktree directories are git-ignored before creation, automatically fixing .gitignore and committing the change if needed. - Automated Project Setup: Auto-detects Node.js, Rust, Python, or Go projects and runs the appropriate dependency installation, then verifies a clean test baseline before work begins. - Use Case: Before implementing an approved feature design, create an isolated worktree at .worktrees/feature-auth, install dependencies, and confirm all 47 existing tests pass so new bugs are distinguishable from pre-existing failures. ## 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. Then change into that directory and install project dependencies before starting work.

Where should I put git worktrees in my project?

Prefer an existing .worktrees or worktrees directory, with .worktrees winning if both exist. If neither exists, check CLAUDE.md for a stated preference, otherwise ask the user to choose between a project-local or global location.

Why should worktree directories be added to gitignore?

Project-local worktree contents can otherwise be tracked by git and pollute git status or get accidentally committed. Verify with git check-ignore before creating the worktree, and commit a .gitignore fix if the directory is not ignored.

Should I run tests before starting work in a new worktree?

Yes, run the project's test suite to establish a clean baseline before implementing changes. If tests fail, report the failures and ask whether to proceed, so new bugs are not confused with pre-existing issues.

Does git worktree setup differ for Node, Rust, Python, or Go projects?

The worktree creation is identical, but dependency setup is auto-detected: npm install for package.json, cargo build for Cargo.toml, pip or poetry install for Python files, and go mod download for go.mod.