finishing-a-development-branch
Skill8.3k starsChanged 2 months agoMITView on GitHub
当实现完成、所有测试通过、需要决定如何集成这份工作时使用
- Commits and pushes
123 other projects use a version of this, 4 of them edited.
Trending
Quiet since September.thin dataabout the whole repository
Most recently taken up by
- andreymudri/fleetmatestheir own version, first seen Oct 5, 2026
- LayneChai/superpowers-dshtheir own version, first seen Oct 3, 2026
- HanksChen0110/skillstheir own version, 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
- Wenaixi/dsh-superpoweredited, first seen Oct 1, 2026
Who's talking about jnMetaCode/superpowers-zh
- obra/superpowers“Community Chinese (zh-CN) edition: superpowers-zh”GitHub · Mar 20, 2026 · 17 reactions
- sudosubin/agents.nix“agent-skills.github.jnmetacode.superpowers-zh: init at 5.1.0”GitHub · Sep 28, 2026
- jnMetaCode/agency-agents-zh“[Feature] 是否应该提供英文原文,感觉skill原文只是规则定义,不需要你翻译啊”GitHub · May 19, 2026
- xiaolai/nlpm“Audit candidate: jnMetaCode/superpowers-zh”GitHub · Apr 18, 2026
- ProSkillsMD/proskills“[SUBMISSION] superpowers-zh”GitHub · Apr 13, 2026
The biggest 5 of 6 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 6
Talked about on GitHub (6 times).
On GitHub · 6
- Mar 20, 2026Community Chinese (zh-CN) edition: superpowers-zh — obra/superpowers17 reactions · 4 comments
- Sep 28, 2026agent-skills.github.jnmetacode.superpowers-zh: init at 5.1.0 — sudosubin/agents.nix0 reactions
- May 19, 2026[Feature] 是否应该提供英文原文,感觉skill原文只是规则定义,不需要你翻译啊 — jnMetaCode/agency-agents-zh0 reactions · 2 comments
- Apr 18, 2026Audit candidate: jnMetaCode/superpowers-zh — xiaolai/nlpm0 reactions · 3 comments
- Apr 13, 2026[SUBMISSION] superpowers-zh — ProSkillsMD/proskills0 reactions
1 more on GitHub
- Apr 1, 2026[SUBMISSION] superpowers-zh — ProSkillsMD/proskills0 reactions · 2 comments
Used with
Projects with it also use testing-anti-patterns, defense-in-depth and 4 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
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
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
bkootazSkillartifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.
Also in 4 projects that use this
ArogyaReddySkillchangelog-generator
Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.
Also in 5 projects that use this
- +1 more from microsoft
Other versions123 projects use a version of this.
Word for word · 0
None found.
Edited · 4
- shibit-net/xuanji-community★ 9325% same
- Wenaixi/dsh-superpower★ 1920% same
- jnlk-cn/superpowers-cn★ 922% same
- rzx007/Vykor★ 299% same
Wrote their own version · 119
- obra/superpowers★ 314ksame name
- openai/plugins★ 7.3ksame name
- 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
- LayneChai/superpowers-dsh★ 102same name
- withzombies/hyperpowers★ 80same name
109 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 repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- brainstormingSkill
- chinese-code-reviewSkill
- chinese-commit-conventionsSkill
- chinese-documentationSkill
- chinese-git-workflowSkill
- diagnosing-superpowersSkill
- dispatching-parallel-agentsSkill
- executing-plansSkill
- mcp-builderSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- using-git-worktreesSkill
- using-superpowersSkill
- verification-before-completionSkill
- workflow-runnerSkill
- 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:确定基础分支
基础分支就是这份工作从哪儿分出来的那个——通常在计划里、对话里,或者分支的 upstream 里已经写明了。如果还不知道,就问:"这个分支是从 <你的最佳猜测> 分出来的,对吗?"合并之前先确认:合并到错误的基础分支,代价很高。
步骤 4:展示选项
普通仓库和命名分支 worktree——精确展示这 3 个选项:
实现已完成。你想怎么做?
1. 本地合并回 <base-branch>
2. 推送并创建 Pull Request
3. 保留分支不动(我稍后自己处理)
选哪个?分离 HEAD——精确展示这 2 个选项:
实现已完成。你当前处于分离 HEAD(由外部管理的工作区)。
1. 作为新分支推送并创建 Pull Request
2. 保持原样(我稍后自己处理)
选哪个?照原文展示菜单——简洁,每个选项都来自上面的列表。丢弃工作只在你的人类伙伴明确提出时才发生(见下方"如果你的人类伙伴要求丢弃这份工作")。等他们回答;集成与否是他们的决定。
步骤 5:执行选择
选项 1:本地合并
# 切到主仓库根目录,保证 CWD 安全
MAIN_ROOT=$(git -C "$(git rev-parse --git-common-dir)/.." rev-parse --show-toplevel)
cd "$MAIN_ROOT"
# 先合并 —— 在删除任何东西之前先验证合并成功
git checkout <base-branch>
git pull
git merge <feature-branch>
# 在合并结果上验证测试
<测试命令>如果测试在合并结果上失败:停下,把 worktree 和分支原地留着,去排查——什么都还没推送,所以这次合并是本地的、可恢复的。
一旦合并结果全绿:清理 worktree(步骤 6),然后删除分支:
git branch -d <feature-branch>选项 2:推送并创建 PR
git push -u origin <feature-branch>
# 从分离 HEAD 出发时,在远端指定新分支名:
# git push origin HEAD:refs/heads/<new-branch>然后用代码托管平台(forge)的工具针对 <base-branch> 创建 pull/merge request——有 CLI 就用它,没有就用推送时大多数平台会打印出来的创建 URL——遵循仓库里已有的 PR 模板与约定(如果有),并把 URL 报告给你的人类伙伴。
保留 worktree——你的人类伙伴要在那里根据 PR 反馈继续迭代。
选项 3:保持原样
报告:"保留分支 <name>。工作树保留在 <path>。"
如果你的人类伙伴要求丢弃这份工作
这条路只作为对"明确要求把工作扔掉"的响应而存在。 先确认:
这将永久删除:
- 分支 <name>
- 所有 commit:<commit 列表>
- 位于 <path> 的工作树
输入 '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:清理工作区
只对选项 1 和已确认的丢弃执行。 选项 2 和 3 始终保留 worktree。两个调用方都已经切到主仓库根目录了——移除 worktree 必须从 worktree 外面执行——因此这里使用步骤 2 里捕获的 GIT_DIR / GIT_COMMON / WORKTREE_PATH,也就是那次目录切换之前的值。
⚠️ 不要在这里重新计算这些值。 此刻
git rev-parse --show-toplevel返回的是主仓库根目录,不是 worktree 路径 —— 溯源判断会永远匹配不上,清理会静默空转,随后分支删除还会因为 worktree 仍挂着而失败。
如果 GIT_DIR == GIT_COMMON: 普通仓库,无 worktree 可清理。结束。
如果 WORKTREE_PATH 在 .worktrees/ 或 worktrees/ 之下: 这是 Superpowers 创建的 worktree——我们负责清理:
git worktree remove "$WORKTREE_PATH"
git worktree prune # 自愈:清理任何过期的注册记录如果删除被拒绝(contains modified or untracked files):这个 worktree 里存着别处都不存在的文件 —— 未提交的计划、笔记或草稿。绝不要自作主张加 --force。 把利害关系摆给你的人类伙伴看,然后问他:
git -C "$WORKTREE_PATH" status --porcelain -uallworktree 删除被拒绝 —— 这些文件从未被提交:
<文件列表>
1. 先把它们提交到 <branch>,再做清理
2. 把它们移到 <主仓库根目录>
3. 删掉它们(不可恢复)
选哪个?按他选的做完,再删除 worktree。
否则: 这个工作区归宿主环境所有——原地别动。如果你的平台提供了工作区退出工具,用它。
快速参考
| 选项 | 合并 | 推送 | 保留工作树 | 清理分支 |
| 1. 本地合并 | 是 | - | - | 是 |
| 2. 创建 PR | - | 是 | 是 | - |
| 3. 保持原样 | - | - | 是 | - |
| 丢弃(仅在明确要求时) | - | - | - | 是(强制) |
常见的合理化借口
| 借口 | 现实 |
| "测试这个会话早先通过过" | 在你即将集成的那棵树上跑测试套件。一次绿色运行只能证明它当时跑的那棵树。 |
| "他们显然是想合并的" | 集成是你人类伙伴的决定。把菜单摆出来,然后等。 |
| "他们看起来对这个功能收工了——我提议丢弃吧" | 菜单就是原文那样,不多不少。丢弃只在你的人类伙伴用明确的话提出时才发生。 |
| "'嗯,删掉吧'算确认了" | 只有输入 discard 这个词才授权删除。 |
| "PR 已经开了,worktree 现在是碍事的垃圾" | PR 反馈要在那个 worktree 里修。它得留到工作落地为止。 |
| "另外那个 worktree 看着像过期的——我顺手也清了" | 只清理 .worktrees/ 或 worktrees/ 之下的 worktree。其余的都属于宿主环境。 |
| "合并结果的失败大概是偶发的" | 合并结果失败会让一切停下。在你排查期间,分支和 worktree 原地不动。 |
| "基础分支明显就是 main" | 确认分叉点,或者直接问。合并到错误的基础分支,代价很高。 |
| "推送被拒了——force-push 一下就好" | 推送被拒意味着远端动过了。去排查;只有在你人类伙伴明确要求时才 force-push。 |
"删除被拒绝了 —— 加 --force 只是把清理做完而已" | 被拒绝恰恰说明有文件只存在于那个 worktree 里。--force 会不可恢复地删掉它们。先问你的人类伙伴。 |
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.

