finishing-a-development-branch
当实现完成、所有测试通过、需要决定如何集成工作时使用——通过提供合并、PR 或清理等结构化选项来引导开发工作的收尾
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
当实现完成、所有测试通过、需要决定如何集成工作时使用——通过提供合并、PR 或清理等结构化选项来引导开发工作的收尾
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
CodingHub 工具广场操作指南。当用户要求搜索/安装/发布/更新 CodingHub 工具,发帖到论坛,管理知识库,或与 CodingHub 平台交互时使用。支持双通道:MCP 优先,HTTP 直连自动降级(Python 或 Node.js CJS CLI 封装,跨平台)。
使用 CodeWiki-CN MCP 工具为代码仓库生成 Wiki 文档并管理 LLM Wiki 知识库。支持三层增强模式:codebase-memory-mcp(深度增强:Leiden 聚类、Cypher 查询、跨服务追踪、复杂度分析)、CodeGraph(调用图增强)、或纯 CodeWiki(标准模式)。自动检测可用 MCP 服务器并选择最优模式。当用户要求生成 Wiki、代码文档、仓库文档、分析代码库结构时使用。
UI/UX design intelligence with searchable database
Use when building and packaging the project for deployment, including frontend build, backend JAR, and creating distribution zip
中文 review 沟通参考——话术模板、分级标注(必须修复/建议修改/仅供参考)、国内团队常见反模式应对。仅在用户显式 /chinese-code-review 时调用,不要根据上下文自动触发。
中文 commit 与 changelog 配置参考——Conventional Commits 中文适配、commitlint/husky/commitizen 中文模板、conventional-changelog 中文配置。仅在用户显式 /chinese-commit-conventions 时调用,不要根据上下文自动触发。
| name | finishing-a-development-branch |
| description | 当实现完成、所有测试通过、需要决定如何集成工作时使用——通过提供合并、PR 或清理等结构化选项来引导开发工作的收尾 |
| allowed-tools | null |
| disable | true |
通过提供清晰的选项并执行所选工作流来引导开发工作的收尾。
核心原则: 验证测试 → 展示选项 → 执行选择 → 清理。
开始时宣布: "我正在使用 finishing-a-development-branch 技能来完成这项工作。"
在展示选项之前,验证测试通过:
# 运行项目的测试套件
npm test / cargo test / pytest / go test ./...
如果测试失败:
测试失败(<N> 个失败)。必须先修复才能继续:
[显示失败信息]
在测试通过之前无法进行合并/PR。
停止。不要继续到步骤 2。
如果测试通过: 继续步骤 2。
# 尝试常见的基础分支
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
或者询问:"这个分支是从 main 分出来的——对吗?"
展示以下 4 个选项:
实现已完成。你想怎么做?
1. 在本地合并回 <base-branch>
2. 推送并创建 Pull Request
3. 保持分支现状(我稍后处理)
4. 丢弃这项工作
选哪个?
不要添加解释 - 保持选项简洁。
# 切换到基础分支
git checkout <base-branch>
# 拉取最新代码
git pull
# 合并功能分支
git merge <feature-branch>
# 在合并结果上验证测试
<test command>
# 如果测试通过
git branch -d <feature-branch>
然后:清理工作树(步骤 5)
# 推送分支
git push -u origin <feature-branch>
# 创建 PR
gh pr create --title "<title>" --body "$(cat <<'EOF'
## 摘要
<2-3 条变更要点>
## 测试计划
- [ ] <验证步骤>
EOF
)"
然后:清理工作树(步骤 5)
报告:"保留分支 。工作树保留在 。"
不要清理工作树。
先确认:
这将永久删除:
- 分支 <name>
- 所有提交:<commit-list>
- 工作树 <path>
输入 'discard' 确认。
等待精确的确认。
确认后:
git checkout <base-branch>
git branch -D <feature-branch>
然后:清理工作树(步骤 5)
对于选项 1、2、4:
检查是否在工作树中:
git worktree list | grep $(git branch --show-current)
如果是:
git worktree remove <worktree-path>
对于选项 3: 保留工作树。
| 选项 | 合并 | 推送 | 保留工作树 | 清理分支 |
|---|---|---|---|---|
| 1. 本地合并 | ✓ | - | - | ✓ |
| 2. 创建 PR | - | ✓ | ✓ | - |
| 3. 保持现状 | - | - | ✓ | - |
| 4. 丢弃 | - | - | - | ✓(强制) |
跳过测试验证
开放式问题
自动清理工作树
丢弃时不确认
绝不:
始终:
被以下技能调用:
配合使用: