skills/finishing-a-development-branch/SKILL.md
Presents merge, PR, or cleanup options once tests pass.
npx skillsauth add oduffy-delphi/coordinator-claude finishing-a-development-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 → Clean up.
Announce at start: "I'm using the coordinator:finishing-a-development-branch skill to complete this work."
Before presenting options, check whether test evidence already covers this branch. If this session already has fast-tier or targeted-test evidence for the current diff, report it as-is and move to Step 2 — this step is not a cadence gate that reruns tests on every branch finish.
If no such evidence exists, a scoped run beats a broad one: prefer targeted tests covering the touched files over the fast tier. Reaching for the fast tier at all means reaching for the grant first — this skill is not on the implicit-grant ceremony list (/workday-complete, /workweek-complete, /merging-to-main), so before invoking a resolved Tier F command, check (POSIX-host form below; on a PowerShell host
use the .exe launcher through the call operator — Shape W, snippets/resolve-coordinator-bin.md)
tier-u-grant-cli check (the same session-scoped token Tier U consumes). Exit 0 = granted, resolve and run via coordinator-resolve-validation-cmd --fast (rc 0 = resolved, run the result and capture its exit code; rc 2 = no fast_test_cmd configured — skipped, not failed). Exit 1 (ungranted) halts before invoking it: ask the PM for a session grant, run under a ceremony that already holds the implicit grant, or defer and report Validation: skipped for this invocation. Either way, a full-suite gate belongs to the merge ceremony downstream (Option 1 chains into merging-to-main, which runs its own CI-gated checks) — this step never substitutes for that gate. Interim caveat: a chained fast_test_cmd (a && b, a; b, a pipe) is denied by the invocation guard today — don't reshape the command to dodge it; configure fast_test_cmd as a single command, with multi-step logic in a wrapper script instead.
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.
Try common base branches: git merge-base HEAD main, falling back to git merge-base HEAD master if that fails.
Or ask: "This branch split from main - is that correct?"
Present exactly these 3 options:
Implementation complete. What would you like to do?
1. Merge to main via PR (recommended)
2. Create a Pull Request (manual merge later)
3. Keep the branch as-is (I'll handle it later)
Which option?
Don't add explanation - keep options concise.
Why no "discard" option: when this skill fires, work is reviewed, tested, and committed. Offering discard as a peer of "merge" treats the choice as ambivalent when it isn't. If the PM genuinely wants to throw the work away, they'll say so explicitly — and that path goes through deliberate destructive-action confirmation, not a numbered menu.
No worktrees. Worktrees are forbidden — work happens on the active workstream branch. An override exists but requires explicit PM permission via the EM. If a stray worktree turns up during Step 5 below, that's debris to remove, not state to preserve.
Invoke the merging-to-main skill. This creates a PR, waits for CI checks, and merges
on success. Branch is deleted after merge.
Push the feature branch and create a PR, but do NOT merge. Use this when:
Push the feature branch (git push -u origin <feature-branch>), then create the PR with gh pr create, giving it a title and a body with ## Summary (2-3 bullets of what changed) and ## Test Plan (verification steps as a checklist) sections.
Don't merge, don't create PR. Branch stays. Use this when:
Report: "Keeping branch <name>."
Check if in a worktree by grepping git worktree list for the current branch name (git branch --show-current).
If yes, remove it (git worktree remove <worktree-path>) — regardless of which option was chosen. Worktrees are forbidden, so any found here is stray debris left behind, not deliberately preserved state.
| Option | PR | Merge | Cleanup Branch | |--------|-----|-------|---------------| | 1. Merge via PR | ✓ | ✓ (CI-gated) | ✓ | | 2. PR only | ✓ | - | - | | 3. Keep as-is | - | - | - |
Skipping test verification
Open-ended questions
Offering discard as a numbered option
Never:
Always:
Called by:
Not called by:
/workstream-complete; it deliberately does not chain into branch disposition, since that reaches the keyword-gated /merging-to-main. Branch disposition is a separate, PM-invoked decision.Pairs with:
consolidate-git — operates on sibling branches/worktrees, not the current branch; kept as a
separate skill from this one rather than folded, since a "fold thin engines into their only
caller" consolidation only applies when the two skills share one caller and scope — these don't.Extraction note: the Step 3 3-option menu is a judgment call nothing can compute — it stays hand-authored prose, not a computed op.
tools
PM-GATED. Hold this repo's PM comms channel: gate what reaches the PM, reserve the push channel, carry rulings back as records.
tools
Census/launch/teardown lifecycle for a repo's declared app under coordinator.local.md's app_session config -- complementary to the platform's built-in run skill, not competing with it.
testing
Reconcile a self-description draft against the ratified one; never auto-commits.
development
Bounded spike — fuse web research with local study to a verdict.