using-git-worktrees

Create isolated git worktrees with dependency setup and test validation.

19|2|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/bonnguyenitc/antigravity-superpowers --skill using-git-worktrees-bonnguyenitc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/bonnguyenitc/antigravity-superpowers/tree/main/.agent/skills/using-git-worktrees
Command: npx skills add https://github.com/bonnguyenitc/antigravity-superpowers --skill using-git-worktrees-bonnguyenitc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a repeatable, safe process to create isolated git worktrees so developers can start feature work without contaminating the current workspace or accidentally committing worktree contents. It enforces directory selection conventions and verification steps to protect the repository state.

Core Features & Use Cases

  • Deterministic directory selection: prefers .worktrees then worktrees, honors CLAUDE.md preferences, and asks the user when ambiguous.
  • Ignore verification and remediation: verifies project-local directories are gitignored and can add and commit .gitignore changes based on the agent's auto_commit setting.
  • Automated creation and setup: creates a new worktree branch, runs project-specific dependency installation (Node, Rust, Python, Go), and executes tests to confirm a clean baseline before development.
  • Use case: create an isolated workspace for a feature branch, run installs and tests, and return a ready-to-develop path while preventing repository pollution.

Quick Start

Set up an isolated git worktree for branch feature/auth using the project .worktrees directory, install dependencies, and run tests to verify a clean baseline.

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 an isolated git worktree for feature branch development?

To create an isolated git worktree, this skill automates directory selection by preferring the .worktrees folder, verifies the path is gitignored, creates the branch, installs dependencies, and runs tests to confirm a clean baseline before you start coding.

Why do my git worktree files show up as untracked changes in the main repository?

Git worktree files appear as untracked changes when the worktree directory is not properly gitignored. This skill verifies project-local directories are added to .gitignore and can auto-commit those changes to prevent repository contamination.

Can I set up git worktrees for projects using Node, Rust, Python, or Go?

Yes, you can set up git worktrees for Node, Rust, Python, and Go projects. The skill automatically runs project-specific dependency installation and executes tests to validate a clean baseline across these environments.

What is the best way to prevent workspace contamination when running multi-branch workflows?

The best way to prevent workspace contamination is using isolated git worktrees. This skill applies deterministic directory selection priority rules, honors CLAUDE.md preferences, and asks you when locations are ambiguous to ensure a safe development environment.

Does this git worktree automation respect existing project directory preferences?

Yes, the git worktree automation respects existing project preferences by honoring CLAUDE.md configurations, prioritizing the .worktrees directory, then falling back to a worktrees folder, and prompting you when the directory choice is ambiguous.

Do I need to manually run dependency setup after creating a new git worktree?

No, you do not need to manually run dependency setup. The skill automates the creation of the worktree branch and immediately runs project-specific dependency installation and tests to return a ready-to-develop path.