using-git-worktrees

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

Updated Aug 26, 2026
One-click install
npx skills add https://github.com/danieliudi/trackforge-os --skill using-git-worktrees-danieliudi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/danieliudi/trackforge-os/tree/main/.cursor/skills/using-git-worktrees
Command: npx skills add https://github.com/danieliudi/trackforge-os --skill using-git-worktrees-danieliudi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Starting feature work directly in your main checkout risks mixing unfinished changes with your current branch state. This Skill ensures every implementation task begins 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: Checks whether you are already inside a linked worktree or a submodule before creating anything, avoiding nested or duplicate workspaces. - Native Tool Preference: Uses platform-native worktree tools (like EnterWorktree or /worktree commands) when available, falling back to git worktree add only when necessary. - Safe Directory Handling: Selects .worktrees/ or worktrees/ directories, verifies they are git-ignored before creation, and commits the ignore rule if missing. - Use Case: Before implementing a new feature branch, the Skill sets up an isolated worktree, installs project dependencies (npm, cargo, pip, or go), runs the test suite to confirm a clean baseline, and reports readiness. ## Quick Start Ask the AI to set up an isolated worktree for your next feature branch and verify the project tests pass before you start coding.

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 <path> -b <branch-name>` to create a linked worktree on a new branch. The Skill automates this by selecting a `.worktrees/` directory, verifying it is git-ignored, and changing into the new workspace.

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 tool such as EnterWorktree or a /worktree command when one is available, because it manages placement, branching, and cleanup automatically. Manual `git worktree add` is only a fallback and can create 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` before creation and adds the directory to .gitignore with a commit if it is not already ignored.

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

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