using-git-worktrees

Create isolated git worktrees for feature branches with dependency setup and baseline tests.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/SeanChenR/maestro-agent --skill using-git-worktrees-seanchenr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/SeanChenR/maestro-agent/tree/main/.agents/skills/using-git-worktrees
Command: npx skills add https://github.com/SeanChenR/maestro-agent --skill using-git-worktrees-seanchenr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a reliable, repeatable process for creating isolated git workspaces so developers can work on multiple branches concurrently without polluting the main repository or accidentally committing worktree artifacts. It prevents common mistakes like unignored worktree directories, ambiguous directory selection, and proceeding with a broken baseline that would confuse implementation and debugging.

Core Features & Use Cases

  • Priority-based directory selection: prefers .worktrees, falls back to worktrees, reads CLAUDE.md preferences, or asks the user when ambiguous.
  • Safety verification: ensures project-local worktree directories are ignored via git check-ignore and, if not, updates .gitignore and commits the change before creating a worktree.
  • Automated creation and bootstrapping: creates a new worktree for a branch, auto-detects project type (Node, Python, Rust, Go) to install dependencies, and runs project tests to verify a clean baseline.
  • Decision points and reporting: stops and asks when tests fail, reports worktree location and test results, and enforces conventions to avoid repository pollution.
  • Use case: start a feature branch in an isolated workspace, run dependency setup and tests, and confirm readiness before implementation.

Quick Start

Create a hidden project-local .worktrees worktree for branch feature/auth, ensure the directory is added to .gitignore and committed, run the project-specific setup detected from project files, 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 isolated git worktrees for concurrent feature branch development?

To create isolated git worktrees, you can use a priority-based directory selection process that prefers a hidden .worktrees folder, verifies gitignore status, sets up dependencies, and runs baseline tests to ensure a clean workspace.

What's the best way to prevent git worktree directories from polluting my repository?

Preventing git worktree pollution requires verifying directory ignore status using git check-ignore before creation, and automatically updating and committing the .gitignore file if the worktree directory is not properly ignored.

Can I automatically install dependencies and run tests when setting up a new git worktree?

Yes, automated worktree bootstrapping can auto-detect project types like Node, Python, Rust, or Go to install dependencies and execute project tests, stopping to report if the baseline tests fail.

Does git worktree creation work with custom directory preferences defined in project files?

Git worktree creation supports custom preferences by reading configurations from a CLAUDE.md file, falling back to a default worktrees directory, or asking the user directly when directory selection remains ambiguous.

Why does my git worktree setup fail when baseline tests do not pass?

Git worktree setup intentionally stops and asks the user when tests fail to prevent proceeding with a broken baseline, which would otherwise confuse implementation and debugging within the isolated development workspace.

When do I need to use an isolated git worktree instead of a standard branch checkout?

You need an isolated git worktree when managing multi-branch development workflows that require concurrent branches, local setup verification, and automated project bootstrapping without switching contexts in the main repository.