Finalizes a development branch by verifying tests pass, then presenting four completion options (merge locally, draft PR, keep as-is, or discard). Use when implementation is done, a feature branch is ready to ship, work needs to be merged or a PR created, or the user says "finish", "wrap up", "ship it", or "done with this branch". DO NOT TRIGGER when tests are still being written or implementation is incomplete.
94
92%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
Guide completion of development work by presenting clear options and handling chosen workflow.
Core principle: Verify tests -> Present options -> Execute choice.
Announce at start: "I'm using the finish-branch skill to complete this work."
Before presenting options, verify tests pass:
# Run project's test suite
npm test / cargo test / pytest / go test ./...If tests fail:
Tests failing (<N> failures). Must fix before completing:
[Show failures]
Cannot proceed with merge/PR until tests pass.Stop. Don't proceed to Step 2.
If tests pass: Continue to Step 2.
Identify the base branch (typically main or master). If uncertain, ask: "This branch split from main -- is that correct?"
Present exactly these 4 options:
Implementation complete. What would you like to do?
1. Merge back to <base-branch> locally
2. Commit, push, and create a draft Pull Request
3. Keep the branch as-is (I'll handle it later)
4. Discard this work
Which option?Don't add explanation — keep options concise.
Your human partner should run /commit first to commit their changes.
Staging guidance:
docs/plans/*.md (design docs, implementation plans)If in a worktree:
# Get the main working tree path
main_tree=$(git worktree list --porcelain | head -1 | sed 's/worktree //')
# Navigate to main working tree
cd "$main_tree"
# Pull latest and merge
git pull --autostash
git merge <feature-branch>
# Verify tests
<test command>If on a regular branch:
git checkout <base-branch>
git pull --autostash
git merge <feature-branch>
<test command>
git branch -d <feature-branch>Staging guidance:
docs/plans/*.md (design docs, implementation plans)git status and ask your human partnerThe user may run /commit themselves to handle staging and committing. If they say "commit staged changes", trust their staging decisions.
If your human partner hasn't committed yet:
# Show what would be staged
git status
# Let user confirm staging, or user runs /commitAfter committing:
# Push branch
git push -u origin <feature-branch>
# Create draft PR
# REQUIRED SUB-SKILL: Use kit:create-prInvoke kit:create-pr which creates a draft PR by default. If your human partner explicitly requests "ready for review", pass that intent to kit:create-pr.
Report: "Keeping branch <name>. Worktree preserved at <path>."
Confirm first:
This will permanently delete:
- Branch <name>
- All commits: <commit-list>
Type 'discard' to confirm.Wait for exact confirmation.
If confirmed:
git checkout <base-branch>
git branch -D <feature-branch>No automatic worktree cleanup for any option.
After completing the chosen option, note: "When you're ready to clean up the worktree, use kit:worktree-cleanup."
| Option | Commit | Push | Draft PR | Cleanup Worktree |
|---|---|---|---|---|
| 1. Merge locally | user | - | - | manual (later) |
| 2. Draft PR | user | yes | yes | manual (later) |
| 3. Keep as-is | - | - | - | manual (later) |
| 4. Discard | - | - | - | manual (later) |
Skipping test verification
Open-ended questions
Staging planning documents
docs/plans/*.mdAuto-cleaning worktree
No confirmation for discard
Never:
docs/plans/*.md filesAlways:
Called by:
Invokes:
Pairs with:
a01bac9
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.