finishing-a-development-branch
Skill11 starsChanged 3 months agoMITView on GitHub
Use when implementation is complete, tests pass, and you need to decide the integration path. Also use when asked to prepare a branch for release: 'update changelog', 'bump version', 'bump patch version', 'make sure changelog is correct', 'make sure version is correct'. Triggers: 'done with this branch', 'ready to merge', 'ship it', 'wrap this up', 'how should I integrate this', 'what next after implementation'. NOT for: PR creation mechanics (use creating-issues-and-pull-requests) or deciding whether to merge (use finishing-a-development-branch first).
We split this skill into the rules it gives an agent
17 rules. 0 are common, 14 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 172 edited versions we read keep these.
14
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
- could be automatic: a setting could enforce it
- Distinctive: line 18
Tests Gate Everything: - Never present options until tests pass.
- Very specific: line 46
Check context for autonomous mode indicators: "Mode: AUTONOMOUS", "autonomous mode", or post_impl preference.
- Distinctive: line 72
When HEAD changes (new commits, rebases, amends), re-evaluate and actively delete stale entries.
- Distinctive: line 74
Test: "Does this comment make sense to someone reading the code for the first time, with no knowledge of prior implementation?" If no, …
- Distinctive: line 82
When the user says "update changelog", "bump version", "make sure version is correct", or any variation, treat it as prepare this branch …
- Distinctive: line 88
Use Keep a Changelog format with the project's existing categories (Added, Changed, Fixed, etc.).
- Very specific: line 89
If bumping the version, entries go under the new version heading (e.g., ## [1.2.3] - YYYY-MM-DD).
- Distinctive: line 90
If the project does not have a CHANGELOG.md, check the project's AGENTS.md for changelog conventions before creating one.
- Distinctive: line 95
If not bumped, infer the level from the branch diff:
- Distinctive: line 99
If you cannot confidently infer the level, ask the user.
- Distinctive: line 100
If you infer major, confirm with the user before applying (unless in autonomous mode).
- Very specific: line 110
Before any push or PR, run the embarrassment sweep over the branch diff (git diff $(git merge-base HEAD <target>)...HEAD).
- Distinctive: line 136
Do tests pass on current branch?
- Distinctive: line 155
STOP. Do not proceed to Step 2.
- Distinctive: line 165
If the command fails or is ambiguous, ask: "This branch split from main - is that correct?"
- Distinctive: line 183
Don't add explanation: - keep options concise.
- Distinctive: line 235
IF ANY unchecked: STOP and fix.
“Common” is measured: kept by at least 6 in 10 of the 172 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
Finishing a Development Branch
<ROLE>
Release Engineer. Your reputation depends on clean integrations that never break main or lose work. A merge that breaks the build is a public failure. A discard without confirmation is unforgivable.
</ROLE>Announce: "Using finishing-a-development-branch skill to complete this work."
Invariant Principles
- Tests Gate Everything - Never present options until tests pass. Never merge without verifying tests on merged result.
- Structured Choice Over Open Questions - Present exactly 5 options, never "what should I do?"
- Destruction Requires Proof - Option 5 (Discard) demands typed "discard" confirmation. No shortcuts.
- Worktree Lifecycle Matches Work State - Cleanup only for Options 1 (merged) and 5 (discarded). Keep for Options 2, 3, and 4.
Inputs
| Input | Required | Description |
| Passing test suite | Yes | Tests must pass before this skill can proceed |
| Feature branch | Yes | Current branch with completed implementation |
| Base branch | No | Branch to merge into (auto-detected if unset) |
post_impl setting | No | Autonomous mode directive (auto_pr, offer_options, stop) |
Outputs
| Output | Type | Description |
| Integration result | Action | Merge, PR, preserved branch, or discarded branch |
| PR URL | Inline | GitHub PR URL (Options 2, 3 only) |
| Worktree state | State | Removed (Options 1, 5) or preserved (Options 2, 3, 4) |
Autonomous Mode
Check context for autonomous mode indicators: "Mode: AUTONOMOUS", "autonomous mode", or post_impl preference.
post_impl value | Behavior |
auto_pr | Skip Step 3, execute Option 2 directly |
offer_options | Present options normally |
stop | Skip Step 3, report completion without action |
| (unset in autonomous) | Default to Option 2. Log: "Autonomous mode: defaulting to PR creation" |
<CRITICAL>
**Circuit breakers (always pause):**
- Tests failing - NEVER proceed
- Option 5 (Discard) selected - ALWAYS require typed confirmation, never auto-execute
</CRITICAL>Branch-Relative Documentation
<CRITICAL>
Changelogs, PR titles, PR descriptions, commit messages, and code comments describe the delta between current branch HEAD and the merge base with the target branch. Nothing else exists. The only reality is `git diff $(git merge-base HEAD <target>)...HEAD`.
</CRITICAL>Required behavior:
- Derive all changelog/PR/commit content from the merge base diff at time of writing.
- When HEAD changes (new commits, rebases, amends), re-evaluate and actively delete stale entries. Never accumulate entries session-by-session.
- Code comments describe the present. Git describes the past. No "changed from X to Y", "previously did Z", "refactored from old approach", "CRITICAL FIX: now does X instead of Y".
- Test: "Does this comment make sense to someone reading the code for the first time, with no knowledge of prior implementation?" If no, delete it.
The rare exception: A comment may reference external historical facts that explain non-obvious constraints (e.g., "SQLite < 3.35 doesn't support RETURNING"). Reframe as a present-tense constraint, not a change narrative.
Release Prep: Changelog and Version
When the user says "update changelog", "bump version", "make sure version is correct", or any variation, treat it as prepare this branch for release. Always do both changelog and version together.
Changelog
- Compute the branch diff:
git diff $(git merge-base HEAD <target>)...HEAD - Derive entries from that diff. Each logical user-facing change gets one entry.
- Use Keep a Changelog format with the project's existing categories (Added, Changed, Fixed, etc.).
- If bumping the version, entries go under the new version heading (e.g.,
## [1.2.3] - YYYY-MM-DD). If not bumping, entries go under[Unreleased]. - If the project does not have a CHANGELOG.md, check the project's AGENTS.md for changelog conventions before creating one.
Version Bump
- Compare the version in
pyproject.toml(or the project's version file) againstorigin/main(or the merge target). If already bumped, trust it. - If not bumped, infer the level from the branch diff:
- Major: Breaking changes to public API
- Minor: New features, new public API surface
- Patch: Bug fixes, documentation, internal refactors
- If you cannot confidently infer the level, ask the user.
- If you infer major, confirm with the user before applying (unless in autonomous mode).
"Make sure X is correct"
"Make sure changelog is correct" and "make sure version is correct" mean the same as "update changelog" and "bump version". Derive from the branch diff, fix what is wrong, add what is missing.
The Embarrassment Sweep
Before any push or PR, run the embarrassment sweep over the branch diff
(git diff $(git merge-base HEAD <target>)...HEAD). It is the named pre-PR
diff-hygiene pass: catch the things that are embarrassing to ship, separate
from whether the code's claims are true. Each point is scoped to what the
branch introduced, not pre-existing repo state.
- Debug leftovers —
print/console.log/debugger/ breakpoints the branch added. - Stray work markers — branch-introduced
TODO/FIXME/XXX/HACKpromising work that does not exist. - Commented-out code — dead blocks the branch left behind instead of deleting.
- Accidental inclusions — editor swap files,
.DS_Store, build artifacts, and unrelated files swept into commits. - AI-attribution violations —
Co-Authored-By, "Generated with", or bot signatures in commits or PR text. - Issue-ref violations —
#Nreferences that auto-link in commits or PR text. - Out-of-scope paths — files touched that the feature has no business touching; unflagged ride-alongs.
- Repo-specific consistency — this repo's conventions: version bump present, changelog entry added, generated mirrors regenerated and in sync.
Any finding is a blocker: fix it (or, for an intentional ride-along, flag it explicitly to the operator) before pushing or opening the PR.
The Process
Step 1: Verify Tests
<analysis>
Before presenting options:
- Do tests pass on current branch?
- What is the base branch?
- Am I in a worktree?
</analysis># Run project's test suite
npm test / cargo test / pytest / go test ./...If tests fail:
Tests failing (<N> failures). Must fix before completing:
[Show failures]
Cannot proceed with merge/PR until tests pass.STOP. Do not proceed to Step 2.
If tests pass: Continue to Step 2.
Step 2: Determine Base Branch
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/nullIf the command fails or is ambiguous, ask: "This branch split from main - is that correct?"
Step 3: Present Options
Present exactly these 5 options:
Implementation complete. What would you like to do?
1. Merge back to <base-branch> locally
2. Push and create a Pull Request
3. Push, create a PR, and do the PR dance (iterative CI + bot review until merge-ready)
4. Keep the branch as-is (I'll handle it later)
5. Discard this work
Which option?Don't add explanation - keep options concise.
Step 4: Execute Choice
Dispatch subagent with command: finish-branch-execute
Provide context: chosen option number, feature branch name, base branch name, worktree path (if applicable).
Step 5: Cleanup Worktree
Dispatch subagent with command: finish-branch-cleanup
Provide context: chosen option number, worktree path. Note: Options 2, 3, and 4 skip cleanup entirely.
Quick Reference
| Option | Merge | Push | Keep Worktree | Cleanup Branch |
| 1. Merge locally | Yes | - | - | Yes |
| 2. Create PR | - | Yes | Yes | - |
| 3. Create PR + PR dance | - | Yes | Yes | - |
| 4. Keep as-is | - | - | Yes | - |
| 5. Discard | - | - | - | Yes (force) |
Anti-Patterns
<FORBIDDEN>
- Proceeding with failing tests
- Merging without post-merge test verification
- Deleting branches without typed "discard" confirmation
- Force-pushing without explicit user request
- Presenting open-ended questions instead of structured options
- Cleaning up worktrees for Options 2, 3, or 4
- Accepting partial confirmation for Option 5
</FORBIDDEN>Self-Check
<reflection>
Before completing:
- [ ] Tests pass on current branch
- [ ] Tests pass after merge (Option 1 only)
- [ ] User explicitly selected one of the 5 options
- [ ] Typed "discard" received (Option 5 only)
- [ ] Worktree cleaned only for Options 1 or 5IF ANY unchecked: STOP and fix.
</reflection>
Integration
Called by:
- executing-plans (Step 5) - After all batches complete
- executing-plans --mode subagent (Step 7) - After all tasks complete in subagent mode
Pairs with:
- using-git-worktrees - Cleans up worktree created by that skill
<FINAL_EMPHASIS> You are a Release Engineer. Clean integrations that never break main and never lose work without confirmation are your entire reputation. A test-gated, confirmation-gated, option-structured handoff is the only acceptable delivery. Anything less is negligence. </FINAL_EMPHASIS>
Other versions187 projects use a version of this.
Word for word · 0
None found.
Edited · 97
- farm-fe/farm★ 5.6k14% same
- coco-research/coco★ 79721% same
- koaning/wigglystuff★ 45514% same
- derHaken/SuperAntigravity★ 43925% same
- Ibrahim-3d/conductor-orchestrator-superpowers★ 38119% same
- Ibrahim-3d/orchestrator-supaconductor★ 37819% same
- totvs/engpro-advpl-tlpp-skills★ 16626% same
- haojing8312/WorkClaw★ 14126% same
- ARounder-183/HiFiShifter★ 9326% same
- coctostan/pi-superpowers★ 7124% same
87 more not listed
Wrote their own version · 90
- obra/superpowers★ 305ksame name
- jnMetaCode/superpowers-zh★ 8.4ksame name
- openai/plugins★ 7.4ksame name
- microsoft/FluidFramework★ 5ksame name
- GanyuanRan/Aegis★ 1.4ksame name
- pcvelz/superpowers★ 1.3ksame name
- LayneChai/superpowers-dsh★ 135same name
- The-AIOS/aios★ 93same name
- shibit-net/xuanji-community★ 90same name
- withzombies/hyperpowers★ 80same name
80 more not listed
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.
Used alongsideProjects with it also use chinese-code-review, chinese-commit-conventions and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
GEd520Skillchinese-code-review
中文 review 沟通参考——话术模板、分级标注(必须修复/建议修改/仅供参考)、国内团队常见反模式应对。仅在用户显式 /chinese-code-review 时调用,不要根据上下文自动触发。
Also in 7 projects that use this
GEd520Skillchinese-commit-conventions
中文 commit 与 changelog 配置参考——Conventional Commits 中文适配、commitlint/husky/commitizen 中文模板、conventional-changelog 中文配置。仅在用户显式 /chinese-commit-conventions 时调用,不要根据上下文自动触发。
Also in 7 projects that use this
obraSkilldiagnosing-superpowers
Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.
Also in 13 projects that use this
10CGSkillworkflow-runner
十步循环轻量编排器,协调 Phase Skills 执行,支持灵活组合。
Also in 7 projects that use this
kntismSkillcondition-based-waiting
Use when tests have race conditions, timing dependencies, or inconsistent pass/fail behavior - replaces arbitrary timeouts with condition polling to wait for actual state changes, eliminating flaky tests from timing guesses
Also in 3 projects that use this
MicrosoftSkilltesting-anti-patterns
Use when writing or changing tests, adding mocks, or tempted to add test-only methods to production code - prevents testing mock behavior, production pollution with test-only methods, and mocking without understanding dependencies
Also in 4 projects that use this
- +2 more from GEd520
In this repository65 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- documentation-updatesSkill
- spellbook-auditingSkill
- advanced-code-reviewSkill
- adversarial-reviewSkill
- agent2agentSkill
- analyzing-domainsSkill
- analyzing-skill-usageSkill
- assembling-contextSkill
- async-await-patternsSkill
- auditing-green-mirageSkill
- autonomous-modeSkill
- branch-contextSkill
- code-reviewSkill
- creating-issues-and-pull-requestsSkill
- debuggingSkill
- dedupeSkill
- deep-researchSkill
- dehallucinationSkill
- design-explorationSkill
- designing-workflowsSkill
- developSkill
- devils-advocateSkill
- dispatching-parallel-agentsSkill
- distilling-prsSkill
- documenting-projectsSkill
- documenting-toolsSkill
- emotional-stakesSkill
- enforcing-code-qualitySkill
- estimating-ticketsSkill
- executing-plansSkill
- fact-checkingSkill
- finding-dead-codeSkill
- fixing-testsSkill
- fractal-thinkingSkill
- gathering-requirementsSkill
- generating-diagramsSkill
- instruction-engineeringSkill
- isolated-testingSkill
- managing-artifactsSkill
- merging-worktreesSkill
- opportunity-awarenessSkill
- optimizing-instructionsSkill
- polish-repoSkill
- reflexionSkill
- requesting-code-reviewSkill
- resolving-merge-conflictsSkill
- reviewing-design-docsSkill
- reviewing-impl-plansSkill
- reviewing-prsSkill
- rounding-up-worktree-sessionsSkill
- sharpening-promptsSkill
- smart-readingSkill
- test-driven-developmentSkill
- testing-strategySkill
- tooling-discoverySkill
- using-git-worktreesSkill
- using-lsp-toolsSkill
- using-skillsSkill
- The first 60 shown.
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.

