using-git-worktrees

Creates isolated git worktree workspaces with detection, setup, and baseline test verification.

Updated Jun 9, 2026
One-click install
npx skills add https://github.com/gyc-12/Archipelago --skill using-git-worktrees-gyc-12
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/gyc-12/Archipelago/tree/main/modules/collaboration-runtime/src-tauri/experts/skills/using-git-worktrees
Command: npx skills add https://github.com/gyc-12/Archipelago --skill using-git-worktrees-gyc-12

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 workspace, using native worktree tools when available or falling back to manual git worktrees. ## Core Features & Use Cases - Isolation Detection: Detects whether you are already inside a linked worktree or a submodule before creating anything, preventing nested worktrees. - Native Tool Preference with Git Fallback: Uses platform-native worktree tools (like EnterWorktree) first, and only falls back to git worktree add when no native tool exists. - Safe Directory Selection: Follows a priority order for worktree placement (existing .worktrees/, legacy global path, declared preference, default) and verifies the directory is git-ignored before creation. - Use Case: Before implementing a new feature branch, run this Skill to spin up an isolated worktree, auto-install dependencies (npm, cargo, pip, go), and verify a clean test baseline before writing any code. ## Quick Start Ask the AI to set up an isolated git worktree for your new feature work and verify the project tests pass before implementation begins.

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

Run git worktree add with a target path and new branch name, then cd into it. This Skill automates the process by detecting existing isolation, choosing a safe directory, and verifying the folder is git-ignored first.

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

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

Prefer a native platform tool such as EnterWorktree or a /worktree command when available, since it manages placement and cleanup automatically. Use manual git worktree add only as a fallback when no native tool exists.

Why must the worktree directory be added to gitignore?

Project-local worktree directories like .worktrees must be ignored so their contents are never accidentally committed to the repository. The Skill runs git check-ignore before creation and commits a gitignore update if needed.

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

If git worktree add fails with a permission error, the Skill reports the sandbox denial and continues working in the current directory instead. It still runs project setup and baseline tests in place.