skills/finish-branch/SKILL.md
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.
npx skillsauth add shousper/claude-kit finish-branchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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 /commit
After committing:
# Push branch
git push -u origin <feature-branch>
# Create draft PR
# REQUIRED SUB-SKILL: Use kit:create-pr
Invoke 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:
development
Enforces project-specific coding conventions by loading language standards before writing code. Use when about to write, edit, modify, or generate Go, Rust, Python, Tailwind CSS, or HCL (Terraform/OpenTofu) files. Loads once per language per session and overrides default style with project conventions. DO NOT TRIGGER for languages other than Go, Rust, Python, Tailwind CSS, or HCL (Terraform/OpenTofu).
development
Creates, edits, and tests Claude skill files (SKILL.md) using TDD methodology with baseline pressure testing and rationalization defense. Use when writing a new skill, modifying an existing skill, optimizing a skill description for discovery (CSO), testing whether a skill triggers correctly, or structuring skill documentation. Enforces RED-GREEN-REFACTOR for process documentation.
development
Creates detailed, bite-sized implementation plans with TDD structure, exact file paths, complete code, and test commands. Use when you have a spec, requirements, design doc, or feature request and need to plan before coding — especially for multi-step tasks, large features, or when handing off to another session. DO NOT TRIGGER when asked to write code directly or fix a simple bug.
testing
Removes git worktrees safely, cleans up associated branches, and pulls latest mainline after removal. Use when finished with a worktree, done with a branch, cleaning up after a merge or PR, abandoning work in a worktree, or when "git worktree list" shows stale entries. Checks for uncommitted changes, verifies no open PRs before branch deletion, and handles force-removal of locked worktrees.