skills/git-worktree/SKILL.md
This skill manages Git worktrees for isolated parallel development. It handles creating, listing, switching, and cleaning up worktrees with a simple interactive interface, following KISS principles.
npx skillsauth add marcusrbrown/systematic git-worktreeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill provides a unified interface for managing Git worktrees across your development workflow. Whether you're reviewing PRs in isolation or working on features in parallel, this skill handles all the complexity.
NEVER call git worktree add directly. Always use the worktree-manager.sh script.
The script handles critical setup that raw git commands don't:
.env, .env.local, .env.test, etc. from main repo.worktrees is in .gitignore# ✅ CORRECT - Always use the script
bash scripts/worktree-manager.sh create feature-name
# ❌ WRONG - Never do this directly
git worktree add .worktrees/feature-name -b feature-name main
Use this skill in these scenarios:
/ce:review): If NOT already on the target branch (PR branch or requested branch), offer worktree for isolated review/ce:work): Always ask if user wants parallel worktree or live branch workThe skill is automatically called from /ce:review and /ce:work commands:
# For review: offers worktree if not on PR branch
# For work: always asks - new branch or worktree?
You can also invoke the skill directly from bash:
# Create a new worktree (copies .env files automatically)
bash scripts/worktree-manager.sh create feature-login
# List all worktrees
bash scripts/worktree-manager.sh list
# Switch to a worktree
bash scripts/worktree-manager.sh switch feature-login
# Copy .env files to an existing worktree (if they weren't copied)
bash scripts/worktree-manager.sh copy-env feature-login
# Clean up completed worktrees
bash scripts/worktree-manager.sh cleanup
create <branch-name> [from-branch]Creates a new worktree with the given branch name.
Options:
branch-name (required): The name for the new branch and worktreefrom-branch (optional): Base branch to create from (defaults to main)Example:
bash scripts/worktree-manager.sh create feature-login
What happens:
main, develop, dev, trunk, staging, release/*) compare against themselves.envrc can source unchecked fileslist or lsLists all available worktrees with their branches and current status.
Example:
bash scripts/worktree-manager.sh list
Output shows:
switch <name> or go <name>Switches to an existing worktree and cd's into it.
Example:
bash scripts/worktree-manager.sh switch feature-login
Optional:
cleanup or cleanInteractively cleans up inactive worktrees with confirmation.
Example:
bash scripts/worktree-manager.sh cleanup
What happens:
# OpenCode recognizes you're not on the PR branch
# Offers: "Use worktree for isolated review? (y/n)"
# You respond: yes
# Script runs (copies .env files automatically):
bash scripts/worktree-manager.sh create pr-123-feature-name
# You're now in isolated worktree for review with all env vars
cd .worktrees/pr-123-feature-name
# After review, return to main:
cd ../..
bash scripts/worktree-manager.sh cleanup
# For first feature (copies .env files):
bash scripts/worktree-manager.sh create feature-login
# Later, start second feature (also copies .env files):
bash scripts/worktree-manager.sh create feature-notifications
# List what you have:
bash scripts/worktree-manager.sh list
# Switch between them as needed:
bash scripts/worktree-manager.sh switch feature-login
# Return to main and cleanup when done:
cd .
bash scripts/worktree-manager.sh cleanup
/ce:reviewInstead of always creating a worktree:
1. Check current branch
2. If ALREADY on target branch (PR branch or requested branch) → stay there, no worktree needed
3. If DIFFERENT branch than the review target → offer worktree:
"Use worktree for isolated review? (y/n)"
- yes → call git-worktree skill
- no → proceed with PR diff on current branch
/ce:workAlways offer choice:
1. Ask: "How do you want to work?
1. New branch on current worktree (live work)
2. Worktree (parallel work)"
2. If choice 1 → create new branch normally
3. If choice 2 → call git-worktree skill to create from main
If you see this, the script will ask if you want to switch to it instead.
Switch out of the worktree first (to main repo), then cleanup:
cd $(git rev-parse --show-toplevel)
bash scripts/worktree-manager.sh cleanup
See where you are:
bash scripts/worktree-manager.sh list
If a worktree was created without .env files (e.g., via raw git worktree add), copy them:
bash scripts/worktree-manager.sh copy-env feature-name
Navigate back to main:
cd $(git rev-parse --show-toplevel)
.worktrees/
├── feature-login/ # Worktree 1
│ ├── .git
│ ├── app/
│ └── ...
├── feature-notifications/ # Worktree 2
│ ├── .git
│ ├── app/
│ └── ...
└── ...
.gitignore (updated to include .worktrees)
git worktree add for isolated environmentstesting
Use when creating new skills, editing existing skills, or verifying skills work before deployment
development
Generate or regenerate ONBOARDING.md to help new contributors understand a codebase. Use when the user asks to 'create onboarding docs', 'generate ONBOARDING.md', 'document this project for new developers', 'write onboarding documentation', 'vonboard', 'vonboarding', 'prepare this repo for a new contributor', 'refresh the onboarding doc', or 'update ONBOARDING.md'. Also use when someone needs to onboard a new team member and wants a written artifact, or when a codebase lacks onboarding documentation and the user wants to generate one.
tools
Optimize Claude Code permissions by finding safe Bash commands from session history and auto-applying them to settings.json. Can run from any coding agent but targets Claude Code specifically. Use when experiencing permission fatigue, too many permission prompts, wanting to optimize permissions, or needing to set up allowlists. Triggers on "optimize permissions", "reduce permission prompts", "allowlist commands", "too many permission prompts", "permission fatigue", "permission setup", or complaints about clicking approve too often.
development
Use when reviewing pending todos for approval, prioritizing code review findings, or interactively categorizing work items