Using Git Worktrees — The Isolator
> **Type:** Rigid
Best use case
Using Git Worktrees — The Isolator is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
> **Type:** Rigid
Teams using Using Git Worktrees — The Isolator should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/using-git-worktrees/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How Using Git Worktrees — The Isolator Compares
| Feature / Agent | Using Git Worktrees — The Isolator | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
> **Type:** Rigid
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Using Git Worktrees — The Isolator > **Type:** Rigid > **Trigger:** Starting feature work that needs workspace isolation ## Iron Law ``` FEATURE WORK HAPPENS IN ISOLATION — NEVER ON THE MAIN BRANCH ``` ## Purpose Uses git worktrees to create isolated workspaces for feature development. Prevents "works on my branch" issues and keeps the main branch clean. ## Directory Selection Priority 1. Check for existing worktree directory: `.worktrees/` (preferred) or `worktrees/` 2. Check project documentation (README, CONTRIBUTING) for conventions 3. Ask the user for preference ## Safety Verification **MUST verify the worktree directory is gitignored before creating.** ```bash # Check .gitignore grep -q '.worktrees' .gitignore || echo '.worktrees/' >> .gitignore git add .gitignore && git commit -m "chore: gitignore worktrees directory" ``` ## Process ### Step 1: Detect Project ```bash PROJECT_NAME=$(basename $(git rev-parse --show-toplevel)) BRANCH_NAME="feature/<descriptive-name>" ``` ### Step 2: Create Worktree ```bash git worktree add .worktrees/$BRANCH_NAME -b $BRANCH_NAME cd .worktrees/$BRANCH_NAME ``` ### Step 3: Project Setup Auto-detect and run setup: | Indicator | Setup Command | |-----------|---------------| | `package.json` | `npm install` | | `Cargo.toml` | `cargo build` | | `requirements.txt` | `pip install -r requirements.txt` | | `go.mod` | `go mod download` | | `Gemfile` | `bundle install` | | `pyproject.toml` | `pip install -e .` | ### Step 4: Verify Clean Baseline ```bash # Run tests to establish baseline <test-command> # Verify all pass before starting work ``` ### Step 5: Report ``` Worktree created at: .worktrees/feature/<name> Branch: feature/<name> Test baseline: X tests passing Ready for development. ``` ## When to Use Worktrees - Feature development (always) - Bug fixes (if multi-file) - Experiments (always — easy to discard) - Refactoring (always — easy to compare before/after) ## When NOT to Use - Single-file documentation changes - Config tweaks - Commit message fixes ## Cleanup Worktrees are cleaned up by `finishing-a-development-branch`: ```bash git worktree remove .worktrees/feature/<name> git branch -d feature/<name> # only after merge ``` ## Rationalization Table | Excuse | Reality | |--------|---------| | "Just a quick change, no branch needed" | Quick changes break things too. Isolate. | | "Setting up worktree takes too long" | 30 seconds of setup vs hours of untangling conflicts. | | "I'll create a branch later" | Later never comes. Start isolated. | | "Main branch is fine for experiments" | Experiments on main = accidental commits = broken main. |
Related Skills
Using Archon — The Gatekeeper
> **Type:** Meta-process (always active)
YAML Prompt Library
> Store reusable AI prompts as YAML files with structured messages, variables, and test data for version-controlled prompt engineering.
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
Writing Plans — TDD-Sized Task Breakdown
> **Type:** Rigid process (follow structure exactly)
wireframing
Wireframing patterns including layout grids, content blocks, responsive breakpoints, and page layout patterns for landing pages, dashboards, and forms. Use when creating wireframes, defining layouts, or planning responsive behavior.
windows-registry-editor
Expert Windows Registry editor and optimizer via PowerShell. Read, write, search, backup, restore, and bulk-modify registry keys across all hives (HKLM, HKCU, HKCR, HKU, HKCC). Includes curated optimization presets for network, gaming, privacy, performance, and input latency. Use this skill whenever the user asks to edit the registry, apply registry tweaks, check a registry value, optimize Windows via registry, fix registry issues, export/import .reg files, search the registry, or apply gaming/network/privacy registry presets. Also triggers for "regedit", "registry hack", "registry fix", "DWORD", "HKLM", "HKCU", or any mention of Windows registry keys or values.
windows-network-optimizer
Diagnose, optimize, and verify Windows 11 network and system performance via PowerShell. Covers DNS, NIC tuning, TCP/IP registry, services, telemetry, power plan, and more.
windows-error-debugger
Diagnose, debug, and fix Windows crashes, BSODs, driver failures, and system errors via PowerShell. Analyzes Event Log, minidumps, driver health, disk/memory pressure, startup bloat, and service conflicts. Builds a growing knowledge base of resolved issues per machine. Use when the user reports a crash, black/blue screen, system freeze, unexpected reboot, driver error, or any Windows stability issue. Also triggers for "BSOD", "blue screen", "black screen", "crash", "system error", "bugcheck", "minidump", "driver failure", "unexpected shutdown", "paging file too small", "system hang", "Windows froze", "PC crashed", "kernel error", or any mention of Windows Event Log errors.
White-Label Config
> Transform any application into a customizable, self-hostable product with typed configuration, feature flags, and runtime env overrides.
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
web-design-guidelines
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
Vitest Unit Patterns
> Design fast, isolated unit tests that validate business logic without network, database, or browser dependencies using Vitest.