finishing-a-development-branch
Skill19 starsChanged 2 months agoMITView on GitHub
Superpower Skill:实现完成且全部测试通过后,用于决定分支集成方式,支持本地合并、创建 PR 或保留分支等完整收尾流程。
- Commits and pushes
123 other projects use a version of this, 24 of them edited.
Adopted by
Most recently taken up by
- andreymudri/fleetmatestheir own version, first seen Oct 5, 2026
- LayneChai/superpowers-dshedited, first seen Oct 3, 2026
- HanksChen0110/skillsedited, first seen Oct 3, 2026
- JameMy0001/antigravity-skills-hubtheir own version, first seen Oct 2, 2026
- lsy041015/orchestratheir own version, first seen Oct 2, 2026
- Just-Silver/just-silver-skillsedited, first seen Sep 30, 2026
Used with
Projects with it also use testing-anti-patterns, chinese-git-workflow and 9 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.
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 5 projects that use this
MorningStar0709Skillchinese-git-workflow
Configure Git for domestic platforms and manage branching strategies suitable for Chinese teams. Use when the user asks to configure remotes, set up SSH, or manage Git workflows for Gitee, Coding, Jihu GitLab, or CNB, including requests like "配置国内 Git", "设置 Gitee 远程仓库", "推荐适合小团队的 Git 流程".
Also in 4 projects that use this
shibit-netSkillchinese-code-review
中文 review 沟通参考——话术模板、分级标注(必须修复/建议修改/仅供参考)、国内团队常见反模式应对。仅在用户显式 /chinese-code-review 时调用,不要根据上下文自动触发。
Also in 3 projects that use this
shibit-netSkillchinese-commit-conventions
中文 commit 与 changelog 配置参考——Conventional Commits 中文适配、commitlint/husky/commitizen 中文模板、conventional-changelog 中文配置。仅在用户显式 /chinese-commit-conventions 时调用,不要根据上下文自动触发。
Also in 3 projects that use this
MorningStar0709Skillworkflow-runner
Run an agency-orchestrator style YAML workflow inside the current Trae conversation by simulating or coordinating multiple roles. Use when the user provides a `.yaml` or `.yml` workflow, asks for multi-role collaboration, says things like “用多个角色一起评审这个 PRD”“多角色协作”“先生成工作流再执行”“让产品经理、架构师、QA 一起看一下”, or wants roles such as product manager, architect, reviewer, or QA to work together. Supports layered execution, role prompting, variable interpolation, document-backed inputs, and parallel steps only when the current environment has a clear subagent mapping. Do not use for ordinary implementation plans, simple code changes, or tasks already covered by `writing-plans`, `executing-plans`, `subagent-driven-development`, or single-purpose review/debug skills.
Also in 4 projects that use this
kntismSkilldefense-in-depth
Use when invalid data causes failures deep in execution, requiring validation at multiple system layers - validates at every layer data passes through to make bugs structurally impossible
Also in 3 projects that use this
- +1 more from shibit-net
Other versions123 projects use a version of this.
Word for word · 0
None found.
Edited · 24
- obra/superpowers★ 314k10% same
- jnMetaCode/superpowers-zh★ 8.3k21% same
- openai/plugins★ 7.3k10% same
- LayneChai/superpowers-dsh★ 10210% same
- shibit-net/xuanji-community★ 9313% same
- roundpilot/superpowers-antigravity★ 7010% same
- The-AIOS/aios★ 6910% same
- karim1556/skills★ 3811% same
- AkashPriyadarshii/jev-superpowers★ 3710% same
- Hassaan146/claude-skills★ 1811% same
14 more not listed
Wrote their own version · 99
- microsoft/FluidFramework★ 4.9ksame name
- GanyuanRan/Aegis★ 1.3ksame name
- coco-research/coco★ 437same name
- Ibrahim-3d/orchestrator-supaconductor★ 380same name
- totvs/engpro-advpl-tlpp-skills★ 138same name
- Houseofmvps/ultraship★ 123same name
- withzombies/hyperpowers★ 80same name
- coctostan/pi-superpowers★ 70same name
- andreaswasita/copilot-agents-dojo★ 54same name
- roman01la/skills-agents★ 48same name
89 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 repository14 other files it gives its agents.
- brainstormingSkill
- diagnosing-superpowersSkill
- dispatching-parallel-agentsSkill
- executing-plansSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- using-git-worktreesSkill
- using-superpowersSkill
- verification-before-completionSkill
- writing-plansSkill
- writing-skillsSkill
The file
Files
完成开发分支
概述
核心原则: 验证测试 → 检测环境 → 提供选项 → 执行选择 → 清理收尾。
开始时声明: “我将使用 finishing-a-development-branch 技能来完成收尾工作。”
步骤 1:验证测试
运行项目的完整测试套件(npm test / cargo test / pytest / go test ./...)。
若测试失败,报告失败信息并停止——只有测试全通过后才展示选项菜单:
测试未通过(<N> 项失败),需修复后才能完成:
[展示失败详情]若测试通过: 继续进入步骤 2。
步骤 2:检测环境
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)
# 此时仍在工作区内,立即捕获此值——步骤 5 会切换目录,
# 而后清理阶段(步骤 6)需要该值
WORKTREE_PATH=$(git rev-parse --show-toplevel)下表决定展示哪种菜单以及如何执行清理:
| 状态 | 菜单 | 清理方式 |
GIT_DIR == GIT_COMMON(普通仓库) | 标准 3 项选项 | 无需清理 worktree |
GIT_DIR != GIT_COMMON,具名分支 | 标准 3 项选项 | 按来源判定(见步骤 6) |
GIT_DIR != GIT_COMMON,游离 HEAD | 精简 2 项选项(无合并) | 由外部托管——保持原样 |
步骤 3:确定基线分支
基线分支即本次工作 fork 时的来源分支——通常在计划、对话记录或分支的上游中已注明。若尚未明确,请询问:“该分支是从 <你的最佳推测> fork 出来的,这样对吗?” 合并前务必确认:合错基线分支的回滚成本很高。
步骤 4:提供选项
普通仓库与具名分支 worktree——请严格按以下 3 项呈现:
实现已完成。接下来怎么处理?
1. 本地合并回 <base-branch>
2. 推送并创建 Pull Request
3. 保持分支现状(稍后自行处理)
请选择:游离 HEAD——请严格按以下 2 项呈现:
实现已完成。当前处于游离 HEAD(外部托管的 worktree)。
1. 以新分支推送并创建 Pull Request
2. 保持现状(稍后自行处理)
请选择:请严格按原文呈现菜单——保持简洁,所有选项均来自上表。仅当 human partner 明确要求丢弃工作时才处理丢弃流程(见下文“若 human partner 要求丢弃工作”)。等待对方答复;集成决策权归 human partner 所有。
步骤 5:执行选择
选项 1:本地合并
# 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>若合并后的测试失败:立即停止,保留 worktree 与分支并展开排查——此时尚未推送,合并仅在本地,可恢复。
合并结果测试通过后:清理 worktree(步骤 6),然后删除分支:
git branch -d <feature-branch>选项 2:推送并创建 PR
git push -u origin <feature-branch>
# From a detached HEAD, name the new branch on the remote:
# git push origin HEAD:refs/heads/<new-branch>然后针对 <base-branch> 创建 pull/merge request——优先使用代码托管平台的命令行工具,若无则使用推送后打印的创建链接——遵循仓库现有的 PR 模板与规范,并将 URL 汇报给 human partner。
保留 worktree——human partner 将在此处理 PR 反馈并继续迭代。
选项 3:保持现状
汇报:“已保留分支 <name>,worktree 保留于 <path>。”
若 human partner 要求丢弃工作
此路径仅在明确要求丢弃工作时触发,需先进行确认:
此操作将永久删除:
- 分支 <name>
- 全部提交:<commit-list>
- 位于 <path> 的 worktree
请输入 'discard' 以确认。等待该确切确认。确认后:
MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
cd "$MAIN_ROOT"然后清理 worktree(步骤 6)并强制删除分支:
git branch -D <feature-branch>步骤 6:清理 worktree
仅在选项 1 与已确认的丢弃操作中执行。 选项 2 与选项 3 始终保留 worktree。两种调用方已切换至主仓库根目录——worktree 移除必须在 worktree 外部执行——并使用步骤 2 捕获的 GIT_DIR/GIT_COMMON/WORKTREE_PATH 值(目录切换前已保存)。
若 GIT_DIR == GIT_COMMON: 普通仓库,无需清理 worktree,流程结束。
若 WORKTREE_PATH 位于 .worktrees/ 或 worktrees/ 之下: 该 worktree 由 Superpowers 创建——由我们负责清理:
git worktree remove "$WORKTREE_PATH"
git worktree prune # Self-healing: clean up any stale registrations若移除被拒绝(提示 contains modified or untracked files):说明 worktree 中存在仅存于此的未提交文件——可能是计划、笔记或临时文件。切勿自行使用 --force。向 human partner 展示涉及的文件并征询意见:
git -C "$WORKTREE_PATH" status --porcelain -uallworktree 移除被拒绝——以下文件尚未提交:
<file list>
1. 清理前提交至 <branch>
2. 移动至 <主仓库根目录>
3. 删除(不可恢复)
请选择:按选择执行,随后移除 worktree。
其他情况: 该 worktree 由宿主环境托管——保持原样。若平台提供了 worktree 退出工具,请使用它。
快速参考
| 选项 | 合并 | 推送 | 保留 Worktree | 清理分支 |
| 1. 本地合并 | 是 | - | - | 是 |
| 2. 创建 PR | - | 是 | 是 | - |
| 3. 保持现状 | - | - | 是 | - |
| 丢弃(仅在明确要求时) | - | - | - | 是(强制) |
常见借口与实际情况
| 借口 | 实际情况 |
| “本会话早些时候测试已通过” | 请在即将集成的代码树上重新运行完整测试套件,一次通过仅能证明当时的代码树。 |
| “他们显然想直接合并” | 集成方式由 human partner 决定,请呈现菜单并等待选择。 |
| “他们似乎已完成该功能——我来提议丢弃吧” | 菜单已完整,无需额外提议,仅当 human partner 明确要求丢弃时才处理。 |
| “‘好,删掉吧’也算确认” | 只有输入 discard 才视为有效确认并授权删除。 |
| “PR 已提交,worktree 就是冗余了” | PR 反馈需在该 worktree 中修复,工作落盘前应予以保留。 |
| “这个 worktree 看起来废弃了——顺手一起清理” | 仅清理位于 .worktrees/ 或 worktrees/ 下的 worktree,其余均归宿主环境所有。 |
“移除被拒——用 --force 收个尾就行” | 拒绝意味着文件仅存在于该 worktree,--force 会永久销毁它们,请向 human partner 展示并征询意见。 |
| “合并后失败大概是偶发问题” | 合并结果失败则立即中止,保留分支与 worktree 以便排查。 |
| “基线分支显然是 main” | 请确认fork 点或主动询问,合错基线的回滚成本很高。 |
| “推送被拒——强制推送就能解决” | 推送被拒说明远端已有更新,请先排查;仅在 human partner 明确要求时才执行强制推送。 |
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.

