using-git-worktrees

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

Updated Jan 28, 2026
One-click install
npx skills add https://github.com/ttphats/project-detedxs26 --skill using-git-worktrees-ttphats
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/ttphats/project-detedxs26/tree/main/.augment/skills/superpowers/using-git-worktrees
Command: npx skills add https://github.com/ttphats/project-detedxs26 --skill using-git-worktrees-ttphats

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working on multiple branches simultaneously forces constant stashing, context switching, and risks polluting the main workspace. This Skill sets up isolated git worktrees so feature work proceeds in a separate directory without disturbing the current checkout. ## Core Features & Use Cases - Smart Directory Selection: Follows a priority order—existing .worktrees/ or worktrees/ directories, then AGENTS.md preferences, then asks the user—so worktrees land in a consistent location. - Safety Verification: Checks with git check-ignore that project-local worktree directories are gitignored before creation, and fixes the .gitignore automatically 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 implementation begins. - Use Case: Before executing an implementation plan for a new auth feature, create a worktree at .worktrees/auth on branch feature/auth, run npm install and the test suite, and start coding with confidence that failures are new, not pre-existing. ## 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. Then change into that directory and install project dependencies before starting work.

Where should git worktrees be stored in a project?▼

Prefer an existing .worktrees or worktrees directory in the project, with .worktrees taking priority if both exist. If neither exists, check AGENTS.md for a stated preference, otherwise ask the user or use a global location outside the repository.

Why must worktree directories be added to .gitignore?▼

Project-local worktree directories must be gitignored so their contents never appear in git status or get committed accidentally. Verify with git check-ignore before creating the worktree, and commit a .gitignore fix first if the directory is not ignored.

Should I run tests after creating a git worktree?▼

Yes, run the project's test suite immediately after setup to establish a clean baseline. If tests fail, report the failures and ask whether to proceed, since otherwise you cannot distinguish new bugs from pre-existing issues.

When should I use git worktrees instead of git stash or branch switching?▼

Use worktrees when you need two branches checked out simultaneously, such as running long tests on one branch while coding on another. Stashing or switching is fine for quick interruptions but loses build state and installed dependencies.