using-git-worktrees

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

Updated May 18, 2026
One-click install
npx skills add https://github.com/fts-pro/FTS-MMIS-AFRIKA --skill using-git-worktrees-fts-pro
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/fts-pro/FTS-MMIS-AFRIKA/tree/main/.agent/skills/using-git-worktrees
Command: npx skills add https://github.com/fts-pro/FTS-MMIS-AFRIKA --skill using-git-worktrees-fts-pro

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 platform worktree tools when available or falling back to manual git worktrees. ## Core Features & Use Cases - Isolation Detection: Checks 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 (e.g., EnterWorktree) first, and only runs git worktree add when no native tool exists. - Directory Conventions and Safety: Follows a priority order for worktree placement (existing .worktrees/, legacy global path, declared preference, default) and verifies the directory is git-ignored before creation. - Project Setup and Baseline Verification: Auto-detects Node.js, Rust, Python, or Go projects, installs dependencies, and runs tests to confirm a clean baseline. - Use Case: Before implementing a new feature, ask the assistant to set up an isolated workspace; it detects your environment, creates a worktree on a new branch, installs dependencies, and confirms tests pass. ## Quick Start Ask the assistant to set up an isolated worktree workspace for your new feature and verify the test baseline 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 feature development?▼

Run git worktree add with a target path and a new branch name, such as git worktree add .worktrees/my-feature -b my-feature. First verify the directory is git-ignored, 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 and git rev-parse --show-superproject-working-tree returns nothing, you are in a linked worktree rather than a submodule or normal checkout.

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

Prefer the native worktree tool when your platform provides one, such as an EnterWorktree command, because it handles placement, branching, and cleanup. Use manual git worktree add only when no native tool is available.

Why does git worktree creation fail with a permission error?▼

Sandboxed environments can block worktree creation with permission denials. In that case, report the sandbox restriction and proceed with setup and baseline tests in the current directory instead.

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

Failing baseline tests indicate pre-existing issues rather than problems from your new work. Report the failures and ask whether to proceed or investigate before writing any implementation code.