using-git-worktrees

Create isolated Git worktrees with automated setup and test verification.

Updated Nov 3, 2025
One-click install
npx skills add https://github.com/ayourtch/kimichat --skill using-git-worktrees-ayourtch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/ayourtch/kimichat/tree/main/skills/using-git-worktrees
Command: npx skills add https://github.com/ayourtch/kimichat --skill using-git-worktrees-ayourtch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents polluting your main branch or current workspace when starting new features or experiments. It ensures isolated development environments, reducing conflicts and simplifying cleanup.

Core Features & Use Cases

  • Isolated Workspaces: Create separate, clean Git worktrees for new features, bug fixes, or experimental branches.
  • Smart Directory Selection: Automatically or interactively choose the best location for worktrees, respecting .gitignore rules for safety.
  • Automated Setup & Verification: Runs project-specific setup commands (e.g., npm install, cargo build) and verifies a clean baseline with tests.
  • Use Case: Before starting a new feature, use this skill to create a dedicated worktree, ensuring your main branch remains untouched and your new work starts from a clean, tested state.

Quick Start

I'm using the using-git-worktrees skill to set up an isolated workspace for my new 'feature/auth' branch.

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 feature development?

Git worktrees let you create separate working directories linked to your repository, each on a different branch. Use this Skill to automatically set up a clean worktree for your feature work, keeping your main branch untouched and enabling parallel development without conflicts.

What's the best way to prevent branch conflicts when starting new features?

Isolated worktrees prevent conflicts by giving each feature its own workspace and branch. This Skill creates worktrees in project-safe locations, respects .gitignore rules, and verifies the baseline with tests before you start, eliminating pollution of your main development environment.

Can I automatically set up dependencies when creating a new worktree?

Yes. This Skill detects your project type (Node.js, Rust, Python, Go) and runs appropriate setup commands like npm install or cargo build automatically, then executes tests to confirm a clean baseline before you begin feature work.

How do git worktrees handle .gitignore and project-local directories?

The Skill prioritizes smart directory selection by checking hidden .worktrees directories first, then worktrees, while verifying .gitignore compliance to ensure worktrees stay isolated and don't pollute version control or interfere with your main workspace.

Do I need to manually clean up worktrees after finishing a feature?

Worktrees are self-contained and isolated by design. Once you finish a feature and merge the branch, the worktree directory can be removed independently without affecting your main repository, simplifying cleanup and workspace management.

What happens if my project setup fails during worktree creation?

The Skill verifies project setup and test execution before completing the worktree initialization. If setup or tests fail, the issue is reported immediately, letting you diagnose problems in the clean worktree environment before starting development.