finish-branch
Skill5 starsChanged 5 months agoMITView on GitHub
Wrap up a completed development branch by verifying tests pass, detecting the workspace state, then presenting clear merge / PR / keep / discard options and executing the chosen one safely, including correct worktree and branch cleanup. Use when implementation is done, tests should be green, and you need to integrate or put away the work.
- Commits and pushes
3 other projects use a version of this.
Adopted by
Most recently taken up by
- slowernet/dietpowerstheir own version, first seen Oct 4, 2026
- Chrike/coding-agent-skillstheir own version, first seen Aug 4, 2026
- hassan-mohiddin/freeflowtheir own version, first seen Jun 27, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- hassan-mohiddin/freeflow★ 3same name
- Chrike/coding-agent-skills★ 1same name
- slowernet/dietpowers★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository89 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- site/llms-full.txtllms.txt
- site/llms.txtllms.txt
- improveSkill
- academic-writingSkill
- benchmark-reportingSkill
- bibtex-managerSkill
- citation-graphSkill
- citation-verifierSkill
- design-science-methodologySkill
- docx-thesisSkill
- experiment-reproducibilitySkill
- latex-toolkitSkill
- literature-searchSkill
- lit-review-synthesisSkill
- paper-readerSkill
- proofread-academicSkill
- research-figuresSkill
- research-methodologySkill
- research-questionSkill
- statistics-advisorSkill
- supervisor-updateSkill
- systematic-reviewSkill
- thesis-proposalSkill
- coolify-image-appSkill
- coolify-vps-baselineSkill
- deploy-verificationSkill
- express-prisma-coolify-imageSkill
- ghcr-coolify-pipelineSkill
- live-domain-cutoverSkill
- nextjs-coolify-imageSkill
- proxy-client-addressSkill
- vps-ops-toolkitSkill
- adr-writingSkill
- openapi-specSkill
- readme-writingSkill
- technical-writingSkill
- adversarial-reviewerSkill
- api-design-reviewSkill
- code-review-responseSkill
- create-agentSkill
- create-commandSkill
- create-hookSkill
- create-skillSkill
- db-migration-safetySkill
- dependency-upgradeSkill
- dockerfile-best-practicesSkill
- error-handling-patternsSkill
- executing-plansSkill
- explain-codebaseSkill
- fix-ciSkill
- github-actions-pipelineSkill
- grill-with-docsSkill
- incident-postmortemSkill
- logging-and-observabilitySkill
- parallel-agentsSkill
- performance-optimizationSkill
- refactoring-recipesSkill
- solid-principlesSkill
- systematic-debuggingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
If it's ambiguous, ask: "This branch came off main: correct?"
- Very specific: line 66
If GIT_DIR == GIT_COMMON, it's a normal repo, nothing to remove.
- Very specific: line 67
If the worktree lives under .worktrees/ or worktrees/ (i.e.
- Very specific: line 70
Always cd to the main repo root before git worktree remove, running it from inside the worktree being removed fails.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Bring a finished branch to a clean conclusion: confirm the work actually passes, figure out what kind of workspace you're in, offer the user a small set of concrete options, and carry out their choice without losing anything. The shape is always the same: verify, detect, present, execute, clean up.
Step 1: Verify tests before offering anything
Run the project's full test suite (npm test / cargo test / pytest / go test ./... as appropriate). If anything fails, stop here: show the failures and say the work can't be merged or turned into a PR until they pass. Don't present the options menu over a red suite. (The verify-completion skill is the standard: run it, read the output, then proceed.)
Step 2: Detect the workspace state
GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)GIT_DIR == GIT_COMMON: a normal repo checkout; no worktree to clean up.GIT_DIR != GIT_COMMON, on a named branch: a linked worktree; cleanup depends on who created it (Step 5).GIT_DIR != GIT_COMMON, detached HEAD, externally managed; offer the reduced menu and don't clean up.
Also determine the base branch the work split from:
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/nullIf it's ambiguous, ask: "This branch came off main: correct?"
Step 3: Present the options
For a normal repo or a named-branch worktree, present exactly these four, with no extra explanation:
Implementation complete. What would you like to do?
1. Merge back into <base> locally
2. Push and open a Pull Request
3. Keep the branch as-is (I'll handle it later)
4. Discard this work
Which option?For a detached HEAD, present the reduced three (no local merge): push as a new branch and open a PR / keep as-is / discard.
Step 4: Execute the choice
1. Merge locally. From the main repo root (not inside the worktree), check out the base, pull, and merge the feature branch. Re-run the tests on the merged result. Only after the merge succeeds and tests pass: clean up the worktree (Step 5), then git branch -d <feature>.
2. Push and open a PR. git push -u origin <feature>, then gh pr create with a short summary and a test-plan checklist. Do not clean up the worktree: the user needs it alive to act on PR feedback.
3. Keep as-is. Report the branch name and, if applicable, the preserved worktree path. No cleanup.
4. Discard. Confirm first, listing exactly what will be permanently deleted (branch, its commits, the worktree path), and require the user to type discard before doing anything. Only then, from the main repo root, clean up the worktree (Step 5) and git branch -D <feature>.
Step 5: Clean up the workspace (options 1 and 4 only)
Options 2 and 3 always preserve the worktree. For 1 and 4:
WORKTREE_PATH=$(git rev-parse --show-toplevel)- If
GIT_DIR == GIT_COMMON, it's a normal repo, nothing to remove. - If the worktree lives under
.worktrees/orworktrees/(i.e. something this workflow created), you own its cleanup. From the main repo root:git worktree remove "$WORKTREE_PATH"thengit worktree prune. - Otherwise the harness owns the workspace, don't remove it. If your platform has a workspace-exit tool, use it; otherwise leave it in place.
Always cd to the main repo root before git worktree remove, running it from inside the worktree being removed fails. And always remove the worktree before deleting the branch, since the worktree still references it.
Red flags
- Presenting options over failing tests, or merging without re-verifying tests on the merged result.
- Deleting work without a typed confirmation, or force-pushing without an explicit request.
- Cleaning up the worktree for option 2 (the user still needs it).
- Removing a worktree you didn't create, or running
git worktree removefrom inside it. - Deleting the branch before removing its worktree.
Attribution
Adapted from the finishing-a-development-branch entry of superpowers by Jesse Vincent (MIT). The structure and the core rules are theirs; the wording, the examples, and the integration with this registry's other items are this repository's.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

