using-git-worktrees

Create isolated git worktrees with branch-based paths and baseline test verification.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes the risk and friction of starting feature work in a shared workspace by creating isolated git worktrees with predictable directory placement and safety checks to prevent accidental commits of worktree contents.

Core Features & Use Cases

  • Smart Directory Selection: Prefers existing project-local directories (.worktrees or worktrees), honors AGENTS.md preferences, and asks the user when ambiguous.
  • Safety Verification: Verifies project-local worktree directories are ignored, adds entries to .gitignore and commits when necessary to prevent accidental tracking.
  • Bootstrap and Baseline Validation: Creates branch-based worktree paths, runs the project's setup command if discoverable, and executes baseline tests to ensure a clean starting point.
  • Use Case: Create an isolated worktree for a long-running feature branch, install dependencies, and validate tests before beginning implementation to avoid polluting the main workspace.

Quick Start

Ask the skill to create an ignored project-local worktree named feature/auth, run the repository setup, and verify tests pass before starting implementation.

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 a feature branch without polluting the main workspace?

Create isolated git worktrees to separate feature work by discovering project-local directories, verifying gitignore status, and generating branch-based paths. This prevents accidental commits of worktree contents while keeping your main workspace clean during concurrent task development.

When should I use git worktrees for branch management instead of switching branches in a single directory?

Use git worktrees when starting long-running feature branches or working concurrently on multiple tasks that require separate dependency installations. Workspace isolation prevents environment conflicts and allows baseline test validation in a clean directory without disrupting your primary working branch.

How does git worktree directory discovery handle existing project-local paths and AGENTS.md preferences?

Git worktree directory discovery prefers existing project-local folders like .worktrees or worktrees, honors AGENTS.md preference checks, and prompts the user when placement is ambiguous. This ensures predictable path creation aligned with your project's established conventions.

Can git worktrees automatically run repository setup and baseline tests after workspace isolation?

Git worktrees can optionally bootstrap the repository by running the project's discoverable setup command and executing baseline tests after creating the branch-based path. This validates a clean starting point before you begin implementation work in the isolated environment.

Why are my project-local git worktree directories getting accidentally tracked in version control?

Project-local git worktree directories need gitignore verification to prevent accidental tracking. This skill checks if directories like .worktrees are ignored, adds entries to .gitignore, and commits the changes when necessary to ensure worktree contents stay excluded from version control.