Skip to content
DevOps

Finish a Branch

Verify completed work and make an explicit choice about integration and workspace cleanup.

Install with Skills CLI
npx skills add obra/superpowers --skill finishing-a-development-branch

What it does

Finishing implementation does not by itself decide whether code should be merged, pushed, or kept for review. This skill separates verification from the integration decision and handles workspace cleanup according to how the workspace was created.

What changes after install

  • Checks tests before presenting integration options.
  • Distinguishes normal branches from detached or externally managed workspaces.
  • Preserves unfinished or untracked work instead of treating cleanup as automatic.

Install

Run this command with Node.js 22.20 or later and select your agent in the Skills CLI.

Install with Skills CLI
npx skills add obra/superpowers --skill finishing-a-development-branch

Before using Finish a Branch

  • Use an existing Git working branch and know the intended base branch. The project’s tests must be runnable before selecting an integration or cleanup option.

Read the reviewed setup instructions for the selected workflow.

When to use it

  • Handing off a completed feature branch for a merge decision.
  • Finishing work in an isolated workspace without losing local artifacts.

When not to use it

  • Automatically pushing or merging because implementation appears finished.
  • Deleting a worktree that still contains changes needed for review.

Treat completion and publication as separate decisions

After implementing a feature, you may want to inspect it locally before any remote change. Provide that preference clearly. The reviewed workflow checks the test state and then distinguishes options such as local integration, a remote pull request, or leaving the branch as it is. A completed implementation is not treated as permission to publish.

The skill also examines the repository environment. A named branch in a regular checkout has different integration options from a detached workspace managed by the host. Knowing the base branch matters before a merge; assuming the wrong base can produce a misleading result.

Verify the exact state being handed off

Run the relevant project checks on the changes you intend to integrate. Earlier results may no longer apply after subsequent edits. If the checks fail, record the failure and resolve it before claiming the branch is ready. A useful handoff identifies what changed, what was checked, and what still remains local.

Remote operations require the appropriate credentials and user authorization. Installing the skill does not provide either one.

Inspect before cleanup

Worktree cleanup is especially sensitive when generated evidence, notes, or other untracked files exist only in that directory. The source explicitly accounts for cleanup being refused because files would otherwise be lost. Preserving the workspace is a valid outcome while the user reviews the work.

Use Git Worktrees for initial isolation and this skill for the final integration decision. SkillDex reviewed the upstream instructions but did not merge, push, or delete a branch as part of this listing’s verification.

FAQ

Does using this skill automatically push code?
No. The source presents integration choices and waits for the user's decision.
Can I keep the completed changes local?
Yes. Keeping the branch and workspace as they are is an explicit option in the documented workflow.