finishing-a-development-branch · Finishing a Development Branch

Development-branch finisher: decides how to integrate finished work. Flow: verify tests green → detect environment (normal repo / named worktree / detached HEAD) → confirm the base branch → present options and wait for the user's choice → execute → clean up.
Options are strictly environment-bound: normal repos and named branches get "merge locally / push and open PR / keep as-is"; detached HEAD gets only "push as new branch and open PR / keep as-is" (no merge). Merged results must be re-tested before merging; discarding a branch requires the user to explicitly ask and type 'discard' to confirm.
Example invocation: "Implementation is done, tests pass — decide how to integrate."
Full brief
Positioning
finishing-a-development-branch is an integration decision-maker for development branches: it triggers only when implementation is complete and tests are green. It handles "how to integrate," not implementation.
Core capabilities
- Tests first: runs the full suite; failures are reported and everything stops — no menu.
- Environment detection: normal repo / named worktree / detached HEAD — determines the menu and cleanup.
- Base-branch confirmation: confirms the fork point before merging; merging into the wrong base is expensive to undo.
- Fixed option menus: presented verbatim, no improvisation; the integration decision belongs to the user.
- Execute the choice: merge locally (merge, then re-test the merged result — red means stop) / push and open a PR (follow repo PR conventions; worktree kept for PR feedback fixes) / keep as-is.
- Careful cleanup: worktree removal is provenance-based (only Superpowers-created worktrees get removed); never
--forcea refused removal — show the user the uncommitted files and let them choose.
Workflow
- Verify tests (stop on failure)
- Detect environment (menu + cleanup strategy)
- Confirm the base branch
- Present options verbatim, wait for the choice
- Execute (merge / push PR / keep)
- Cleanup (worktree and branch, per rules)
Inputs & outputs
| Input | Notes |
|---|---|
| Development branch | Implementation complete, tests green |
| Base branch | Asked and confirmed when unknown |
Output: integration result (merge done / PR URL / branch kept), or the discard confirmation flow.
Fit
- Feature complete and green, deciding how to merge
- Multi-branch worktree cleanup at the end of collaboration
- Team workflows needing strict merge discipline
Before you start
- Implementation complete, all tests passing.
- Know the base branch (asked when uncertain).
finishing-a-development-branch is part of the Aiglade Skill library. Invoke it from the Aiglade chat box in plain language.