SKILL.md
Git Worktree Manager
Manage git worktrees with all worktrees stored in a sibling directory.
Directory Convention
Given a repository at /path/to/repo, worktrees are stored at:
/path/to/repo.worktrees/<branch-name>/
Modes
| Mode | Triggers | Description |
|---|---|---|
| Add | /worktree add <branch>, /worktree <branch>, /worktree #<issue> |
Create worktree |
| Status | /worktree status |
Show PR/CI status table |
| List | /worktree, /worktree list |
List and select worktrees |
| Remove | /worktree remove <branch>, /worktree rm <branch> |
Remove worktree |
| Prune | /worktree prune |
Clean stale references |
Mode Detection
When this skill is invoked, arguments follow the skill name (e.g., /worktree status passes "status" as arguments).
IMPORTANT: Before doing anything else, identify the mode from the invocation arguments:
| Arguments | Mode | Instructions |
|---|---|---|
(none) or list |
List | Read list.md |
status |
Status | Read status.md |
#<number> or just a number |
Add (from issue) | Read add.md |
add <branch> or just <branch> |
Add (branch) | Read add.md |
remove <branch> or rm <branch> |
Remove | Read remove.md |
prune |
Prune | Read prune.md |
First action: Read the appropriate .md file for your detected mode, then follow those instructions exactly.
Important Notes
- Always use the sibling directory convention (
repo.worktrees/) - Branch names can contain slashes (e.g.,
feat/new-feature) - Run commands separately - Don't use compound commands with
&&or variable assignment