Guide · Agent skill
How to use the Finish a Development Branch agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The finishing-a-development-branch skill is a set of written instructions that tells an AI coding agent how to wrap up a git branch once a task is finished and its tests pass. It is for developers who want the agent to handle the routine end-of-task steps while keeping the final integration decision with a human. After reading this guide you will know how to install the skill, how to ask for it in plain language, and what the agent will and will not do on its own.
Quick start
- 1Download and unzip the skill. Download the ZIP from this page and unzip it. Keep the finishing-a-development-branch folder that contains SKILL.md.
- 2Place the folder where the agent looks. Move it into ~/.claude/skills/ for all projects, or into a project's .claude/skills/ folder for one repository. Alternatively, upload it under Settings → Capabilities → Skills in the Claude apps.
- 3Check the prerequisites. Confirm the project is a git repository, has an automated test suite, and that you know the command to run it, such as npm test or pytest.
- 4Finish a task and ask in plain words. When the implementation is complete and the tests pass, tell the agent you want to finish the branch or decide how to integrate the work.
- 5Confirm the base branch. When asked, confirm the branch the work split from. Do not accept a guess you are unsure about.
- 6Choose an option from the menu. Reply with the number of the option you want: local merge, push and pull request, or keep as-is. The agent waits for this choice.
- 7Review the result. Check the merge result, pull request URL, or preserved worktree path that the agent reports before moving on.
What is an agent skill?
An agent skill is a folder containing a SKILL.md file. The file holds instructions that an AI agent reads when a request matches the skill's description. Instead of improvising the end of a task each time, the agent follows the same written routine.
This skill is taken from the obra/superpowers project, under the MIT licence. Its description reads: use when implementation is complete, all tests pass, and you need to decide how to integrate the work.
What the skill makes the agent do
The skill runs a fixed sequence: verify tests, detect the git environment, determine the base branch, present options, execute the chosen option, and clean up the workspace.
First the agent runs the project's full test suite. If any tests fail, it reports the failures and stops, so the menu only appears after a passing run. It then checks whether the work is in a normal repository, a git worktree on a named branch, or a detached HEAD, because each state offers a different menu.
The agent also confirms the base branch the work came from. If it does not already know, it asks before merging, since merging into the wrong base is hard to undo.
- Normal repo or named-branch worktree: merge back to the base branch locally, push and create a pull request, or keep the branch as-is.
- Detached HEAD: push as a new branch and create a pull request, or keep as-is. Local merge is not offered.
- Discarding work happens only if you explicitly ask for it and type the word discard to confirm.
How to install the skill
Download the ZIP file from this page and unzip it. You have two places to put the resulting folder, depending on how you want to use it.
For all your projects, unzip it into ~/.claude/skills/. For a single project, unzip it into that project's .claude/skills/ folder. You can also upload the skill in the Claude apps under Settings → Capabilities → Skills.
- Personal install: ~/.claude/skills/finishing-a-development-branch/
- Project install: .claude/skills/finishing-a-development-branch/ inside your repository
- Claude apps: Settings → Capabilities → Skills, then upload the skill
What you need before using it
The routine assumes a git repository and an automated test suite. You also need a test command the agent can run for your project. The skill's own examples use npm test, cargo test, pytest, or go test ./..., so use whichever matches your stack.
If you choose the pull request option, the agent needs either the forge's command-line tool or web access so it can create the request. Without one, the skill says the forge usually prints a creation URL when you push, and the agent can report that URL.
- git
- A working test command for the project
- Forge CLI or web access to create a pull request, only if you choose that option
How to trigger the skill with natural requests
The skill activates when your request matches its description, so you do not need to name it. Describe the situation in plain words once the code is done and the tests pass.
Examples of requests that fit:
- "The feature is done and the tests pass. Help me finish this branch."
- "Wrap up this work and decide how to get it into main."
- "Open a pull request for this branch against develop."
- "I'm done with this worktree, what are my options?"
What to expect during a run
The agent announces that it is using the skill, runs the tests, and then shows a numbered menu. Choose an option by replying with its number or describing it. The agent waits for your answer before it merges, pushes, or deletes anything.
If the merged result fails tests after a local merge, the agent stops and leaves the branch and worktree in place. If a push is rejected, the skill tells the agent to investigate rather than force-push unless you explicitly ask.
- Option 1 merges locally, re-runs tests on the merged result, then deletes the feature branch with git branch -d.
- Option 2 pushes the branch with git push -u origin and creates a pull request against the base branch. The worktree is kept so you can fix review feedback there.
- Option 3 keeps the branch and reports where the worktree is.
git push -u origin <feature-branch>Safety notes: scripts and network access
The skill runs scripts and uses the network. Its instructions include git commands that inspect and change your repository, the project's test command, and, for pull requests, git push and the forge's tooling or creation URL.
Worktree removal only applies to worktrees under .worktrees/ or worktrees/ that the skill created. Other worktrees are left to the host environment. If git refuses to remove a worktree because it has uncommitted files, the skill asks you before doing anything. It does not use --force on its own.
- Deleting a branch with force requires the typed word discard.
- The agent never force-pushes unless you explicitly request it.
- Read the menu before choosing, especially the base branch name.
Tips for getting good results
Make sure the tests you run cover the code you are integrating. The skill re-runs the suite on the tree it is about to integrate, and a passing run only proves the tree it ran on.
Confirm the base branch early in the conversation. Mentioning it when you start the task saves a question at the end.
- Name the base branch in your first message if it is not main.
- Keep worktrees you are still reviewing; the skill intentionally preserves them after a pull request.
- If you do not want the agent to delete anything, simply choose option 1 or 2 and do not type discard.
What people use it for
- Finishing a feature branch and merging it locally into main after the merged result passes tests.
- Pushing a finished branch and opening a pull request against develop, with the agent reporting the URL.
- Keeping a branch and its worktree in place while you wait for review feedback on a pull request.
- Cleaning up a temporary worktree the agent created under .worktrees/ after a successful local merge.
Frequently asked questions
How do I install the finishing-a-development-branch skill?
Download the ZIP from this page and unzip it. Put the folder in ~/.claude/skills/ to use it everywhere, or in a project's .claude/skills/ folder to use it in one repository. You can also upload it in the Claude apps under Settings → Capabilities → Skills.
What does the finishing-a-development-branch skill need to run?
It needs git and a test command for your project, such as npm test, cargo test, pytest, or go test ./.... If you want a pull request, it also needs the forge's CLI or web access to create one. The skill assumes both a git repository and automated tests exist.
Is the skill free to use, and what is its licence?
The skill comes from obra/superpowers and is licensed under MIT. This page does not list pricing, so check the source repository for any further terms.
Will the agent merge or delete my branch without asking?
No. The skill presents a menu and waits for your choice. Deleting work only happens if you explicitly ask to discard it and type the word discard to confirm.
What if my tests fail?
The agent reports the failing tests and stops. The menu is shown only after the full test suite passes. Fix the failures, then ask the agent to finish the branch again.
How does this compare with doing the merge or pull request myself?
The skill gives the agent a consistent routine that checks the git environment, confirms the base branch, re-runs tests after a local merge, and preserves worktrees with uncommitted files. If you prefer to handle these steps by hand, you do not need the skill; the source does not compare it with other tools.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
This skill suits developers who use an AI agent on git feature branches and want a consistent wrap-up routine with a human making the final merge, push, or delete decision. It is a poor fit for projects without git or automated tests, or for anyone who wants the agent to integrate or delete work without being asked.
Download the skill