From ai-agents
完成开发分支的收尾工作。四选项决策树:合并、创建 PR、保留、丢弃。触发短语:"完成分支"、"合并"、"提交 PR"。
npx claudepluginhub stringke/ai-agents --plugin ai-agentsThis skill is limited to using the following tools:
```bash
Verifies tests pass before offering git branch options: local merge with re-test, GitHub PR creation, keep branch, or confirmed discard. Handles worktree cleanup per choice.
Guides finishing development branches: verifies tests pass, detects git worktree/detached HEAD state, presents merge/PR/keep/discard options, executes choice, and cleans up.
Guides Next.js Cache Components and Partial Prerendering (PPR): 'use cache' directives, cacheLife(), cacheTag(), revalidateTag() for caching, invalidation, static/dynamic optimization. Auto-activates on cacheComponents: true.
Share bugs, ideas, or general feedback.
# 当前分支
git branch --show-current
# 确认所有测试通过
# [运行项目的测试命令]
# 查看变更统计
git log main..HEAD --oneline
git diff main...HEAD --stat
如果有未提交的改动,先提交。如果测试未通过,先修复。
向用户呈现四个选项:
分支收尾选项:
1. 合并到 main — 直接合并(适合小改动、个人项目)
2. 创建 PR — 推送并创建 Pull Request(适合团队协作)
3. 保留分支 — 暂不处理(适合未完成的工作)
4. 丢弃分支 — 删除分支和所有改动(适合废弃的实验)
请选择:
git checkout main
git merge --no-ff {branch-name}
合并后确认测试通过。
git push -u origin {branch-name}
gh pr create --title "{标题}" --body "{描述}"
PR 描述应包含:
告知用户分支名和恢复方式。无需操作。
此操作不可逆,执行前必须确认。
git checkout main
git branch -D {branch-name}
如果分支关联了 worktree,清理它:
git worktree remove .worktrees/{branch-name}
分支 {branch-name} 已 [合并/PR 已创建/保留/丢弃]。
当前在 main 分支。