using-git-worktrees

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

Updated Aug 14, 2026
One-click install
npx skills add https://github.com/bill80362/laravel-thread-admin --skill using-git-worktrees-bill80362
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/bill80362/laravel-thread-admin/tree/main/.github/superpowers/using-git-worktrees
Command: npx skills add https://github.com/bill80362/laravel-thread-admin --skill using-git-worktrees-bill80362

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Starting feature work directly in your main checkout risks polluting your current branch and mixing unrelated changes. This Skill ensures every implementation task begins in an isolated git worktree, with correct directory placement, gitignore protection, and a verified clean test baseline. ## Core Features & Use Cases - Isolation Detection: Detects whether you are already inside a linked worktree or a submodule before creating anything, avoiding duplicate or phantom worktrees. - Native Tool Priority with Git Fallback: Prefers native harness worktree tools (e.g., EnterWorktree) and falls back to manual git worktree add only when no native tool exists. - Safe Directory Selection: Chooses .worktrees/ or worktrees/ based on existing conventions, verifies the directory is gitignored, and commits the ignore rule if missing. - Project Setup and Baseline Verification: Auto-detects Node, Rust, Python, or Go projects, installs dependencies, and runs the test suite to confirm a clean starting state. - Use Case: Before implementing a new feature on a dirty main branch, ask the assistant to set up an isolated workspace; it creates a worktree on a new branch, installs dependencies, and confirms all tests pass before coding begins. ## Quick Start Ask the assistant to set up an isolated git worktree for your new feature branch and verify the baseline tests pass before starting implementation.

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 a new feature branch?

Run git worktree add with a target path and the -b flag to create a new branch, then cd into the path. The Skill automates this by selecting a directory, verifying it is gitignored, and creating the worktree on a new branch.

How do I 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 shows the same difference.

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

Prefer a native harness tool such as EnterWorktree when available, since it manages directory placement, branching, and cleanup. Use manual git worktree add only as a fallback when no native tool exists, to avoid unmanaged phantom state.

Why must the worktree directory be added to gitignore?

An unignored worktree directory risks having its entire contents accidentally committed into the parent repository. The Skill runs git check-ignore before creation and commits a gitignore update if the directory is not already excluded.

What happens if git worktree creation fails due to sandbox permissions?

When the sandbox blocks worktree creation, the Skill reports the restriction and falls back to working in place. It then runs project setup and baseline tests in the current directory instead of creating a new worktree.