using-git-worktrees

Create isolated git worktrees with verified ignored directories and passing baseline tests.

3|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/pedropaulovc/agent-plugins --skill using-git-worktrees-pedropaulovc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/pedropaulovc/agent-plugins/tree/main/plugins/superpowers/skills/using-git-worktrees
Command: npx skills add https://github.com/pedropaulovc/agent-plugins --skill using-git-worktrees-pedropaulovc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the risk of contaminating your main working directory by isolating feature work into clean, branch-scoped git worktrees with consistent directory selection and baseline verification.

Core Features & Use Cases

  • Smart worktree directory selection: Prefers existing .worktrees (project-local) or worktrees, otherwise uses a CLAUDE.md preference, otherwise asks where to create worktrees (local hidden vs global config).
  • Safety verification for project-local isolation: Verifies the chosen local worktree directory is ignored via git check-ignore before creating the worktree, and if not ignored it fixes .gitignore and commits before proceeding.
  • End-to-end workspace readiness: Detects project name, creates the worktree on a new branch, runs appropriate dependency/setup based on project files, and verifies a clean baseline by running the project’s tests before telling you where the worktree is ready.

Quick Start

Use the using-git-worktrees skill to create an isolated feature workspace for implementation while ensuring the worktree directory is ignored and tests pass before you start coding.

Frequently Asked Questions about using-git-worktrees

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I isolate feature work in git to prevent contaminating my main working directory?

Git worktrees create isolated branch-scoped workspaces, preventing change contamination. This Skill automates worktree directory selection, verifies project-local ignore rules, and runs baseline tests to ensure a clean starting state for feature implementation.

How do I set up a new git worktree and verify the baseline tests pass?

Git worktree setup is automated by detecting the project stack, creating a new branch, running dependency installation, and executing tests. This verifies a clean baseline state before you begin coding in the isolated workspace.

What is the best way to manage worktree directory placement across different projects?

Worktree directory placement is resolved by checking for existing local directories, then reading CLAUDE.md preferences, and finally prompting the user. This priority resolution ensures consistent and reliable directory selection for isolated feature workspaces.

How do I ensure my local worktree directory is properly ignored by git?

Git check-ignore verifies the chosen local worktree directory is ignored before creation. If the check fails, the Skill repairs the .gitignore file and commits the change automatically to maintain repository hygiene before proceeding.

Can I use git worktrees for subagent-driven development workflows?

Git worktrees support subagent-driven development by providing reliable directory placement and setup. The Skill creates isolated workspaces on new branches, runs stack-specific dependency setup, and verifies baseline tests for robust development environments.

Why do I need to run tests before starting implementation in a new git worktree?

Running tests verifies a clean baseline state in the new git worktree before implementation begins. This ensures the isolated environment is properly configured with dependencies installed and prevents starting work on a broken codebase.