finishing-a-development-branch
Skill0 starsChanged 5 days agoMITView on GitHub
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
- Commits and pushes
193 other projects use a version of this, 152 of them edited.
Adopted by
Most recently taken up by
- DemonDamon/AgenticXedited, first seen Nov 9, 2026
- chrysogonus/power-agentsedited, first seen Nov 8, 2026
- roundpilot/superpowers-antigravityedited, first seen Nov 8, 2026
- REPOZY/superpowers-optimizedtheir own version, first seen Nov 8, 2026
- lingyired/status-trioedited, first seen Nov 8, 2026
- lhbsaa/apex-unifiededited, first seen Nov 8, 2026
Used with
Projects 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.
Leodorareluctant259Skillchinese-code-review
中文代码审查规范——在保持专业严谨的同时,用符合国内团队文化的方式给出有效反馈
Also in 8 projects that use this
Leodorareluctant259Skillchinese-commit-conventions
中文 Git 提交规范 — 适配国内团队的 commit message 规范和 changelog 自动化
Also in 8 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 20 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
MicrosoftSkillroot-cause-tracing
Use when errors occur deep in execution and you need to trace back to find the original trigger - systematically traces bugs backward through call stack, adding instrumentation when needed, to identify source of invalid data or incorrect behavior
Also in 5 projects that use this
- +3 more from Leodorareluctant259
Other versions193 projects use a version of this.
Word for word · 14
- farm-fe/farm★ 5.6k100% same
- LeoKemp223/ai-light★ 39100% same
- A-Lucious/my-skills★ 5100% same
- csiddhant796-blip/claude-skills-collection★ 2100% same
- X-FRI/skills★ 2100% same
- WannaCry081/React-Claude-Workflow★ 1100% same
- afawfawffaf/my-skills★ 0100% same
- Matthewuwu/ClaudeSkills-di-Tia★ 0100% same
- pgomezurrea-eng/claude-skills★ 0100% same
- sorrywilsonh/claude-skills★ 0100% same
4 more not listed
Edited · 152
- obra/superpowers★ 314k31% same
- openai/plugins★ 7.8k31% same
- lingyired/status-trio★ 1.8k31% same
- pcvelz/superpowers★ 1.3k31% same
- DemonDamon/AgenticX★ 1k67% same
- coco-research/coco★ 79756% same
- koaning/wigglystuff★ 45598% same
- derHaken/SuperAntigravity★ 43969% same
- Ibrahim-3d/conductor-orchestrator-superpowers★ 38147% same
- Ibrahim-3d/orchestrator-supaconductor★ 37847% same
142 more not listed
Wrote their own version · 27
- jnMetaCode/superpowers-zh★ 8.4ksame name
- microsoft/FluidFramework★ 4.9ksame name
- GanyuanRan/Aegis★ 1.4ksame name
- REPOZY/superpowers-optimized★ 146same name
- withzombies/hyperpowers★ 80same name
- GEd520/legados★ 75same name
- drvoss/everything-copilot-cli★ 48same name
- 5throck/ai-workspace-standards★ 25same name
- RBraga01/a-team★ 24same name
- woxiangyangzhimao/skills★ 14same name
17 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.
In this repository97 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/skills/composition-patterns/AGENTS.mdAGENTS.md
- .claude/skills/react-best-practices/AGENTS.mdAGENTS.md
- .claude/skills/react-native-skills/AGENTS.mdAGENTS.md
- .claude/skills/react-view-transitions/AGENTS.mdAGENTS.md
- skills/06_engineering/composition-patterns/AGENTS.mdAGENTS.md
- skills/06_engineering/react-best-practices/AGENTS.mdAGENTS.md
- skills/06_engineering/react-native-skills/AGENTS.mdAGENTS.md
- skills/06_engineering/react-view-transitions/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- algorithmic-artSkill
- app-release-reviewSkill
- brainstormingSkill
- brand-guidelinesSkill
- canvas-designSkill
- claude-apiSkill
- vercel-composition-patternsSkill
- deploy-to-vercelSkill
- design-taste-frontendSkill
- dispatching-parallel-agentsSkill
- doc-coauthoringSkill
- docxSkill
- executing-plansSkill
- finishing-a-development-branchSkill
- frontend-designSkill
- humanizer-zhSkill
- internal-commsSkill
- mcp-builderSkill
- pdfSkill
- pp-ads-checkSkill
- pp-avpSkill
- pp-tranSkill
- pptxSkill
- vercel-react-best-practicesSkill
- vercel-react-native-skillsSkill
- vercel-react-view-transitionsSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- skill-creatorSkill
- slack-gif-creatorSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- theme-factorySkill
- ui-ux-pro-maxSkill
- using-git-worktreesSkill
- using-superpowersSkill
- verification-before-completionSkill
- webapp-testingSkill
- web-artifacts-builderSkill
- web-design-guidelinesSkill
- writing-plansSkill
- writing-skillsSkill
- xlsxSkill
- brainstormingSkill
- claude-apiSkill
- dispatching-parallel-agentsSkill
- doc-coauthoringSkill
- docxSkill
- executing-plansSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 1 is common, 11 are distinctive, and 2 are very specific to this project.
1
Common
Most of the 165 edited versions we read keep these.
11
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 12
Core principle: Verify tests → Detect environment → Present options → Execute choice → Clean up.
- Distinctive: line 36
Stop. Don't proceed to Step 2.
- Distinctive: line 93
Don't add explanation: - keep options concise.
- Distinctive: line 158
Wait for exact confirmation.
- Distinctive: line 207
Fix: Always verify tests before offering options
- Distinctive: line 214
Problem: Remove worktree user needs for PR iteration
- Distinctive: line 215
Fix: Only cleanup for Options 1 and 4
- Very specific: line 223
Fix: Always cd to main repo root before git worktree remove
- Very specific: line 227
Fix: Only clean up worktrees under .worktrees/, worktrees/, or ~/.config/superpowers/worktrees/
- Distinctive: line 238
Delete work without confirmation
- Distinctive: line 240
Remove a worktree before confirming merge success
- Distinctive: line 242
Run git worktree remove from inside the worktree
- Distinctive: line 245
Verify tests before offering options
- Distinctive: line 251
Run git worktree prune after removal
“Common” is measured: kept by at least 6 in 10 of the 165 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
Overview
Guide completion of development work by presenting clear options and handling chosen workflow.
Core principle: Verify tests → Detect environment → Present options → Execute choice → Clean up.
Announce at start: "I'm using the finishing-a-development-branch skill to complete this work."
The Process
Step 1: Verify Tests
Before presenting options, verify tests pass:
# 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. Don't proceed to Step 2.
If tests pass: Continue to Step 2.
Step 2: Detect Environment
Determine workspace state before presenting options:
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)This determines which menu to show and how cleanup works:
| State | Menu | Cleanup |
GIT_DIR == GIT_COMMON (normal repo) | Standard 4 options | No worktree to clean up |
GIT_DIR != GIT_COMMON, named branch | Standard 4 options | Provenance-based (see Step 6) |
GIT_DIR != GIT_COMMON, detached HEAD | Reduced 3 options (no merge) | No cleanup (externally managed) |
Step 3: Determine Base Branch
# Try common base branches
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/nullOr ask: "This branch split from main - is that correct?"
Step 4: Present Options
Normal repo and named-branch worktree — present exactly these 4 options:
Implementation complete. What would you like to do?
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)
4. Discard this work
Which option?Detached HEAD — present exactly these 3 options:
Implementation complete. You're on a detached HEAD (externally managed workspace).
1. Push as new branch and create a Pull Request
2. Keep as-is (I'll handle it later)
3. Discard this work
Which option?Don't add explanation - keep options concise.
Step 5: Execute Choice
Option 1: Merge Locally
# Get main repo root for CWD safety
MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
cd "$MAIN_ROOT"
# Merge first — verify success before removing anything
git checkout <base-branch>
git pull
git merge <feature-branch>
# Verify tests on merged result
<test command>
# Only after merge succeeds: cleanup worktree (Step 6), then delete branchThen: Cleanup worktree (Step 6), then delete branch:
git branch -d <feature-branch>Option 2: Push and Create PR
# Push branch
git push -u origin <feature-branch>
# Create PR
gh pr create --title "<title>" --body "$(cat <<'EOF'
## Summary
<2-3 bullets of what changed>
## Test Plan
- [ ] <verification steps>
EOF
)"Do NOT clean up worktree — user needs it alive to iterate on PR feedback.
Option 3: Keep As-Is
Report: "Keeping branch <name>. Worktree preserved at <path>."
Don't cleanup worktree.
Option 4: Discard
Confirm first:
This will permanently delete:
- Branch <name>
- All commits: <commit-list>
- Worktree at <path>
Type 'discard' to confirm.Wait for exact confirmation.
If confirmed:
MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
cd "$MAIN_ROOT"Then: Cleanup worktree (Step 6), then force-delete branch:
git branch -D <feature-branch>Step 6: Cleanup Workspace
Only runs for Options 1 and 4. Options 2 and 3 always preserve the worktree.
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)
WORKTREE_PATH=$(git rev-parse --show-toplevel)If GIT_DIR == GIT_COMMON: Normal repo, no worktree to clean up. Done.
If worktree path is under .worktrees/, worktrees/, or ~/.config/superpowers/worktrees/: Superpowers created this worktree — we own cleanup.
MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
cd "$MAIN_ROOT"
git worktree remove "$WORKTREE_PATH"
git worktree prune # Self-healing: clean up any stale registrationsOtherwise: The host environment (harness) owns this workspace. Do NOT remove it. If your platform provides a workspace-exit tool, use it. Otherwise, leave the workspace in place.
Quick Reference
| Option | Merge | Push | Keep Worktree | Cleanup Branch |
| 1. Merge locally | yes | - | - | yes |
| 2. Create PR | - | yes | yes | - |
| 3. Keep as-is | - | - | yes | - |
| 4. Discard | - | - | - | yes (force) |
Common Mistakes
Skipping test verification
- Problem: Merge broken code, create failing PR
- Fix: Always verify tests before offering options
Open-ended questions
- Problem: "What should I do next?" is ambiguous
- Fix: Present exactly 4 structured options (or 3 for detached HEAD)
Cleaning up worktree for Option 2
- Problem: Remove worktree user needs for PR iteration
- Fix: Only cleanup for Options 1 and 4
Deleting branch before removing worktree
- Problem:
git branch -dfails because worktree still references the branch - Fix: Merge first, remove worktree, then delete branch
Running git worktree remove from inside the worktree
- Problem: Command fails silently when CWD is inside the worktree being removed
- Fix: Always
cdto main repo root beforegit worktree remove
Cleaning up harness-owned worktrees
- Problem: Removing a worktree the harness created causes phantom state
- Fix: Only clean up worktrees under
.worktrees/,worktrees/, or~/.config/superpowers/worktrees/
No confirmation for discard
- Problem: Accidentally delete work
- Fix: Require typed "discard" confirmation
Red Flags
Never:
- Proceed with failing tests
- Merge without verifying tests on result
- Delete work without confirmation
- Force-push without explicit request
- Remove a worktree before confirming merge success
- Clean up worktrees you didn't create (provenance check)
- Run
git worktree removefrom inside the worktree
Always:
- Verify tests before offering options
- Detect environment before presenting menu
- Present exactly 4 options (or 3 for detached HEAD)
- Get typed confirmation for Option 4
- Clean up worktree for Options 1 & 4 only
cdto main repo root before worktree removal- Run
git worktree pruneafter removal
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.

