using-git-worktrees

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

Updated Jun 5, 2026
One-click install
npx skills add https://github.com/zMynxx/bifrost-with-opencode --skill using-git-worktrees-zmynxx
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/zMynxx/bifrost-with-opencode/tree/main/agent/skills/using-git-worktrees
Command: npx skills add https://github.com/zMynxx/bifrost-with-opencode --skill using-git-worktrees-zmynxx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Feature work done directly in a shared working tree risks polluting the current branch, mixing unrelated changes, and making it impossible to distinguish new bugs from pre-existing failures. This Skill guarantees every implementation task starts in an isolated, verified-clean workspace. ## 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) when available, falling back to manual git worktree add only when necessary. - Safe Directory Conventions: Selects .worktrees/ or worktrees/ by priority, verifies the directory is git-ignored, and commits the ignore rule if missing. - Baseline Verification: Auto-detects the project type (Node, Rust, Python, Go), installs dependencies, and runs the test suite to confirm a clean starting point. - Use Case: Before implementing a new feature branch, an agent runs this Skill to spin up .worktrees/feature-x, install dependencies, and confirm all existing tests pass before writing any code. ## Quick Start Ask the agent to set up an isolated worktree 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 new branch name, such as placing it under a .worktrees directory at the project root. Verify the directory is git-ignored first, then install dependencies and run the test suite to confirm a clean baseline.

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

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

How do I 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.

Why must the worktrees directory be added to gitignore?▼

A project-local worktree directory that is not ignored causes worktree contents to appear in git status and risk being committed to the repository. Verify with git check-ignore and commit the ignore rule before creating the worktree.

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

Failing baseline tests mean pre-existing issues exist before any new work begins. Report the failures and ask whether to proceed or investigate, so new bugs are not confused with existing breakage.