using-git-worktrees

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

Updated May 28, 2026
One-click install
npx skills add https://github.com/mpmf/SDD_Base --skill using-git-worktrees-mpmf
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/mpmf/SDD_Base/tree/main/.opencode/skills/superpowers/using-git-worktrees
Command: npx skills add https://github.com/mpmf/SDD_Base --skill using-git-worktrees-mpmf

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: Detects 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. - 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/my-feature, installs dependencies (npm, cargo, pip, go), runs the test suite to confirm a clean baseline, and reports readiness. ## Quick Start Set up an isolated git worktree for my new feature branch and verify the 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 workspace with git worktree?▼

Run `git worktree add <path> -b <branch-name>` to create a linked worktree on a new branch. This Skill automates the process, choosing the directory, verifying it is git-ignored, and switching into the new workspace.

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

Prefer the native worktree tool if your platform provides one, such as EnterWorktree or a /worktree command. Native tools manage directory placement and cleanup automatically; manual `git worktree add` is only a fallback when no native tool exists.

How do I avoid creating a worktree inside another worktree?▼

Compare `git rev-parse --git-dir` with `--git-common-dir`; if they differ, you are already in a linked worktree. Also check `git rev-parse --show-superproject-working-tree` to rule out being inside a submodule before creating anything.

Why must the worktree directory be in .gitignore?▼

Project-local worktree directories like `.worktrees/` must be ignored so their contents never appear in git status or get committed. Verify with `git check-ignore` and commit the .gitignore change before creating the worktree.

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

The Skill reports the failing tests and asks whether to proceed or investigate. It never continues implementation on a failing baseline, since pre-existing failures would be indistinguishable from new bugs.