finishing-a-development-branch

The close-out step: once implementation is complete, decide how to integrate the work. “Verify tests → detect environment → present options → execute choice → clean up.”

The flow is deliberately structured to avoid open-ended “what next?” prompts: verify tests pass first (stop if not) → detect the workspace (normal repo / named-branch worktree / detached HEAD) → determine the base branch → present exactly four options — (1) merge locally, (2) push and open a PR → artifact-pull-request, (3) keep the branch as-is, (4) discard (requires a typed “discard” confirmation) → execute, then clean up the worktree only for merge/discard (a PR keeps it alive for iteration). A quick-reference table and a Common-Mistakes list encode the git ordering hazards (merge before removing the worktree; cd to main root before git worktree remove; only clean up worktrees you created). pattern-trunk-based-development.

It is the finalize/close-out cluster’s Superpowers member — gsd-shipaddy-shippingce-commit-push-prgstack-shipopenspec-archive — each closing an iteration but finalizing different things. Superpowers’ distinctive flavor is the decision menu itself: it doesn’t assume ship-to-prod, it asks (merge vs PR vs keep vs discard) and handles worktree cleanup per choice. Like GSD/OpenSpec it stops at PR/merge — no deploy step.

See Also