git-worktree

Initialize isolated git worktrees for feature work with deterministic directory selection.

3|Updated Jan 18, 2026
One-click install
npx skills add https://github.com/HankLiu447/SuperSpec --skill git-worktree-hankliu447
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktree
Source: https://github.com/HankLiu447/SuperSpec/tree/main/skills/git-worktree
Command: npx skills add https://github.com/HankLiu447/SuperSpec --skill git-worktree-hankliu447

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enables developers to create isolated git worktrees for feature work, preventing interference with the main workspace and preserving a clean git state.

Core Features & Use Cases

  • Safe isolation: automatically selects a dedicated worktree directory (preferring hidden .worktrees when available), then falls back to configured preferences or user prompts.
  • Safe baseline and cleanup: verifies the worktree is ignored by git, ensures a clean test baseline, and simplifies cleanup after work is complete.
  • Seamless project setup: auto-detects project type (Node, Rust, Python, Go) and runs the appropriate setup commands.

Quick Start

Determine the change_id from superspec/changes/[change-id]/ and create a worktree using git worktree add .worktrees/$change_id -b feature/$change_id; cd into the new directory; run project setup (npm install if package.json exists; cargo build if Cargo.toml exists; npm test / cargo test / pytest etc.).

Frequently Asked Questions about git-worktree

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

FAQPage Schema
How do I create isolated git worktrees for concurrent feature branches?

To create isolated git worktrees, the skill automatically selects a dedicated directory like hidden .worktrees, creates a feature branch, and verifies the directory is git-ignored to prevent main workspace interference.

What is the best way to manage git worktree directory selection safely?

Safe git worktree directory selection prefers existing directories, falls back to configured preferences, or prompts the user, ensuring the chosen workspace is properly git-ignored for a clean baseline.

How do I run project setup automatically after adding a git worktree?

After adding a git worktree, project setup runs automatically by detecting Node, Rust, Python, or Go projects and executing matching build or install commands like npm install or cargo build.

Does git worktree isolation work with superspec execute workflows?

Git worktree isolation works with superspec execute workflows by providing a clean baseline verification and a dedicated workspace, ensuring plans execute without disrupting the main project directory.

Why should I use git worktrees instead of stashing changes for new features?

Git worktrees provide complete workspace isolation for multiple features without disrupting the main workspace, unlike stashing changes which risks losing uncommitted work and cannot support concurrent branches.