Kipt

Finishing a development branch skill: merge, PR or keep, safely

The finishing a development branch skill from Superpowers verifies tests, then lets you merge, open a PR or keep the branch, and cleans up worktrees safely.

By the Kipt team · Updated 24 October 2026

Source: obra/superpowers · Maintainer: community: Jesse Vincent (Prime Radiant) · License: MIT · Checked: 24 October 2026

What is the finishing a development branch skill?

The finishing a development branch skill tells a coding agent how to wrap up a feature branch: run the full test suite, confirm the base branch, ask you whether to merge locally, push and open a pull request, or keep the branch as it is, then clean up only what it is safe to clean. The integration decision stays with you.

It ships in Superpowers, the open source skill library by Jesse Vincent and Prime Radiant, where the README lists it as "Merge/PR decision workflow". The skill's description reads: "Use when implementation is complete, all tests pass, and you need to decide how to integrate the work".

As of 24 October 2026, its skills.sh page listed about 214,400 installs (snapshot, 24 October 2026).

What does it do?

The folder holds one file, SKILL.md. In the Superpowers workflow it is the last step and "Activates when tasks complete." It is the bookend to the using git worktrees skill, which sets up the isolated branch at the start.

The agent announces it is using the skill, then works through six steps.

  1. Verify tests. Run the project's full suite (npm test, cargo test, pytest or go test ./...). If anything fails, report the failures and stop. The menu only comes after a green suite.
  2. Detect the environment. Compare git rev-parse --git-dir with --git-common-dir to tell a normal repo from a worktree, and record the worktree path before changing directory.
  3. Determine the base branch. Usually named in the plan or the branch's upstream. If not, the agent asks: "This branch split from - is that correct?"
  4. Present options. Exactly three in a normal repo or a named-branch worktree, two on a detached HEAD.
  5. Execute the choice.
  6. Clean up the workspace, only where the skill owns it.

The menu

On a normal repo or a worktree on a named branch, the agent offers:

