← ClaudeAtlas

git-finalize-prlisted

Drives an open pull request to merge-ready - CI green, every review thread answered, one outcome label. Opening it is git-open-pr; merging is git-merge-pr.
ainova-systems/intelligence-dev-packs · ★ 2 · Code & Development · score 78
Install: claude install-skill ainova-systems/intelligence-dev-packs
# Finalize the PR 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; wait reactively, never busy-poll. ## Pre-flight 1. `git branch --show-current` - abort on the default/integration/protected branch. 2. Resolve the PR: `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. 3. Latest commit: `git rev-parse HEAD`. Every check below filters runs by `headSha == HEAD`; stale runs for older commits are ignored. ## Loop 1 - CI to green 1. Probe: `gh pr checks <pr>` plus `gh run list --branch <branch> --limit 8 --json databaseId,headSha,name,status,conclusion`. 2. Decide: - all latest-SHA workflows `success` - proceed to Loop 2; - any `in_progress` / `queued` - wait, sized to the longest job's typical duration; - any latest-SHA `failure` - drill in. 3. Drill in: failed step via `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. 4. Fix smallest-correct, top-down (what happened - what changed since last green - fix or delete per the feature doc - existing primitive?). Run the relevant