Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - presents structured options for merge, PR, or cleanup; adapted for OpenClaw git workflow without worktrees
通过清晰的选项指导完成开发工作:验证测试 → 展示选项 → 执行选择 → 清理。
开始时宣布: "我正在用 finishing-a-development-branch 技能完成这项工作。"
Superpowers 原版使用 git worktree 做隔离工作区,结束时清理 worktree。OpenClaw 环境下:
展示选项前,验证测试通过:
# 运行项目测试套件
npm test / pytest / cargo test / go test ./...
如果测试失败:
测试失败(<N> 个失败)。必须修复才能继续:
[显示失败]
测试通过前不能继续 merge/PR。
停止。不要继续到步骤 2。
如果测试通过: 继续步骤 2。
# 尝试常见基准分支
git merge-base HEAD main
git merge-base HEAD master
或问:"这个分支从 main 分叉——正确吗?"
展示这 4 个选项:
实现完成。你想做什么?
1. Merge 回本地 <base-branch>
2. Push 并创建 Pull Request
3. 保留分支(稍后处理)
4. 丢弃这个工作
哪个选项?
不要加解释——保持选项简洁。
# 切换到基准分支
git checkout <base-branch>
# Pull 最新
git pull
# Merge 特性分支
git merge <feature-branch>
# 验证合并后测试
<test command>
# 如果测试通过
git branch -d <feature-branch>
# Push 分支
git push -u origin <feature-branch>
# 创建 PR
gh pr create --title "<title>" --body "..."
# 或手动创建并提供 URL
报告:保留分支 <name>。工作区保持在 <path>。
不要做额外清理。
先确认:
这将永久删除:
- 分支 <name>
- 所有 commits:<commit-list>
输入 'discard' 确认。
等精确确认。
如果确认:
git checkout <base-branch>
git branch -D <feature-branch>
| 选项 | Merge | Push | 保留分支 | 清理 |
|---|---|---|---|---|
| 1. 本地 merge | ✅ | - | - | ✅ |
| 2. 创建 PR | - | ✅ | ✅ | - |
| 3. 保留 | - | - | ✅ | - |
| 4. 丢弃 | - | - | - | ✅(强制) |
跳过测试验证
开放式问题
选项 4 无确认