using-git-worktrees

Creates isolated git worktree workspaces with baseline test verification before feature implementation.

1|Updated May 16, 2026
One-click install
npx skills add https://github.com/ludotype/game-adventurertown --skill using-git-worktrees-ludotype
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/ludotype/game-adventurertown/tree/main/.agent/skills/using-git-worktrees
Command: npx skills add https://github.com/ludotype/game-adventurertown --skill using-git-worktrees-ludotype

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, with dependencies installed and a clean test baseline verified before any code changes happen. ## Core Features & Use Cases - Isolation Detection: Detects whether you are already inside a linked worktree or a git submodule before creating anything, preventing nested worktrees. - Native Tool Preference with Git Fallback: Uses platform-native worktree tools (like EnterWorktree) when available, falling back to manual git worktree add only 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, the Skill sets up .worktrees/feature-x, runs npm install, executes the test suite to confirm a clean baseline, and reports the workspace is ready. ## Quick Start Set up an isolated git worktree for my new 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 git worktree for feature development?▼

Run git worktree add with a target path and new branch name, such as git worktree add .worktrees/feature-x -b feature-x. First verify the directory is git-ignored with git check-ignore, then install dependencies and run tests to confirm a clean baseline.

How do I check if I am already inside a git worktree?▼

Compare git rev-parse --git-dir with git rev-parse --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 one is available, since it handles placement, branching, 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 tracked or committed into the repository. Verify with git check-ignore before creation, and commit the .gitignore update if the directory is not yet ignored.

What happens if baseline tests fail in a new worktree?▼

Failing baseline tests mean pre-existing issues exist before any new changes. The failures are reported and you must explicitly decide whether to proceed or investigate, so new bugs can be distinguished from existing breakage.