Skip to content
Development
Skill

/finishing-a-development-branch

The terminal step of /feature and /sprint. Routed to once commit-gate has cleared, to decide the branch's fate — merge via PR, open a PR, or discard. Direct merge to the default branch is forbidden; every change lands through a PR. Under /sprint the skill auto-selects "open PR"

From plugin
codearbiter
14562 skills19 agents42 commands
Install
$ npx -y skills add arbiterForge/codeArbiter --skill finishing-a-development-branch --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/finishing-a-development-branch

Context preview

The summary Claude sees to decide when to auto-load this skill.

The terminal step of /feature and /sprint. Routed to once commit-gate has cleared, to decide the branch's fate — merge via PR, open a PR, or discard. Direct merge to the default branch is forbidden; every change lands through a PR. Under /sprint the skill auto-selects "open PR"

SKILL.md

finishing-a-development-branch.SKILL.md
name: finishing-a-development-branch
description: The terminal step of /feature and /sprint. Routed to once commit-gate has cleared, to decide the branch's fate — merge via PR, open a PR, or discard. Direct merge to the default branch is forbidden; every change lands through a PR. Under /sprint the skill auto-selects "open PR" and surfaces the merge decision to the user.

finishing-a-development-branch

The work is committed and green. Now decide where it goes. Routed to by `/feature` and `/sprint` after `commit-gate` clears — never before.

Pre-flight

Read these, or STOP and surface the gap — never guess the branch name or the default branch:

  • `{{PROJECT_DIR}}/.codearbiter/CONTEXT.md` — the default-branch name and project context.
  • The discovered authoritative spec/plan pair for the pipeline, when `/feature`

or `/sprint` produced one. Use the exact selected `.md` or `.html` plan as the yardstick for "is the work complete." Re-run the private bridge resolver `_resolve_workflow_pair` with the trusted project root and pipeline slug rather than reconstructing either path. Load `{{PLUGIN_ROOT}}/includes/artifacts.md` for HTML and obtain HTML plan state only through the installed engine `identity`, `index`, and symbol-scoped `read` operations. The finishing step must not create, convert, or consult a counterpart.

  • `{{PROJECT_DIR}}/.codearbiter/last-checkpoint` — the most recent gate results; confirms `commit-gate` cleared on this branch.
  • `{{PLUGIN_ROOT}}/includes/verification-boundary.md` — the exact-head hosted-CI evidence required before merge.

For an HTML pair, query the engine `identity` and `eligible` again after process recreation. Require `all_accepted_and_current: true` for the exact spec and plan identities, with their acceptance receipts still bound in engine state and the commit-gate proof. Finalization must not parse rendered HTML and must not consult a shadow Markdown ledger; displayed labels, status words, checkboxes, or digests cannot establish completion.

Enforce that requirement by invoking the installed bridge's `_preflight_current_acceptance` with the exact `_resolve_workflow_pair` result, repository-bound client, and engine-returned spec/plan IDs. Carry its returned identity/receipt proof into state assembly. Any refusal blocks terminal options; do not recreate the proof from the PR description, checkpoint prose, or labels.

`commit-gate` MUST have cleared on the current HEAD. If it has not, this skill does not run — return to it.

Phase 1 — State assembly · gate: BLOCK

Assemble the facts the decision needs. Nothing is presented until all are in hand:

  • **Branch** — the current branch name and its base. Confirm it is NOT the default branch; if HEAD is the default branch, STOP — there is nothing to finish and merge-to-default is forbidden.
  • **Diff summary** — files changed, insertions/deletions, and the commit list since the base. Read it, do not paraphrase from memory.
  • **Gate results** — `commit-gate` outcome and the `last-checkpoint` record. Surface any open `[NEEDS-TRIAGE]` markers left in the diff as out-of-scope findings.
  • **Plan delta** — when a plan exists, state which plan items the branch satisfied and which remain open. Open items are surfaced, not hidden.
  • **ADR source ancestry** — when `.codearbiter/decisions/adr-lifecycle.jsonl` exists, select

the merge method from the exact fetched target commit and PR head commit. Run the installed verifier: `python "{{PLUGIN_ROOT}}/hooks/adr-merge-method.py" --root "{{PROJECT_DIR}}" --base-ref <base-sha> --current-ref <head-sha> --merge-method`. It validates committed lifecycle evidence and prints `merge` if any bound source is absent from the base ancestry, otherwise `squash`. Every acceptance/evidence `source_commit` and baseline `observed_commit` must resolve and be an ancestor of the head; each is checked against the base too. The self-contained verifier reads committed ADR paths and source bytes, checks their digests and status, and enforces the exact ledger prefix. It admits no baseline newly introduced after the base; an inherited baseline is not authorization for another migration. No repository-local verifier, dirty working-tree bytes, or network fallback can substitute for this proof. ADR lifecycle proof requires Git 2.45.0+ with `--no-lazy-fetch`. The verifier enforces that flag capability and reports an upgrade prerequisite when unavailable. Missing objects block verification; neither failure triggers a retry that fetches proof implicitly. An unavailable verifier, malformed record, missing object, or source outside head ancestry blocks the offer. Never infer retention from local object availability or remote branch/PR refs. A source absent from base requires a true merge commit; squash and rebase would lose its identity. Record the exact base, head, and selected method in the PR body. If merge commits are unavailable, STOP and surface the conflict; do not change repository settings or rewrite the ledger. Revalidate immediately before a merge offer or authorized merge, and use `gh pr merge <PR> --merge --match-head-commit <head-sha>` when `merge` is required. If all sources are already in base ancestry, retain the project's usual merge convention.

Gate: branch confirmed non-default, diff summary read, gate results and plan delta in hand.

Phase 2 — Present terminal options · gate: STOP

Present exactly three terminal options with the Phase 1 state attached, then STOP for the choice:

1. **Open a PR** — push the branch and open a pull request against the default branch, then stop. The PR stays open; the merge happens later, by the user or reviewers. 2. **Merge via PR** — push the branch, open the PR, and once its current exact-head merge-readiness aggregate is green, merge it **through the PR** so the work lands on the default branch now. Missing, stale, cancelled, mismatched, or red hosted evidence blocks this option. Distinc

Read more
Ships withcodearbiter

When you can't trust yourself with your code base, trust Arbiter.

Get the whole plugin

Other skills on codearbiter.