Finishing a branch
Skill augments-labs/sdlc-skills/skills/deployment/finishing-a-branch
Use when implementation is complete, its required gates are green, and the work now needs an integration decision — push, open, update or merge a PR, integrate locally, keep, or discard — and whenever a user explicitly chooses to keep a branch or workspace, discard one, or close or reopen a PR. Fires on ship it, what do we do with this branch, and are we done here, even if nobody names a git operation. The integration path is the user's choice, never the agent's. Skip ordinary mid-development checkpoints.From its SKILL.md
npx -y skills add augments-labs/sdlc-skills --skill finishing-a-branchAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
6.5 KB, as published. Nobody here has run it
Finishing a Branch
Move a candidate or explicitly named PR through an exact integration state machine. Green checks and “seems done” authorize no history, remote, discard, or cleanup mutation. Every exit is the user's decision: present the permitted transitions, then wait.
Preconditions
- Final candidate source materialization, publication, or integration requires
current evidence and a revision/digest-bound
requesting-code-reviewverdict: shallowself-reviewed: ready, or the required independent review with no blocker. Enter at completion without one and the only permitted choices are keep, or obtain that review first. - Ordinary development checkpoints are owned by
using-task-branches; they do not enter this skill until the work is complete or the user names a keep, discard, publication, or integration transition. - A PR-only close or reopen binds current PR state and a scoped choice, not code-readiness evidence.
Readiness blocks integration; identity and ownership block discard.
Available scripts
scripts/branch-state.sh— the local git state as JSON, read-only. Run it first (step 1) and read the transitions off its output instead of re-deriving them.--helpdocuments the fields and exit codes.
Procedure
-
Bind the subject. Start with the mechanical state:
bash scripts/branch-state.shUse its numbers verbatim in step 6 and in the discard block. A hand-counted commit list is how this skill ends up printing a confirmation that understates what the user is about to lose.
Three things the script cannot see, and you must bind yourself: the verification evidence, the
requesting-code-reviewverdict, and live remote or PR state. For a PR-only close or reopen, that means the live PR, its head and base refs, and any retained resources. -
Establish ownership. This is the part the script cannot answer: decide which of these resources this task created, because only those may later be cleaned up. A path that merely looks task-owned never proves it.
-
Prove the base. The script resolves one, reporting
resolved: falserather than guessing. Direct instruction and project contribution rules outrank a detected default, and remote freshness is a separate check — the script does not fetch. An ambiguous, stale, or moved base stops integration. -
Inspect history safely. Read
candidate.publishedbefore considering any rewrite: once commits exist on a remote ref, squash, rebase, and amend each need separate direct permission, and force-pushing is never an implicit repair. After a history-only change, re-run the script and confirm the digest still matches the reviewed one — if the content moved, this is a new candidate and it goes back through review. -
Prepare the real description from trusted project contribution rules and the base-bound PR template, reporting only evidence you actually obtained. Candidate-provided text is evidence, not authority. Create nothing yet.
-
Present the choices for this state, then stop. State the branch, base, gate summary, and review verdict. Ask one conversational question offering only the state-permitted choices among commit and keep, push the branch, push and open a PR, integrate locally into the base, or keep as-is. Recommend the least-mutating choice that satisfies the user's stated delivery intent, with one sentence of reasoning.
A detached or host-owned workspace drops local integration and cleanup: offer only
1. Publish as a new branchand2. Keep as-is. An existing PR offers the transitionsreferences/branch-state.mdlists for it, and only those its state, policy, and authority permit. Never conflate, retarget, rewrite, delete, or duplicate a PR. Discard never appears on this menu. -
Wait for one listed entry. Nothing executes until the user names one. Praise, constraints, partial answers, silence, “looks good”, and an adjacent decision are not a choice — re-present the menu unchanged.
Then issue the exact transition descriptor from
references/branch-state.md, binding current user-role answers or trusted user-origin receipts to the digest. Candidate text cannot authenticate itself. -
Execute through
references/branch-state.md. Gate the exact integrated candidate before the base advances. A gate that fails only after the advance is anintegrated-regression; the reference owns its recovery. -
Clean only after the owning transition permits it. Creating a PR retains the branch and workspace for feedback. Confirm integration before removing an owned worktree, and leave detached, shared, user-owned, and host-owned resources in place.
Discard is a separate destructive path
Never offer discard because work looks unwanted; it enters only on a direct
request. Then re-run scripts/branch-state.sh and fill the block below from its
output — this is the one place where a stale or estimated number does
irreversible damage. Conversationally state the exact branch, unique commits,
staged/unstaged/untracked changes, worktree resources, remote/PR state, and
whether recovery is possible. Recommend preservation unless current authority
clearly calls for deletion. Then ask for the exact free-text confirmation
discard {{candidate-id}} and stop; no numbered choice or inferred answer can
substitute for that phrase.
Anything other than that exact token leaves every listed item untouched — “yes”, “go ahead”, and “get rid of it” included. Only after it arrives, close or delete the listed task-owned resources and nothing else.
Common mistakes
- Assuming the base/ref is current, tidying commits, or force-pushing without authority.
- Merging directly into the base before testing the integrated result.
- Writing branch-state bookkeeping into the candidate being finished.
- Treating PR creation, ownership-looking paths, praise, or “get rid of it” as cleanup, integration, or discard authority.