using-git-worktrees

Creates isolated git worktree workspaces with native tool detection and baseline test verification.

1|Updated Sep 10, 2026
One-click install
npx skills add https://github.com/thienty1207/Hotel_Staff --skill using-git-worktrees-thienty1207
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/thienty1207/Hotel_Staff/tree/main/.baron/core/skills/superpowers/using-git-worktrees
Command: npx skills add https://github.com/thienty1207/Hotel_Staff --skill using-git-worktrees-thienty1207

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Feature work done directly in a shared checkout risks contaminating the current branch and mixing unrelated changes. This Skill ensures every implementation task starts in an isolated workspace, detecting existing isolation first and falling back to manual git worktrees only when no native tool exists. ## Core Features & Use Cases - Isolation Detection: Runs git rev-parse checks to determine whether you are already in a linked worktree, a submodule, or a normal checkout before creating anything. - Native Tool Preference: Uses platform-native worktree tools (such as EnterWorktree or a /worktree command) when available, avoiding phantom state the harness cannot manage. - Safe Git Fallback: Selects a worktree directory (.worktrees/ preferred), verifies it is git-ignored, creates the worktree with a new branch, and handles sandbox permission errors gracefully. - Baseline Verification: Auto-detects the project type (Node, Rust, Python, Go), installs dependencies, and runs the test suite to confirm a clean starting point. - Use Case: Before implementing a new API endpoint, invoke this Skill to spin up an isolated worktree on a fresh branch, install dependencies, and confirm all existing tests pass before writing code. ## Quick Start Set up an isolated git worktree for my next feature branch and verify the project tests pass before I start implementing.

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 workspace with git worktrees?

Run git worktree add with a target path and a new branch name, such as git worktree add .worktrees/my-feature -b my-feature. The Skill first checks for native worktree tools and verifies the directory is git-ignored before creating anything.

How to check if I am already inside a git worktree?

Compare git rev-parse --git-dir with --git-common-dir; if they differ, you are in a linked worktree. Also run git rev-parse --show-superproject-working-tree to rule out being inside a submodule, which produces the same mismatch.

Should I use a native worktree tool or git worktree add?

Prefer the native tool when one is available, such as EnterWorktree or a /worktree command. Native tools manage directory placement, branching, and cleanup; manual git worktree add creates state the harness cannot track.

Why must the worktree directory be in .gitignore?

An unignored worktree directory risks committing the entire nested worktree contents into the repository. The Skill runs git check-ignore on .worktrees or worktrees and adds the entry to .gitignore with a commit before proceeding.

What happens if git worktree add fails with a permission error?

A permission error typically means the sandbox blocked worktree creation. The Skill reports the sandbox denial, then continues working in the current directory, running project setup and baseline tests in place.