This skill should be used when the user wants to manage Git worktrees - creating worktrees from local or remote branches, listing active worktrees with details, deleting worktrees, or switching between worktrees. Ideal for working on multiple branches simultaneously without stashing changes.
/plugin marketplace add NikiforovAll/claude-code-rules/plugin install handbook-sounds@cc-handbookThis skill inherits all available tools. When active, it can use any tool Claude has access to.
This skill provides comprehensive Git worktree management capabilities, enabling work on multiple branches simultaneously in isolated directories. Worktrees eliminate the need for stashing when switching contexts and are ideal for parallel development, quick bug fixes, and code reviews.
Use this skill when the user wants to:
Location Strategy: Sibling directory pattern
../<project>-<branch>~/dev/myproject, worktree at ~/dev/myproject-feature-xNaming Convention: <project>-<branch>
basename "$(git rev-parse --show-toplevel)"myproject-feature-auth, myapp-bugfix-loginHybrid Mode: Accepts arguments when provided, prompts when missing
Usage patterns:
# Interactive menu
User: "Manage my worktrees"
User: "Create a worktree"
# Direct with arguments
User: "Create worktree from remote branch feature-x"
User: "List all worktrees"
User: "Delete worktree for branch hotfix-123"
Purpose: Show all active worktrees with detailed information
What to display:
Implementation:
# Get project name
project=$(basename "$(git rev-parse --show-toplevel)")
# List worktrees with details
git worktree list -v
Output format:
Git Worktrees for myproject:
1. /Users/dev/myproject (main)
abc1234 Initial commit
[CURRENT]
2. /Users/dev/myproject-feature-x (feature-x)
def5678 Add authentication logic
3. /Users/dev/myproject-hotfix (hotfix-123)
789abcd Fix login bug
Purpose: Fetch and create a worktree from a remote branch
Steps:
project=$(basename "$(git rev-parse --show-toplevel)")origin/feature-x → feature-x)git fetch origin <branch-name>../<project>-<branch-name>git worktree add ../<project>-<branch-name> origin/<branch-name>Error handling:
Success output:
✓ Created worktree for remote branch 'feature-x'
Location: /Users/dev/myproject-feature-x
Branch: feature-x (tracking origin/feature-x)
To switch to this worktree:
cd ../myproject-feature-x
To start working:
cd ../myproject-feature-x && code .
Purpose: Create a worktree from an existing local branch
Steps:
git rev-parse --verify <branch-name>git worktree add ../<project>-<branch-name> <branch-name>Error handling:
Purpose: Create a worktree with a brand new branch
Parameters needed:
Steps:
git worktree add -b <new-branch> ../<project>-<new-branch> <base-branch>Success output:
✓ Created new worktree with branch 'experiment-auth'
Location: /Users/dev/myproject-experiment-auth
Branch: experiment-auth (based on main)
To switch to this worktree:
cd ../myproject-experiment-auth
Purpose: Remove a worktree and show prune command
Steps:
git worktree remove <path> or manually rm -rf <path>Output:
✓ Removed worktree at /Users/dev/myproject-feature-x
To clean up metadata, run:
git worktree prune
Purpose: Clean up worktree metadata
Steps:
git worktree pruneOutput:
✓ Pruned stale worktree metadata
Run 'git worktree list' to see remaining worktrees.
Purpose: Show easy navigation to worktrees
Implementation:
Output:
Available worktrees:
1. main (current)
cd /Users/dev/myproject
2. feature-x
cd /Users/dev/myproject-feature-x
3. hotfix-123
cd /Users/dev/myproject-hotfix
When invoked without arguments:
Show menu:
Git Worktree Management
1. List all worktrees
2. Create from remote branch
3. Create from local branch
4. Create new branch
5. Delete worktree
6. Prune metadata
7. Switch between worktrees
Prompt for selection
For create operations, prompt for required info (branch name, base branch, etc.)
Execute operation
Show results with clear next steps
When arguments are provided, parse intent:
Before any operation:
git rev-parse --git-dirThis skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.