Git worktree management for isolated parallel development. Handles creating, listing, switching, and cleaning up worktrees with interactive confirmations, automatic .env copying, and .gitignore management. Follows KISS principles.
Manages Git worktrees for isolated parallel development with automatic environment file handling.
npx claudepluginhub dlabs/claude-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
scripts/worktree-manager.shUnified interface for managing Git worktrees across your development workflow. Whether reviewing PRs in isolation or working on features in parallel, this skill handles all the complexity.
.worktrees/ directoryNEVER 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 ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh create feature-name
# WRONG - Never do this directly
git worktree add .worktrees/feature-name -b feature-name main
/blueprint-dev:bp:review): If NOT already on the target branch, offer worktree for isolated review/blueprint-dev:bp:build): Ask if user wants parallel worktree or live branch workcreate <branch-name> [from-branch]Creates a new worktree with the given branch name.
branch-name (required): Name for the new branch and worktreefrom-branch (optional): Base branch to create from (defaults to main)bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh create feature-login
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh create feature-auth develop
What happens:
list or lsLists all available worktrees with their branches and current status.
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh list
switch <name> or go <name>Switches to an existing worktree.
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh switch feature-login
If name not provided, lists available worktrees and prompts for selection.
copy-env [name] or env [name]Copies .env files from main repo to an existing worktree. If name is omitted and you're inside a worktree, copies to the current worktree.
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh copy-env feature-login
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh copy-env # copies to current worktree
cleanup or cleanInteractively cleans up inactive worktrees with confirmation.
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh cleanup
What happens:
/blueprint-dev:bp:review1. Check current branch
2. If ALREADY on target branch → stay there, no worktree needed
3. If DIFFERENT branch → offer worktree:
"Use worktree for isolated review? (y/n)"
- yes → call git-worktree skill to create worktree
- no → proceed with PR diff on current branch
/blueprint-dev:bp:build1. 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
# Create isolated worktree for review (copies .env files)
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh create pr-123-feature-name
cd .worktrees/pr-123-feature-name
# After review, return to main and clean up
cd ../..
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh cleanup
# Start first feature
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh create feature-login
# Start second feature
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh create feature-notifications
# List and switch between them
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh list
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh switch feature-login
The script will ask if you want to switch to it instead.
Switch out of the worktree first:
cd $(git rev-parse --show-toplevel)
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh cleanup
Copy them manually:
bash ${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/scripts/worktree-manager.sh copy-env feature-name
.worktrees/
├── feature-login/ # Worktree 1
│ ├── .git
│ ├── app/
│ └── ...
├── feature-notifications/ # Worktree 2
│ ├── .git
│ ├── app/
│ └── ...
.gitignore (updated to include .worktrees)
git worktree add for isolated environmentsActivates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill content", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins.