get-pr-ready
Installation
SKILL.md
Get PR ready
Use the given PR or the current branch's PR. Follow repository instructions and preserve local work.
- Confirm the repository and PR's head branch. Use
ghto inspect failed checks, reviews, and inline review threads, including replies and outdated threads. Paginate every collection, including comments within threads. - Fetch the PR's base branch from the base repository. If its latest tip is not an ancestor of the PR head, merge it into the PR branch and resolve conflicts, even if GitHub reports no conflicts. Follow repository history policy; do not rewrite published history without authorization.
- Verify feedback against the code and group related issues by root cause. Fix CI failures and valid review issues across affected sibling branches, consumers, recovery paths, and derived state, not just the commented line. Run relevant tests at the actual entry point or enforcement boundary, not only helpers or policies; check the final diff for regressions. Batch cohesive fixes, commit only your changes, and push. Explain disagreements or ask for clarification.
- After a successful push, reply in each inline thread addressed by the pushed changes, following the rules below. Also reply to verified fixes already present on the PR when no adequate response exists; do not leave older or outdated comments unanswered merely because a later review approves.
- Recheck base/head, checks, and feedback after each push. Address available issues before waiting for required checks (
gh pr checks <number> --repo <owner/repo> --required --watch --fail-fast). Wait for already-triggered review automation for the current head, even when advisory. Confirm it published and read the review and threads. Match revision-aware reviews by their base/head marker, not GitHub's movable review commit ID; for other automation, verify the reviewed head from its publication or run. A green job or stale review is not a current verdict. Older findings still matter if verified against the current code. - Repeat only while there is a concrete code, CI, or base update to make. If a required check or review is missing, incomplete, or blocked on a human decision or external evidence, report the blocker. Report advisory gaps separately unless they block an explicit acceptance criterion. Do not push or retrigger review solely to get a different verdict. Report readiness only when the current head includes the freshly fetched base tip, required checks and reviews pass, and no actionable feedback or required acceptance gap remains. Report any replies that could not be delivered.
Reply to review feedback
- Reply in the original inline thread, not only in a top-level PR summary. For a fix, briefly state what changed, link the pushed commit, and report relevant validation accurately. Never claim a fix is pushed before the push succeeds or claim unrun tests passed.
- For a disagreement, explain the code evidence in that thread; ask there when clarification is needed. Record accepted or deferred risks only with an explicit user decision, and link that decision. Unresolved thread status alone does not mean a defect remains, and outdated status or approval alone does not prove a fix.
- Use the root review comment's numeric ID with
gh api --method POST repos/OWNER/REPO/pulls/NUMBER/comments/COMMENT_ID/replies. Build the JSON body withjqand pass it through--input -to preserve Markdown safely. GraphQL thread IDs are not REST comment IDs. - Read existing replies before posting. Avoid duplicate responses for the same fix or decision. Confirm the API response; after an uncertain submission, refetch the thread before retrying. If replying fails, report it as a blocker rather than silently considering feedback handled.
- Leave thread resolution to reviewers unless the user explicitly asks you to resolve addressed threads. Never resolve an unfixed concern to make the PR appear ready.