Finishing a Development Branch Skill logo

Finishing a Development Branch Skill

Visit

Superpowers' branch-finishing skill makes coding agents verify tests, offer merge, PR or keep, execute your choice, and clean up the worktree safely.

Share:
View alternatives

Finishing a Development Branch is a skill from Superpowers (skill source). It runs when implementation is complete and the agent needs to decide how the work gets integrated. Its sequence: verify tests, detect the environment, present options, execute the choice, clean up.

It is the last step of the Superpowers workflow and the counterpart to Using Git Worktrees.

Key Features

  • Green first: the agent runs the full test suite and stops with the failures listed if anything is red; the options menu only appears on a green suite.
  • Environment detection: git rev-parse tells a normal repo from a named-branch worktree or a detached HEAD, which changes both the menu and the cleanup.
  • Base branch check: the agent confirms which branch the work forked from before merging, since merging into the wrong base is expensive to undo.
  • Exactly three options: merge back locally, push and create a pull request, or keep the branch as is. A detached HEAD gets two (no local merge).
  • Safe merge: merge, rerun tests on the merged result, and only then remove the worktree and delete the branch.
  • Discard only on request: throwing work away requires your explicit request and typing discard after seeing exactly what will be deleted.
  • Careful cleanup: only worktrees Superpowers created are removed; git worktree remove is never forced when it finds uncommitted files.

Use Cases

  • Wrapping up a feature branch built by an agent.
  • Deciding between a local merge and a reviewed pull request.
  • Cleaning up worktrees after parallel work.

Pricing

Free and open source under the MIT license. Prime Radiant, the company behind Superpowers, sells commercial support to enterprises. The practical cost is tokens: process skills add questions, reviews and subagent runs.

Getting Started

Superpowers installs as one plugin, so this skill arrives with the rest of the library (15 skills in v6.4.1). In Claude Code run /plugin install superpowers@claude-plugins-official. Cursor uses /add-plugin superpowers, Gemini CLI uses gemini extensions install https://github.com/obra/superpowers, and the README lists commands for Codex, GitHub Copilot CLI, OpenCode, Pi and other harnesses. Skills trigger on their own; you can also ask for one by name. When the plan's tasks are done, the agent presents the menu; answer with 1, 2 or 3.

Limitation: the skill waits for your choice, so an autonomous run pauses here by design. Pull requests are created with the forge's own CLI, so you need that tool (for example gh) configured.

FAQ

Will it ever delete my work without asking?

No. Discarding needs an explicit request plus a typed confirmation.

Does it follow my repo's PR template?

The skill says to follow the repo's template and conventions when present.

Alternatives

Conclusion

A careful, reversible ending for agent-built branches. More in the skills hub.

Comments

No comments yet. Be the first to comment!