using-git-worktrees

Create isolated git worktrees with safe directory selection and validation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers create isolated workspaces for feature work by automatically setting up git worktrees with safe directory selection and verification.

Core Features & Use Cases

  • Systematic directory selection: prefer .worktrees, then worktrees, with CLAUDE.md guidance and user prompts when needed.
  • Safety verification: ensure the chosen directory is ignored by git to prevent accidental commits of worktree contents.
  • Auto-setup workflow: detects project type and runs the appropriate setup commands for Node.js, Rust, Python, or Go.

Quick Start

Announce usage and follow steps to create an isolated workspace: check for existing directories, verify ignore rules, create the worktree, run project setup, and validate 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 development?

To create an isolated git worktree, the skill systematically selects a directory, validates safety by ensuring the path is git-ignored, creates the worktree, and runs project setup commands.

How do I prevent accidental commits when setting up git worktrees?

To prevent accidental commits during git worktree setup, the skill enforces safety checks to verify that the chosen directory is added to git ignore rules before proceeding.

Where should I place my git worktrees to keep the project clean?

Git worktrees should preferably be placed in a local `.worktrees` or `worktrees` directory, with the skill applying CLAUDE.md preferences and prompting the user only when a decision cannot be inferred.

Can I automatically run environment setup after creating a git worktree?

Yes, after creating a git worktree, the skill detects the project type and automatically runs the appropriate setup commands for Node.js, Rust, Python, or Go environments.

What is the safest way to manage branch isolation with git worktrees?

The safest way to manage branch isolation with git worktrees is to use a systematic process that validates directory safety and ensures the worktree location is ignored by git to prevent accidental commits.