using-git-worktrees

Create isolated Git worktrees with dependency installation and baseline tests.

1|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/xxih/ai-harness-zh --skill using-git-worktrees-xxih
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/xxih/ai-harness-zh/tree/main/references/translations/superpowers/skills/using-git-worktrees
Command: npx skills add https://github.com/xxih/ai-harness-zh --skill using-git-worktrees-xxih

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Establishes isolated development worktrees so developers can implement features or run parallel work without switching branches or contaminating the main workspace, reducing merge conflicts and accidental commits.

Core Features & Use Cases

  • Directory selection with priority rules: Prefer .worktrees, then worktrees, then user-provided global location or CLAUDE.md preference.
  • Safety and ignore validation: Verifies project-local directories are git-ignored, updates .gitignore and commits the change if necessary before creating a worktree.
  • Automated creation and initialization: Creates a new branch-backed worktree, runs language-specific dependency installation (Node/Rust/Python/Go), and executes baseline tests.
  • Failure handling and user confirmation: Reports failing tests or issues and asks whether to proceed or abort, avoiding blind continuation on broken baselines.
  • Use case: Kick off a feature implementation by creating an isolated workspace, ensuring a clean baseline, and immediately starting development without affecting the main checkout.

Quick Start

Create an isolated worktree for branch feature/auth, verify or add the directory to .gitignore and commit if needed, run project initialization (install deps), and run tests to confirm a clean baseline.

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 parallel feature development?

To create an isolated Git worktree, the tool provisions a separate branch-backed workspace, validates directory ignore rules, runs language-specific dependency installation, and executes baseline tests before signaling readiness. This prevents contaminating your main checkout while establishing a clean development baseline.

What is the best way to manage multiple Git branches without switching in the main workspace?

Using Git worktrees is the best way to manage multiple branches without switching, as it creates isolated directory-level workspaces for parallel agent work or feature implementation. This approach reduces merge conflicts and prevents accidental commits to the main repository checkout.

Does this Git worktree automation handle dependency installation for different programming languages?

Yes, the Git worktree automation handles dependency installation by running language-specific setups for Node, Rust, Python, and Go projects. After creating the isolated workspace, it automatically detects the project language and executes the appropriate dependency installation commands before running baseline tests.

Can I use a custom directory for Git worktrees instead of the default project location?

You can use a custom directory for Git worktrees by providing a global location or specifying a preference in CLAUDE.md. The tool follows priority rules, preferring local .worktrees or worktrees directories first, then falling back to your user-provided global location for workspace creation.

What happens if baseline tests fail after creating a new Git worktree?

If baseline tests fail after creating a Git worktree, the tool reports the failing tests or issues and asks whether to proceed or abort. This failure handling mechanism prevents blind continuation on broken baselines, ensuring you confirm readiness before starting feature development in the isolated workspace.

Why do I need to update .gitignore before creating a Git worktree in my project?

You need to update .gitignore before creating a Git worktree to ensure project-local worktree directories are properly ignored by Git. The tool verifies ignore validation, updates .gitignore if necessary, and commits the change to prevent the isolated workspace directories from being accidentally tracked in your repository.