| name | kramme:git:worktree |
| description | Safely list, create, and remove git worktrees with checks for existing paths, checked-out branches, and Conductor workspace directories. Use for manual worktree operations during PR splitting or local parallel development. Not for branch cleanup, deleting gone branches, renaming branches, or bypassing Conductor workspace archival. |
| argument-hint | <list|create|remove> [options] |
| disable-model-invocation | true |
| user-invocable | true |
Worktree Helper
Guide manual git worktree operations with conservative checks.
When to Use
Use this skill when a user asks to list git worktrees, create a separate checkout for parallel local work, or remove a worktree after review. Start with list when the target path or branch state is uncertain. For Conductor-created workspaces, prefer Conductor's archive flow unless the user explicitly confirms removal outside Conductor.
Workflow
-
Parse $ARGUMENTS.
list: show worktrees and label likely Conductor paths.
create --path <path> --branch <branch> [--base <ref>]: create a new worktree and branch from the base ref. If the branch already exists, attach it only when it is not checked out elsewhere.
remove --path <path> --yes [--force] [--allow-conductor]: remove a worktree after explicit confirmation.
-
Resolve SKILL_DIR to the directory containing this SKILL.md, then run the helper from the user's current workspace:
"$SKILL_DIR/scripts/worktree-helper.sh" list
Do not cd into the skill directory; the helper intentionally inspects the current git repository. For create/remove, pass only arguments the user explicitly requested.
-
Before create, verify:
- The target path is intentional and not already populated.
- The branch is not checked out in any existing worktree (the helper script enforces this).
- The base ref resolves to a commit when provided.
- The operation does not rename any existing branch.
-
Before remove, verify:
- The user has reviewed
list output.
- The path is exactly the worktree to remove.
--yes is present only after explicit confirmation.
--allow-conductor is present only after the user confirms the Conductor workspace should be removed outside Conductor's archive flow.
--force is present only after the user accepts that uncommitted files in the worktree may be discarded.
-
Report the exact command outcome and any skipped safety check.
Safety Rules
- Do not rename the current branch.
- Do not remove Conductor workspace paths by default.
- Do not remove dirty worktrees without
--force and explicit confirmation.
- Prefer Conductor's archive workflow for Conductor-created workspaces.
- Prefer
/kramme:git:clean-gone-branches for stale local branch cleanup.