finishing-a-development-branch
Finishing a Development Branch
Overview
Guide completion of development work by presenting clear options and handling chosen workflow.
Core principle: Verify tests -> Present options -> Execute choice -> Clean up.
Announce at start: "I'm using the finishing-a-development-branch skill to complete this work."
The Process
Step 1: Verify Tests
Run project's test suite using scripts/run-tests for auto-detection. If tests fail: show failures, stop — cannot proceed until tests pass. If tests pass: continue.
Step 2: Determine Base Branch
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
Step 3: Present Options
Present exactly these 4 options:
Implementation complete. What would you like to do?
1. Merge back to <base-branch> locally
2. Push and create a 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.
Step 4: Execute Choice
See references/option-details.md for detailed execution steps for each option.
Common Mistakes
| Mistake | Fix |
|---|---|
| Skipping test verification | Always verify tests before offering options |
| Open-ended questions | Present exactly 4 structured options |
| Automatic worktree cleanup | Only cleanup for Options 1 and 4 |
| No confirmation for discard | Require typed "discard" confirmation |
Red Flags
Never: Proceed with failing tests, merge without verifying tests on result, delete work without confirmation, force-push without explicit request.
Always: Verify tests first, present exactly 4 options, get typed confirmation for Option 4, clean up worktree for Options 1 & 4 only.
Integration
Called by: plan-execution Pairs with: using-git-worktrees (cleans up worktree created by that skill)
More from hjewkes/agent-skills
self-improve
Use when a session produced reusable insights, when the user says "learn from this", "remember this", or "improve yourself", or after completing a complex task where patterns were discovered
65md-render
Use when asked to render, preview, or view a markdown file in the browser. Triggers on "render markdown", "preview this", "show me this document", "open in browser".
21code-review
Unified code review system — dispatches the right review agents for the situation. Use when reviewing code for quality, bugs, compliance, or before merging.
17skills-management
Use when creating, finding, installing, reviewing, or managing Claude Code skills — covers skill authoring, discovery, conventions, and lifecycle management
14github-pr
GitHub PR workflow — creating PRs, posting automated review comments, managing PR feedback cycles. Use when code is reviewed and ready for GitHub.
14buildkite
Buildkite CI/CD integration. Use when the user needs to check build status, trigger builds, read build logs, debug failures, manage pipelines, or any Buildkite workflow. Triggers include "buildkite", "build", "pipeline", "CI", "deploy", "build log", "build failed".
14