name: wt-finish description: Squash, rebase, fast-forward into the default branch, then remove the worktree allowed-tools: Bash(wt merge:), Bash(wt list:), Bash(git status:), Bash(git branch:)
Context
- Current branch: !
git branch --show-current - Working tree: !
git status --short
Your task
Finish the current feature branch locally using wt merge.
- Verify we're on a feature branch (not the default branch). If we're on the default branch, stop and tell the user there's nothing to merge.
- If the working tree has uncommitted changes, report them and ask the user
whether to include them (
wt mergewill stage+commit by default) or bail. - Run
wt merge. This squashes commits since the branch point, rebases onto the default branch, fast-forwards the default branch, and removes the worktree. The shell will land back at the repo root. - Report the resulting commit sha on the default branch and stop.