一键导入
git-finalize-pr
Drive the current branch's PR to merge-ready: CI green and every review comment handled, ending with an outcome label
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Drive the current branch's PR to merge-ready: CI green and every review comment handled, ending with an outcome label
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Verify, review, and push pending work as one milestone commit
After owner accept: guard-checked squash-merge of the current branch's PR, base sync and branch cleanup
Open a pull request for the current branch against its target, using the repo template
Triage PR review comments: fix, discuss, or decline with reason - every thread answered
Cut a release: version, changelog, tag, and release object — policy-driven across trunk/gitflow and tag-only/full
Audit documentation claims against the code; report drift vs violation
| name | git-finalize-pr |
| description | Drive the current branch's PR to merge-ready: CI green and every review comment handled, ending with an outcome label |
| argument-hint | [pr number] |
Take a freshly pushed PR through fix/push iterations until CI is green AND every review comment is answered - merge-ready for the owner's accept. Runs autonomously across CI rounds (typically 15-30 min each); wait reactively, never busy-poll.
git branch --show-current - abort on the default/integration/protected branch.gh pr list --head <branch> --state open --json number --jq '.[0].number'. An explicit argument must match this branch's PR. None - open it with git-open-pr first, then retry.git rev-parse HEAD. Every check below filters runs by headSha == HEAD; stale runs for older commits are ignored.gh pr checks <pr> plus gh run list --branch <branch> --limit 8 --json databaseId,headSha,name,status,conclusion.success - proceed to Loop 2;in_progress / queued - wait, sized to the longest job's typical duration;failure - drill in.gh run view <run_id> --json jobs --jq '.jobs[] | select(.conclusion == "failure")'; log via gh run view --job <job_id> --log (fallback gh api repos/{owner}/{repo}/actions/jobs/<job_id>/logs while sibling jobs still run). Find the root-cause file:line; read it and the surrounding code.dev-run-tests) before pushing. Batch multi-file fixes into one commit so concurrency cancels prior runs cleanly.reviewThreads(first: 100) { nodes { id isResolved comments(first: 1) { nodes { path line body author { login } } } } }; plus gh pr view <pr> --json reviews,comments.git-review-pr-comments: fix / discuss / decline-with-reason; reply to every thread.Exactly one label, then report (PR URL, label, what needs the owner):
ai:ready-to-merge - green, comments drained, mergeable: MERGEABLE;ai:manual - needs an owner decision (state precisely which);ai:failed - cannot reach green (state the blocking failure and what was tried).gh pr checks <pr> all green on HEAD; zero unresolved threads; exactly one ai:* label on the PR.git-merge-pr after the owner accepts.mergeable: CONFLICTING - git-resolve-conflicts, then back into Loop 1.