git-worktree
Installation
SKILL.md
Git Worktree Manager
scripts/worktree-manager.sh creates, lists, switches and cleans up worktrees. Every worktree lands at .worktrees/<branch> under the main repository root, from any subdirectory or from inside another worktree. Nested names work: feat/x lands at .worktrees/feat/x.
Rules
- A named location or tool wins. If the user, a project instruction, or another loaded skill or config names a different location or tool, follow it and skip the script. Read the repo's
AGENTS.mdand any other project instruction file for one before you create. - Otherwise never use raw
git worktree add, a sibling directory,/tmp, or a path inside another worktree. - Refused layout. Exit 3
unsupported-layoutmeans a bare repository,core.bare, a separate git directory or a submodule. Report it and ask for a location or tool. Run rawgit worktree addonly with the user's approval. - Skip worktrees for small or read-only work. Fix a typo in place. Read a file from another branch with
git show <branch>:<path>.
Commands
SKILL_DIR="<skill directory stated when this skill loads>";
bash "$SKILL_DIR/scripts/worktree-manager.sh" <command>
A worktree's name is its path under .worktrees/, for example feat/x. Run help for the full usage.