using-git-worktrees

Create isolated Git worktrees with setup scripts and baseline tests.

Updated Mar 14, 2026
One-click install
npx skills add https://github.com/marcusfelix/barney --skill using-git-worktrees-marcusfelix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/marcusfelix/barney/tree/main/src/prompts/skills/using-git-worktrees
Command: npx skills add https://github.com/marcusfelix/barney --skill using-git-worktrees-marcusfelix

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of creating isolated development environments using Git worktrees, ensuring a clean and safe workspace for new feature development.

Core Features & Use Cases

  • Isolated Workspaces: Creates separate directories for different branches, preventing conflicts with your main codebase.
  • 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: Detects and runs project-specific setup commands (e.g., npm install, cargo build).
  • Baseline Testing: Verifies the new worktree is in a clean state by running project tests.
  • Use Case: When starting a new feature like "user authentication," this skill will set up a dedicated worktree, install dependencies, run tests, and confirm readiness, all while keeping your main branch untouched.

Quick Start

Use the using-git-worktrees skill to create a new worktree for the 'feature/user-profile' 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?

To create an isolated Git worktree, this skill intelligently selects a directory, verifies it against .gitignore, adds a new branch, runs project setup scripts like npm install, and validates a clean baseline with tests.

What is the best way to keep my main branch untouched while starting a new feature?

Using Git worktrees creates separate directories for different branches, preventing conflicts with your main codebase. This skill automates the setup, dependency installation, and testing for the new workspace.

Does Git worktree setup work with Node.js, Rust, Python, and Go projects?

Yes, Git worktree setup handles Node.js, Rust, Python, and Go projects. It automatically detects and runs project-specific setup commands and executes baseline tests for these environments.

How do I prevent accidental commits when creating Git worktrees in a local directory?

To prevent accidental commits during Git worktree creation, this skill performs safety verifications against your .gitignore file to ensure project-local directories are properly ignored before the worktree is created.

Why should I use Git worktrees instead of cloning a repository for a new feature branch?

Git worktrees provide isolated workspaces without the overhead of cloning. This skill automatically sets up dependencies and runs tests in the new branch directory, keeping your main branch clean and ready.