mkwt
Installation
SKILL.md
Create a new git worktree and branch.
Usage
/mkwt <name> — Create a worktree with a new branch <name> from the repo's default branch (e.g. main, dev).
The <name> argument is required. If not provided, ask the user for a name.
Workflow
-
Validate the name argument is provided.
-
Detect the worktree base directory by inspecting existing worktrees:
git worktree list- Look at paths of worktrees OTHER than the main worktree (the first entry, which is the repo itself).
- If secondary worktrees exist, derive the base directory from their common parent. For example, if existing worktrees are at
/Users/foo/worktrees/meadow/branch_aand/Users/foo/worktrees/meadow/branch_b, the base is/Users/foo/worktrees/meadow/. - If NO secondary worktrees exist (only the main repo), ask the user where to create the worktree.