Agent skill · software engineering · obra

finishing-a-development-branch

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work

Why this skill is useful

Adds a detailed multi-step workflow for merging branches that includes specific commands and error handling not typically known by the AI.

What it needs

About 5k tokens when loaded. Last updated 2026-08-07. 268,212 stars on the source repository.

What this skill does

Finishing a Development Branch Overview Core principle: Verify tests → Detect environment → Present options → Execute choice → Clean up. Announce at start: "I'm using the finishing-a-development-branch skill to complete this work." Step 1: Verify Tests Run the project's full test suite (npm test / cargo test / pytest / go test ./...). If tests fail, report the failures and stop — the menu comes after a green suite: If tests pass: continue to Step 2. Step 2: Detect Environment This determines which menu to show and how cleanup works: State Menu Cleanup ------- ------ --------- GITDIR == GITCOMMON (normal repo) Standard 3 options No worktree to clean up GITDIR != GITCOMMON, named branch Standard 3 options Provenance-based (see Step 6) GITDIR != GITCOMMON, detached HEAD Reduced 2 options (no merge) Externally managed — leave in place Step 3: Determine Base Branch The base branch is whatever this work forked from — usually named in the plan, the conversation, or the branch's upstream. If it is not already known, ask: "This branch split from <your best guess> - is that correct?" Confirm before merging: merging into the wrong base is expensive to undo. Step 4: Present Options Normal repo and named-branch worktree — present exactly these 3 options: Detached HEAD — present exactly these 2 options: Present the menu exactly as written — concise, with every option coming from the list above. Discarding the work happens only in response to your human partner explicitly asking for it (see "If your human partner asks to discard the work" below). Wait for their answer; the integration decision is theirs. Step 5: Execute Choice Option 1: Merge Locally If tests fail on the merged result: stop, leave the worktree and branch in place, and investigate — nothing has been pushed, so the merge is local and recoverable. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills obra/finishing-a-development-branch

View the source on GitHub

Browse the @skills marketplace