skills/worktree-manager/SKILL.md
Manage Git worktrees. Use when asked to create/switch/list/merge/remove worktrees, to keep multiple branches in parallel directories, or to clean up worktrees safely during development.
npx skillsauth add jtsang4/efficient-coding worktree-managerInstall 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.
Use Worktrunk (wt) as the single interface for Git worktree management: create/switch worktrees, list global status, merge back to the default branch, and remove worktrees safely. Prefer safe operations; never use destructive flags unless the user explicitly requests them.
wt command fails because wt is missingDo not preflight-check wt on every invocation. Instead, attempt the requested wt command. If it fails with an error like "command not found: wt" (or equivalent), then:
wt because it isn't installed. Should I install Worktrunk now (recommended)?"scripts/install_worktrunk.sh
bash <SKILL_DIR>/scripts/install_worktrunk.shwt --versionwt ... command.wt config shell installBefore wt merge / wt remove / anything with --force / -D:
git rev-parse --show-toplevelpwdgit status --porcelaingit branch --show-currentwt list (use as the global source of truth for other worktrees)Goal: "Put branch X into its own directory and switch into it."
wt switch <name>--base=@ unless the user explicitly wants a clean base).wt switch --create <name> --base=@wt list and ask which one to switch to.Notes:
wt switch does not change directories in the current shell, suggest enabling shell integration (with confirmation) via wt config shell install..config/wt.toml (notably post-create) that may copy the base worktree's working directory into a new worktree.--no-verify (e.g. wt switch --create <name> --base=@ --no-verify).Goal: "What worktrees exist and which ones are dirty/out-of-date?"
wt listGoal: "Finish this branch and get back to the default branch cleanly."
wt merge --helpwt mergeRules:
wt merge if the tree is dirty unless the user explicitly tells you to proceed and how to handle changes.Goal: "Delete a worktree directory safely without losing uncommitted work."
wt remove <name>--force (can discard untracked files depending on tool behavior)-D (force-delete an unmerged branch/worktree)wt remove --helpSee references/install.md for platform-specific notes. Use scripts/install_worktrunk.sh to install after the user confirms.
development
Use when you have a spec or requirements for a multi-step task, before touching code
development
Use when implementing any feature or bugfix, before writing implementation code
development
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
development
Use when executing implementation plans with independent tasks in the current session