1. Merge back to <base-branch> locally
2. Push and create a Pull Request
3. Keep the branch as-is (I'll handle it later)

On a detached HEAD, which the skill treats as an externally managed workspace, merging isn't offered. The two choices are to push as a new branch and open a pull request, or keep it as it is.

The skill's quick reference table shows what each choice does:

Option Merge Push Keep worktree Delete branch
1. Merge locally Yes No No Yes
2. Create PR No Yes Yes No
3. Keep as-is No No Yes No
Discard (explicit request only) No No No Yes, forced

How each option runs

Merge locally. The agent moves to the main repo root, checks out the base branch, pulls, merges the feature branch and runs the tests again on the merged result. Only if that is green does it remove the worktree and delete the branch with git branch -d. If the merged result fails, it stops and leaves everything in place.

Push and create a PR. The agent pushes with git push -u origin <feature-branch>, then opens the pull request against the base branch with the forge's CLI or the URL the push prints, following the repo's PR template if there is one. The worktree stays, because PR feedback gets fixed there. GitHub's docs cover creating a pull request if you want to do that step yourself.

Keep as-is. The agent reports the branch name and worktree path and does nothing else.

The safety rules

Most of the skill is about not destroying work:

  • Discard is never offered. It happens only if you ask to throw the work away. The agent lists the branch, the commits and the worktree that will be deleted, and waits for you to type discard. "Yeah, get rid of it" doesn't count.
  • Only its own worktrees. Cleanup touches worktrees under .worktrees/ or worktrees/. Anything else belongs to the host environment and is left alone.
  • No forced removal. If git worktree remove refuses because of modified or untracked files, the agent shows them and asks whether to commit them, move them to the main repo or delete them.
  • No force push. A rejected push means the remote moved; the agent investigates and force-pushes only on your explicit request.
  • Fresh test run. "A green run only proves the tree it ran on," so tests from earlier in the session don't count.

The README's one-line summary still lists discard among the options; the SKILL.md as of 24 October 2026 keeps it off the menu and treats it as a request-only path.

How do you install the finishing a development branch skill?

As part of Superpowers in Claude Code. The README's install section installs it from Anthropic's official marketplace:

/plugin install superpowers@claude-plugins-official

Plugin skills are namespaced as /plugin-name:skill-name per the Claude Code skills docs, so it appears as /superpowers:finishing-a-development-branch. The README also documents the obra/superpowers-marketplace route and installs for Codex, Cursor, Gemini CLI and other agents.

Just this skill. The skills CLI copies one folder, as shown on the skills.sh page:

npx skills add https://github.com/obra/superpowers --skill finishing-a-development-branch

Add -g to install for all projects. The folder lands in .claude/skills/finishing-a-development-branch/ in your project, or ~/.claude/skills/finishing-a-development-branch/ with -g. Codex and Cursor read the same SKILL.md format; see Codex skills and Cursor skills.

The skill works alone in any git repo. It pairs naturally with using git worktrees, since the worktrees that skill creates under .worktrees/ or worktrees/ are the ones this skill knows it may remove.

How do you use it?

In the full plugin it runs when the plan's tasks are done. Standalone, tell the agent the work is finished, or name the skill.

Example prompts (suggestions, not quotes from the repo):

  • The feature is done. Use finishing-a-development-branch to wrap up.
  • /superpowers:finishing-a-development-branch This branch came from develop, not main.
  • Tests pass on feature/csv-export. Push it and open a PR using our template.
  • I want to throw away the experiment-cache branch and its worktree.

Requirements: git, a test command the agent can run, and for option 2 a configured remote. Opening the PR from the terminal works best with your forge's CLI, such as GitHub's gh, installed and signed in. No packages or scripts come with the skill.

Tips and limits

From the files, not from testing:

  • It always asks. "Integration is your human partner's decision." Expect a menu even when the answer seems obvious.
  • Base branch is confirmed, not assumed. Name it in your prompt to skip the question.
  • Merges are local. Option 1 merges and runs tests but doesn't push the base branch.
  • Commands run with your git credentials. Pushes and PRs act as you, so check the target before you pick option 2.
  • Audits. As of 24 October 2026, skills.sh showed Pass from Gen Agent Trust Hub, Socket and Snyk.
  • License. Superpowers is MIT, so you can copy and edit the skill if you keep the copyright notice.

If you work with worktrees in Claude Code without Superpowers, the Claude Code worktree docs cover the built-in --worktree flag and cleanup.

Save it in your Kipt library

In Kipt, open Skills and paste the skill's GitHub folder link into the import box. Kipt reads the SKILL.md; for a repo with many skills it shows a list to pick from, so you can take using-git-worktrees in the same import. You can also drop the folder or a .zip. Your skills live in your own private GitHub repo and install into Claude Code or Codex with one command:

npx skills add https://github.com/<you>/<repo>.git --all -g

Kipt is not affiliated with Jesse Vincent, Prime Radiant or Superpowers.

Similar skills

Questions

What is the finishing-a-development-branch skill?

finishing-a-development-branch is an Agent Skill in Jesse Vincent's Superpowers library (obra/superpowers, MIT License). When implementation is done, it has the coding agent run the full test suite, work out whether it is in a normal repo or a worktree, confirm the base branch, and offer three choices: merge locally, push and open a pull request, or keep the branch.

How do I install the finishing a development branch skill?

Install the full Superpowers plugin in Claude Code with /plugin install superpowers@claude-plugins-official, or copy only this skill with npx skills add https://github.com/obra/superpowers --skill finishing-a-development-branch. The plugin version shows up as /superpowers:finishing-a-development-branch.

Can the skill delete my branch?

Only in two cases. After a successful local merge with passing tests, it deletes the merged branch with git branch -d. Discarding unmerged work happens only when you explicitly ask, and the agent waits until you type the word discard before force-deleting the branch and its commits.

Does it remove git worktrees?

Only worktrees under .worktrees/ or worktrees/, which Superpowers creates, and only after a local merge or a confirmed discard. Opening a PR or keeping the branch leaves the worktree in place. If git refuses removal because of uncommitted files, the agent shows you the files and asks instead of forcing it.

What happens if tests fail?

The skill stops. If the suite fails before the menu, the agent reports the failures and doesn't offer any options. If tests fail after a local merge, it leaves the branch and worktree in place and investigates, since nothing has been pushed.

More in Skill directory

All guides

Keep your prompts and skills in one place, in your own GitHub. Install every skill with one command.

Get started

Kipt is an independent product, not affiliated with or endorsed by Anthropic, OpenAI, Cursor or GitHub. Claude, ChatGPT, Codex, Cursor and GitHub are trademarks of their owners.