using-worktrees

Create isolated Git worktrees with environment setup and test verification.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the secure creation of isolated Git worktrees for feature development, preventing main workspace changes and providing deterministic contexts.

Core Features & Use Cases

  • Detect and respect existing worktree indicators to avoid conflicts.
  • Honor CLAUDE.md preferences when selecting a worktree location.
  • Create a new worktree on a dedicated branch and verify a clean baseline.
  • Set up project environments (devenv, npm/yarn/pip toolchains, etc.) as needed.
  • Produce a final, absolute path report and readiness for implementation.

Quick Start

  • Step 1: Check existing directories: ls -d .worktrees 2>/dev/null; ls -d worktrees 2>/dev/null
  • Step 2: Check CLAUDE.md preference: grep -i "worktree" CLAUDE.md 2>/dev/null
  • Step 3: If no preference, use AskUserQuestion tool to gather location
  • Step 4: Verify directory is gitignored for project-local worktrees
  • Step 5: Create worktree on a new branch using git worktree add
  • Step 6: Run environment setup detection and installation if applicable
  • Step 7: Verify a clean baseline by running project tests
  • Step 8: Report the absolute path, branch, test status, and environment, and prepare to implement the feature

Frequently Asked Questions about using-worktrees

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an isolated Git worktree for parallel feature development?

To create an isolated Git worktree, this skill checks for existing worktree directories, reads CLAUDE.md preferences for location, runs safety checks, and executes git worktree add on a new branch. It ensures a clean baseline before you start coding.

What is the best way to set up a dev environment automatically after creating a Git worktree?

The best way to set up a dev environment automatically is to detect and run project-specific toolchains like devenv, npm, yarn, pip, or cargo. This skill automates that environment setup immediately after adding the worktree.

Does Git worktree creation handle environment setup for Node.js and Python projects?

Yes, Git worktree creation handles environment setup for Node.js and Python by detecting and installing dependencies using npm, yarn, pip, or devenv. It automatically configures the isolated workspace so you can start feature development immediately.

Can I prevent my main workspace from being affected when running parallel Git experiments?

Yes, you can prevent main workspace changes by creating isolated Git worktrees on dedicated branches. This skill verifies gitignore rules and enforces a clean baseline, ensuring parallel experiments never impact your primary working directory.

How does this skill verify a clean baseline before starting feature development in a worktree?

It verifies a clean baseline by running your project tests immediately after environment setup. If the tests pass, the skill reports the worktree as ready with its absolute path, branch name, and configured environment.

Where should I put my Git worktrees to avoid committing them to the repository?

Git worktrees should be placed in project-local directories that are properly gitignored. This skill checks for .worktrees or worktrees directories, verifies they are ignored by git, and respects CLAUDE.md location preferences to prevent accidental commits.