using-git-worktrees

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

Updated Jan 16, 2026
One-click install
npx skills add https://github.com/dudqks0319-cpu/antigravity-skills --skill using-git-worktrees-dudqks0319-cpu
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/dudqks0319-cpu/antigravity-skills/tree/main/using-git-worktrees
Command: npx skills add https://github.com/dudqks0319-cpu/antigravity-skills --skill using-git-worktrees-dudqks0319-cpu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working on a new feature often requires switching branches, which disrupts your current workspace, stashes uncommitted changes, and risks mixing unrelated work. This Skill sets up isolated git worktrees so you can develop on a separate branch in a separate directory without touching your main checkout. ## Core Features & Use Cases - Smart Directory Selection: Follows a priority order—existing .worktrees/ or worktrees/ directories, then CLAUDE.md preferences, then asking the user—so worktree locations stay consistent with project conventions. - Safety Verification: Checks with git check-ignore that project-local worktree directories are gitignored before creation, and fixes the .gitignore if not, preventing accidental commits of worktree contents. - Automated Setup and Baseline Validation: Auto-detects the 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 mid-review on one branch when a new feature request arrives. Use this Skill to spin up an isolated worktree at .worktrees/feature-auth, install dependencies, verify all 47 tests pass, and start implementing immediately. ## Quick Start Set up an isolated git worktree for my new feature branch and verify the project tests pass before I start working.

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, branch creation, dependency installation, and baseline test verification.

Where should git worktrees be stored in a project?▼

Worktrees are typically stored in a project-local .worktrees or worktrees directory, or in a global location like ~/.config/superpowers/worktrees/<project-name>. This Skill checks existing directories first, then CLAUDE.md preferences, then asks the user.

Why must the worktree directory be in .gitignore?▼

If a project-local worktree directory is not gitignored, its contents appear in git status and can be accidentally committed to the repository. The Skill runs git check-ignore before creation and adds the directory to .gitignore if needed.

What happens if tests fail when setting up a 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 work with Python or Rust projects?▼

Yes, the Skill auto-detects project type from marker files and runs the appropriate setup: npm install for package.json, cargo build for Cargo.toml, pip or poetry install for Python, and go mod download for go.mod.