Agent skill · Workflow & Productivity

finishing-a-development-branch

当实现完成、所有测试通过、需要决定如何集成工作时使用——通过提供合并、PR 或清理等结构化选项来引导开发工作的收尾

jnMetaCodegithub.com/jnMetaCodeGitHub ↗
claude-codecursorMIT
Install
npx skills add jnMetaCode/superpowers-zh --skill finishing-a-development-branch --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 4 KB
Bundled scripts: none
Version: 1.0.0
Path: skills/finishing-a-development-branch/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 7,457 · +159 this week
Language: JavaScript
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 完成开发分支 ## 概述 通过提供清晰的选项并执行所选工作流来引导开发工作的收尾。 **核心原则:** 验证测试 → 检测环境 → 展示选项 → 执行选择 → 清理。 **开始时宣布:** "我正在使用 finishing-a-development-branch 技能来完成这项工作。" ## 流程 ### 步骤 1:验证测试 **在展示选项之前,验证测试通过:** ```bash # 运行项目的测试套件 npm test / cargo test / pytest / go test ./... ``` **如果测试失败:** ``` 测试失败(<N> 个失败)。必须先修复才能继续: [显示失败信息] 在测试通过之前无法进行合并/PR。 ``` 停止。不要继续到步骤 2。 **如果测试通过:** 继续步骤 2。 ### 步骤 2:检测环境 **在展示选项之前,先确定工作区状态:** ```bash 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`(普通仓库) | 标准 4 个选项 | 无 worktree 可清理 | | `GIT_DIR != GIT_COMMON`,命名分支 | 标准 4 个选项 | 按来源判断(见步骤 6) | | `GIT_DIR != GIT_COMMON`,分离 HEAD | 收敛 3 个选项(无合并) | 无清理(由外部管理) | ### 步骤 3:确定基础分支 ```bash # 尝试常见的基础分支 git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null ``` 或者询问:"这个分支是从 main 分出来的——对吗?" ### 步骤 4:展示选项 **普通仓库和命名分支 worktree —— 准确展示以下 4 个选项:** ``` 实现已完成。你想怎么做? 1. 在本地合并回 <base-branch> 2. 推送并创建 Pull Request 3. 保持分支现状(我稍后处理) 4. 丢弃这项工作 选哪个? ``` **分离 HEAD —— 准确展示以下 3 个选项:** ``` 实现已完成。你在分离 HEAD 上(由外部管理的工作区)。 1. 作为新分支推送并创建 Pull Request 2. 保持现状(我稍后处

What's inside
Steps it walks through
  1. 概述
  2. 流程
  3. 步骤 1:验证测试
  4. 步骤 2:检测环境
  5. 步骤 3:确定基础分支
  6. 步骤 4:展示选项
  7. 步骤 5:执行选择
  8. 步骤 6:清理工作区
  9. 快速参考
  10. 常见错误
  11. 红线
  12. 集成
Commands it runs
npm test / cargo test / pytest / go test ./...
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
cd "$MAIN_ROOT"
git checkout <base-branch>
git pull
git merge <feature-branch>
git branch -d <feature-branch>
git push -u origin <feature-branch>
gh pr create --title "<title>" --body "$(cat <<'EOF'
git branch -D <feature-branch>
More from superpowers-zh
All skills →
About this skill
What does the finishing-a-development-branch skill do?

当实现完成、所有测试通过、需要决定如何集成工作时使用——通过提供合并、PR 或清理等结构化选项来引导开发工作的收尾

How do I install it?

Run `npx skills add jnMetaCode/superpowers-zh --skill finishing-a-development-branch --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From jnMetaCode/superpowers-zh, a repository with 7,457 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going