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-parsetells 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
discardafter seeing exactly what will be deleted. - Careful cleanup: only worktrees Superpowers created are removed;
git worktree removeis 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
- Conductor: includes review and merge flow for parallel agents.
- Claude Hooks: automate checks at stop events instead.
- Verification Before Completion: the evidence rule this skill applies at the end.
Conclusion
A careful, reversible ending for agent-built branches. More in the skills hub.
Comments
No comments yet. Be the first to comment!
Related Tools
Related Insights

Anthropic Subagent: The Multi-Agent Architecture Revolution
Deep dive into Anthropic multi-agent architecture design. Learn how Subagents break through context window limitations, achieve 90% performance improvements, and real-world applications in Claude Code.
Skills + Hooks + Plugins: How Anthropic Redefined AI Coding Tool Extensibility
An in-depth analysis of Claude Code's trinity architecture of Skills, Hooks, and Plugins. Explore why this design is more advanced than GitHub Copilot and Cursor, and how it redefines AI coding tool extensibility through open standards.
Claude Code's Next Frontier: Not Code, But Your Local Obsidian Knowledge Base
Explore how Obsidian + Claude Code transforms from a knowledge management tool into your private AI assistant. Complete guide including obsidian-skills, Claudian plugin, Claudesidian template, and best practices for achieving both data privacy and AI capabilities.