using-git-worktrees

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

Updated Jul 19, 2026
One-click install
npx skills add https://github.com/DagimAlemayehuu/AgenticEngineering --skill using-git-worktrees-dagimalemayehuu
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/DagimAlemayehuu/AgenticEngineering/tree/main/agentic-engineering/core/dependencies/workspace/using-git-worktrees
Command: npx skills add https://github.com/DagimAlemayehuu/AgenticEngineering --skill using-git-worktrees-dagimalemayehuu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Feature work done directly in a shared checkout risks polluting the current branch, mixing unrelated changes, and breaking the user's working state. This Skill guarantees that implementation work happens in an isolated workspace before any code changes begin. ## Core Features & Use Cases - Isolation Detection: Detects whether the agent is already inside a linked worktree or a git submodule before creating anything, preventing nested worktrees. - Native Tool Preference: Uses platform-native worktree tools (e.g., 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. - Baseline Verification: Runs project-appropriate tests (npm, cargo, pytest, go) to confirm a clean starting state and reports failures before proceeding. - Use Case: Before implementing a new feature branch, an agent checks for existing isolation, creates .worktrees/my-feature, runs the test suite, and reports a clean baseline ready for development. ## Quick Start Use the using-git-worktrees skill to set up an isolated workspace before starting this feature 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 workspace with git worktree?▼

Run git worktree add with a target path and new branch name, such as git worktree add .worktrees/my-feature -b my-feature. Verify the directory is git-ignored first, then cd into it and run your project's test suite 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 the platform's native worktree tool (such as EnterWorktree or a /worktree command) whenever one is available, since it manages placement, branching, and cleanup. Use manual git worktree add only as a fallback when no native tool exists.

Why must the worktree directory be in .gitignore?▼

A project-local worktree directory that is not ignored gets tracked by git, polluting git status and risking accidental commits of worktree contents. Always verify with git check-ignore before creating the worktree and request approval before modifying .gitignore.

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

Failing baseline tests mean pre-existing issues exist before any new work begins. The correct action is to report the failures and ask whether to proceed or investigate, rather than mixing new bugs with existing breakage.