finishing-a-development-branch by sickn33/antigravity-awesome-skills
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill 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. 丢弃此工作
选择哪个选项?
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
不要添加解释 - 保持选项简洁。
# 切换到基础分支
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. 丢弃 | - | - | - | ✓ (强制) |
跳过测试验证
开放式问题
自动清理工作树
丢弃时无确认
切勿:
始终:
由以下调用:
配合使用:
此技能适用于执行概述中描述的工作流或操作。
每周安装次数
248
仓库
GitHub 星标
27.6K
首次出现
Jan 19, 2026
安全审计
安装于
claude-code217
opencode201
gemini-cli200
antigravity200
cursor173
codex169
Guide completion of development work by presenting clear options and handling chosen workflow.
Core principle: Verify tests → Present options → Execute choice → Clean up.
Announce at start: "I'm using the finishing-a-development-branch skill to complete this work."
Before presenting options, verify tests pass:
# Run project's test suite
npm test / cargo test / pytest / go test ./...
If tests fail:
Tests failing (<N> failures). Must fix before completing:
[Show failures]
Cannot proceed with merge/PR until tests pass.
Stop. Don't proceed to Step 2.
If tests pass: Continue to Step 2.
# Try common base branches
git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null
Or ask: "This branch split from main - is that correct?"
Present exactly these 4 options:
Implementation complete. What would you like to do?
1. Merge back to <base-branch> locally
2. Push and create a Pull Request
3. Keep the branch as-is (I'll handle it later)
4. Discard this work
Which option?
Don't add explanation - keep options concise.
# Switch to base branch
git checkout <base-branch>
# Pull latest
git pull
# Merge feature branch
git merge <feature-branch>
# Verify tests on merged result
<test command>
# If tests pass
git branch -d <feature-branch>
Then: Cleanup worktree (Step 5)
# Push branch
git push -u origin <feature-branch>
# Create PR
gh pr create --title "<title>" --body "$(cat <<'EOF'
## Summary
<2-3 bullets of what changed>
## Test Plan
- [ ] <verification steps>
EOF
)"
Then: Cleanup worktree (Step 5)
Report: "Keeping branch . Worktree preserved at ."
Don't cleanup worktree.
Confirm first:
This will permanently delete:
- Branch <name>
- All commits: <commit-list>
- Worktree at <path>
Type 'discard' to confirm.
Wait for exact confirmation.
If confirmed:
git checkout <base-branch>
git branch -D <feature-branch>
Then: Cleanup worktree (Step 5)
For Options 1, 2, 4:
Check if in worktree:
git worktree list | grep $(git branch --show-current)
If yes:
git worktree remove <worktree-path>
For Option 3: Keep worktree.
| Option | Merge | Push | Keep Worktree | Cleanup Branch |
|---|---|---|---|---|
| 1. Merge locally | ✓ | - | - | ✓ |
| 2. Create PR | - | ✓ | ✓ | - |
| 3. Keep as-is | - | - | ✓ | - |
| 4. Discard | - | - | - | ✓ (force) |
Skipping test verification
Open-ended questions
Automatic worktree cleanup
No confirmation for discard
Never:
Always:
Called by:
Pairs with:
This skill is applicable to execute the workflow or actions described in the overview.
Weekly Installs
248
Repository
GitHub Stars
27.6K
First Seen
Jan 19, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
claude-code217
opencode201
gemini-cli200
antigravity200
cursor173
codex169
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
140,500 周安装