using-git-worktrees

Create isolated Git worktrees and run project-specific setup and test commands.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the creation of isolated Git worktrees, preventing conflicts and ensuring a clean development environment for new features or tasks.

Core Features & Use Cases

  • Isolated Workspaces: Create separate, clean directories for different branches using Git worktrees.
  • Smart Directory Selection: Intelligently chooses where to create worktrees based on project conventions or user preference.
  • Safety Verification: Ensures project-local directories are ignored by Git before creation to prevent accidental commits.
  • Automated Setup: Runs project-specific setup commands (npm, cargo, pip, poetry, go) automatically.
  • Baseline Verification: Runs tests to confirm a clean starting state after worktree creation.
  • Use Case: When starting a new feature, use this Skill to create a dedicated, isolated worktree, run npm install, and verify tests pass before writing any code.

Quick Start

Use the using-git-worktrees skill to create a new worktree for the 'feature/new-login' 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 an isolated Git worktree for feature development?

Creating an isolated Git worktree involves selecting a project directory, verifying it against .gitignore, and running project-specific build commands. This automation establishes a clean environment for parallel development tasks.

What is the best way to manage parallel Git branches without conflicts?

Using Git worktrees provides isolated workspaces by creating separate directories for different branches. This prevents conflicts and ensures a clean development environment for managing parallel tasks simultaneously.

How do I automate setup commands like npm install when creating a Git worktree?

Automating setup commands during Git worktree creation runs project-specific build tools like npm, cargo, pip, poetry, or go automatically. This immediately prepares the isolated environment with all dependencies installed.

Can I run tests automatically after setting up a Git worktree?

Running tests automatically after setting up a Git worktree performs baseline verification to confirm a clean starting state. This validates that the isolated environment is fully functional before development begins.

Does Git worktree creation check .gitignore before adding new directories?

Safety verification during Git worktree creation checks .gitignore to ensure project-local directories are ignored. This prevents accidental commits of worktree artifacts into the main repository, maintaining a clean project history.