pr-finalize
Skill22 starsChanged 3 months agoMITView on GitHub
Drives a single GitHub PR from "open with loose ends" to genuinely ready-to-merge: rebases off the base branch and resolves conflicts, sweeps every review bot (Qodo, CodeRabbit, Greptile) plus human comments to zero unaddressed findings, verifies that unit AND browser/E2E coverage was actually added for the change, runs the repo's real lint/format/test gates before pushing, and reports what still needs a human. Use when the user gives a PR URL or number and says "finalize this PR", "fix all outstanding comments", "address the review feedback and push", "get this PR merge-ready", or asks to clear what Qodo/CodeRabbit/Greptile could still comment on.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- microsoft/garnettheir own version, first seen Nov 5, 2026
- dotnet/mauitheir own version, first seen Oct 8, 2026
- gustfernandez/skillstheir own version, first seen Jun 14, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- dotnet/maui★ 23ksame name
- microsoft/garnet★ 12ksame name
- gustfernandez/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository194 other files it gives its agents.
- 0-templateSkill
- ab-test-analyzerSkill
- academy-guideSkill
- add-to-my-skillsSkill
- adr-authorSkill
- ai-tools-setupSkill
- algorithmic-artSkill
- api-and-interface-designSkill
- api-designerSkill
- api-docs-writerSkill
- apple-store-submitSkill
- aws-cost-optimizerSkill
- bash-script-hardeningSkill
- blog-post-writerSkill
- book-summarizerSkill
- branch-cleanupSkill
- brand-copy-landingSkill
- brand-copySkill
- brand-designSkill
- brand-guidelinesSkill
- browser-testing-with-devtoolsSkill
- canvas-designSkill
- changelog-generatorSkill
- changelog-keeperSkill
- chart-chooserSkill
- ci-cd-and-automationSkill
- ci-fix-loopSkill
- claude-apiSkill
- cloudflare-block-countriesSkill
- coderabbitloopSkill
- code-review-and-qualitySkill
- code-reviewerSkill
- code-simplificationSkill
- codexloopSkill
- comms-notionSkill
- comms-slackSkill
- comms-whatsappSkill
- competitive-analysisSkill
- concept-explainerSkill
- constraint-driven-developmentSkill
- context-engineeringSkill
- context-repoSkill
- cover-letter-writerSkill
- crash-courseSkill
- cron-schedulerSkill
- data-digestSkill
- data-pipeline-architectSkill
- debug-detectiveSkill
- debugging-and-error-recoverySkill
- decision-matrixSkill
- dependabot-triageSkill
- dependency-upgraderSkill
- deprecation-and-migrationSkill
- dev-instantdbSkill
- discernment-nudgeSkill
- doc-coauthoringSkill
- dockerfile-proSkill
- docs-index-keeperSkill
- documentation-and-adrsSkill
- docxSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 33
Never invent test coverage: If the change has no browser-reachable surface, say so explicitly and name the suite that *is* the real gate.
- Distinctive: line 62
After resolving, re-run the tests before continuing: a rebase that compiles is not a rebase that works.
- Distinctive: line 92
Ask, for the change as a whole, what would catch a regression here: then check whether the PR actually has it.
- Distinctive: line 113
If a gate fails, fix it. Do not push red.
- Distinctive: line 142
If anything is left, say precisely what and why: an honest "blocked on X" is the deliverable when X is genuinely a human call.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PR Finalize
One PR, taken all the way to merge-ready. The job is not "make the bots stop talking": it is land the change in a state a careful reviewer would sign off on, with evidence for every claim.
Inputs
- PR number or URL (optional): detect from the current branch if not given.
--no-push(optional): do everything except the final push. Use when the repo auto-merges and the user wants to eyeball first.
Non-negotiables
These are the failure modes this skill exists to prevent. Violating one makes the whole run worthless:
- Never report a gate as passing without having run it. Paste the real output. "Tests should pass" is not a result.
- Never resolve or claim-fix a finding you didn't actually fix. Blocked is an honest outcome; a false "done" is not.
- Never
git add -A. Stage only the files your fixes touched. Start from a clean tree so that's safe. - Never invent test coverage. If the change has no browser-reachable surface, say so explicitly and name the suite that is the real gate. Do not add a hollow E2E test to look thorough.
- A green CI badge is not proof. Many repos split their required check from the full suite (browser-free half only, etc.). Find out what the required check actually runs.
Instructions
1. Establish the ground truth
gh pr view <PR> --json number,title,body,state,isDraft,headRefName,baseRefName,mergeable,mergeStateStatus,labels,reviewDecision,statusCheckRollup,urlRecord four things before touching code:
mergeable:CONFLICTINGmeans step 2 is mandatory.- Which checks are failing, and for each, whether it is required. Check branch protection (
gh api repos/{owner}/{repo}/branches/<base>/protection) rather than assuming: a red optional job (a flaky bot-review runner, a nightly) is not a blocker, and burning the run waiting on one is a classic waste. - Whether the repo auto-merges. Look for a shepherd/automerge workflow in
.github/workflows/and read its gating conditions (required labels, required checks). If pushing could trigger an immediate merge, decide deliberately: either satisfy the review sweep first, or tell the user before you push. Never let an auto-merge race a review you were asked to complete. - Whether a bot review actually ran. A
SUCCESSstatus from a review bot can still mean "rate-limited, never reviewed": read its comment body, not just the check state.
2. Rebase onto the base branch
Require a clean tree first (git status --porcelain empty), then:
git fetch origin <base>
git rebase origin/<base>Resolve conflicts by understanding both sides, not by picking one. Read the base-side commit that introduced the conflicting hunk (git log -1 --format=%s <base> -- <file>, then the diff): a conflict usually means main changed an invariant your branch is unaware of, and blindly keeping "your" side silently reverts it. State in the PR comment which invariant you preserved and why.
After resolving, re-run the tests before continuing: a rebase that compiles is not a rebase that works.
3. Sweep every review source
Collect findings from all of these; do not stop at the first:
# inline review threads (all bots + humans), with resolution state
gh api repos/{owner}/{repo}/pulls/<PR>/comments --paginate
# rollup issue comments (where CodeRabbit/Qodo post summaries and rate-limit notices)
gh api repos/{owner}/{repo}/issues/<PR>/comments --paginate
# formal reviews
gh pr view <PR> --json reviewsDelegate to the dedicated loop skill when one exists rather than reimplementing its bot's protocol: qodoloop for Qodo, coderabbitloop for CodeRabbit, greploop for Greptile. Each already encodes that bot's posting shape, its ready-made per-finding fix prompt, and its real terminal states. Use this skill's own sweep for human comments and for bots without a dedicated loop.
Triage every finding into exactly one bucket:
| Bucket | Action |
| Real defect | Fix it. This is the point of the exercise. |
| Legitimate improvement | Fix it if it's in scope for this PR. |
| False positive | Reply explaining specifically why the bot is wrong. Do not resolve silently. |
| Needs a human call | Reply, leave open, surface in the final report. |
Bot findings are suggestions from something that has not run the code. A "🐞 Bug" label is a hypothesis: verify it against the actual source before fixing, and against the actual behavior before dismissing.
4. Close the coverage gap
Ask, for the change as a whole, what would catch a regression here: then check whether the PR actually has it.
- Unit / integration tests: does every new branch have a test that fails if you invert it? Bots frequently and correctly flag helper functions exercised only indirectly through a caller. A direct test per branch is cheap and is usually the right response.
Browser / E2E tests: determine whether the repo supports them (
playwright.config.*,cypress.config.*, atest:e2escript) and whether this change has any surface they can reach. Then do one of exactly two things:- it has a reachable surface → add or extend the E2E spec;
- it does not → say so explicitly in the PR comment, name why (e.g. "this is entirely inside a Durable Object alarm loop; the E2E harness only serves static assets"), and name the suite that is the real gate.
Silence here reads as an oversight. An explicit "not applicable, because X" reads as diligence, and is checkable.
5. Run the real gates
Discover them from the repo (Makefile, package.json scripts, CI workflow): do not guess target names. Run, at minimum, the equivalents of:
<lint> # e.g. make lint / npm run lint
<format> # check mode first; only write if it reports drift
<tests> # the suite covering the changed packageCapture exit codes, not just output. Repo-specific traps worth checking for before you burn a cycle: linters whose cache replays findings from deleted sibling worktrees, formatters whose local toolchain version outruns CI's (churning unrelated files), and test runners that hang when two runs overlap.
If a gate fails, fix it. Do not push red.
6. Push and explain
Stage only the files you touched, commit, and push (--force-with-lease after a rebase, never bare --force).
Then post one PR comment that a reviewer can audit without re-reading the diff:
- what the rebase conflict was and which side won, with the reason;
- each finding, and what you did about it (including the ones you rejected, with the argument);
- the coverage decision from step 4, including the explicit not-applicable if that's the answer;
- verbatim gate output: real numbers (
# pass 480 / # fail 0,0 issues.), not adjectives.
Re-trigger any bot that never actually reviewed (e.g. @coderabbitai review) so the PR gets the pass it was owed.
7. Verify and report
Re-read the PR state after the push: confirm mergeable flipped, checks went green, and clear now-stale labels (needs-rebase, etc.). Poll re-triggered bots for their new pass and handle anything it raises.
PR #965 finalized.
Rebase: 1 conflict resolved (kept main's #834 D1-first ordering)
Findings: 2 addressed, 0 rejected, 0 blocked
Coverage: +5 unit tests; E2E not applicable (no browser surface), stated on the PR
Gates: tests 480/480, lint 0 issues, format clean
State: MERGEABLE, checks green
Needs human: noneIf anything is left, say precisely what and why: an honest "blocked on X" is the deliverable when X is genuinely a human call.
Related skills
qodoloop: full Qodo thread protocol (per-finding Agent Prompts, resolve mutations).coderabbitloop: full CodeRabbit protocol.greploop: drives a PR to a 5/5 Greptile confidence score.ci-fix-loop: when the blocker is a failing pipeline rather than review feedback.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

