using-git-worktrees

Create isolated Git worktrees with branch isolation and test validation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers need isolated environments for new features without switching branches manually, and must ensure worktree directories are ignored and clean before use.

Core Features & Use Cases

  • Directory selection: Determines the appropriate worktree directory via config, existing folders, or user input.
  • Safety verification: Confirms the directory is git‑ignored and adds it to .gitignore if necessary.
  • Automated creation: Generates a new branch, sets up the worktree, copies minimal .superharness files, runs language‑specific setup, and validates tests.
  • Use Cases: Starting a new feature, experimental branch, or any task that benefits from sandboxed development within the same repo.

Quick Start

Use the using-git-worktrees skill to set up an isolated worktree for the feature you are developing.

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?

Creating an isolated git worktree involves generating a new branch in a separate workspace directory. The process automatically ensures the directory is git-ignored, copies minimal configuration, runs language-specific setup, and validates tests.

When do I need to use a git worktree instead of switching branches?

You need a git worktree when starting a new feature or experimental branch that requires sandboxed development. It provides separate workspace and branch isolation within the same repository without manual branch switching.

Does git worktree setup automatically update the .gitignore file?

Yes, git worktree setup automatically verifies and updates the .gitignore file. It confirms the designated worktree directory is git-ignored and adds it to .gitignore if necessary to ensure the workspace remains clean.

What is the best way to verify tests pass in a new git worktree?

The best way to verify tests pass is through automated worktree creation. After setting up the worktree and copying minimal configuration, the process automatically runs language-specific setup commands and validates that tests pass before proceeding.

Can I use an existing folder for my git worktree directory?

Yes, you can use an existing folder for your git worktree directory. The setup process determines the appropriate directory by checking configuration, identifying existing folders, or prompting for user input to ensure proper isolation.

Why should I avoid manual branch switching for experimental features?

You should avoid manual branch switching for experimental features because worktrees provide isolated environments within the same repository. This sandboxed development approach ensures your main workspace remains clean while testing new tasks.