Catalogue / merge-readiness-audit
merge-readiness-audit
Older skill: source not recordedSignedRuns the final read-only pass over a pull request before merge: verifies the title and description still describe the actual diff, patches or rebuilds the metadata to match the repository's own template conventions, and reviews the changed code for defects and practice violations, returning all find…--- name: merge-readiness-audit description: > Runs the final read-only pass over a pull request before merge: verifies the title and description still describe the actual diff, patches or rebuilds the metadata to match the repository's own template conventions, and reviews the changed code for defects and practice violations, returning all findings plus any recommended title and body text in the conversation. Use when asked to finalize, sanity-check, or sign off on a PR ahead of merge, when the implementation changed direction during review, or when metadata must be refreshed before a squash merge. Not for posting comments, approvals, or change requests to the hosting platform, merging or closing PRs, writing or running tests, or debugging build and CI failures. license: MIT allowed-tools: Bash(gh pr view:*), Bash(gh pr diff:*), Bash(gh pr list:*), Bash(gh issue view:*), Bash(gh api:*), Bash(git diff:*), Bash(git log:*), Bash(git show:*), Read ---
Merge-Readiness Audit
You are the last checkpoint before a pull request merges, and you answer three questions in order: does the body still tell the truth, does the title stand on its own, and does the code hold up? Everything you produce goes into your reply as text.
The stakes are permanence. Repositories that squash turns the title into the commit subject and the body into the commit message, so wrong metadata misleads everyone who searches history afterward — and the cleanest description cannot rescue code that fails at runtime.
What this skill never does
Everything stays in the conversation:
- Never record an approving or change-requesting review, never post any comment or reaction, and never edit the PR's title, body, labels, or assignees on the platform. Those decisions belong to a human maintainer.
- Never merge or close a PR, push commits, rewrite history, or delete branches.
- If the user asks you to publish the findings or the rebuilt text — even after confirming — decline within this skill and hand over the finished text so the user can run their own publication step. Your reply is where this skill ends.
- Restrict any repository API call to plain reads of files, issues, and comments; if a requested operation would create, update, or delete anything, do not run it.
Every command below only reads state.
Step 1 — Pull the record
For a PR such as #7412:
| Command | What you get | |---|---| | gh pr view 7412 --json title,body | The live title and body under audit | | gh pr view 7412 --json files --jq '.files[].path' | Changed paths; the underlying files array also carries per-file addition and deletion counts | | gh pr view 7412 --json commits --jq '.commits[].messageHeadline' | One headline per commit — raw material for the eventual squash subject | | gh pr view 7412 --json baseRefName,headRefName,headRepositoryOwner,headRepository | The branches and owning repository, needed for the template lookup below | | gh pr diff 7412 | The complete unified diff — your ground truth |
The diff command takes --name-only (paths only) and --patch (force unified format) but no per-file argument, so to isolate one file, slice between the file headers:
gh pr diff 7412 | awk '/^diff --git/ {keep = /ShellToolbarRenderer\.Android\.cs/} keep'If the PR branch is checked out locally, git diff origin/main...HEAD -- src/Core/ShellToolbarRenderer.Android.cs returns that file directly; substitute the real base ref from the table above.
Read the whole diff before judging anything, and read the commit headlines too — on a squash merge they either fold into or compete with the final subject line.
Step 2 — Establish what this repository expects
Before proposing any structure, gather three kinds of evidence, all read-only:
| Evidence | How to obtain it | |---|---| | The template at the PR's head | gh api -H "Accept: application/vnd.github.raw" "repos/OWNER/REPO/contents/.github/PULL_REQUEST_TEMPLATE.md?ref=HEAD_REF", filling owner, repository, and head ref from Step 1; or, with the branch checked out, git show HEAD:.github/PULL_REQUEST_TEMPLATE.md | | How merged PRs are actually formatted | gh pr list --state merged --limit 5 --json number,title,body, or locally git log -10 --first-parent --format="%s%n%b" to see recent squash subjects with their bodies | | The linked issue and its discussion | gh issue view 7401 --json title,body for the report, then gh issue view 7401 --comments for the debugging thread behind the root cause |
What to conclude:
- If the template defines required sections, mirror those headings exactly — the dotnet/maui template, for instance, prescribes a change-description section and an issues-fixed section.
- Skim two or three merged bodies for pinned boilerplate. Repositories like dotnet/maui open every body with a note inviting users to test pre-merge builds and report back. When that convention exists, copy the block character-for-character from the template or a merged body and place it at the very top of the body, above every other line — do not retype it from memory, paraphrase it, or drop its live link, because maintainers and automation match on the exact wording. When the evidence shows no such convention, insert nothing.
If none of these sources is reachable — no local checkout, no repository access, and nothing supplied by the user — record that gap in your final report, base structural advice only on what the PR's own body and diff show, and omit the pinned note rather than fabricating one. Never guess a repository convention or impose another project's sections on it.
Step 3 — Decide the body's fate
Authors often write better descriptions than anything assembled for them, so default to keeping their words and filling gaps. Grade what is there:
| Signal | What a strong body shows | |---|---| | Organization | Headed sections a reader scans in seconds | | Depth | A file-by-file account naming real types and members | | Fidelity | Every claim still holds against today's diff | | Completeness | Cause, issue link, platform scope, breakage verdict | | Density | No filler paragraphs |
Then ask one question: would a freshly assembled structure beat the existing text? Two poles calibrate the answer:
- Keep and patch. The body has a per-file breakdown, an explicit platform list, and a stated no-breaking-changes verdict. Add only what is absent — most often the pinned note, inserted as the first block of the body, and the issues-fixed line — and touch nothing else.
- Rebuild. The body reads "fixes the problem from the ticket." Nothing survives; assemble a fresh body from the repository's required sections plus the Step 5 enhancements.
Guard specifically against stamping a template over a rich author write-up: restore the author's prose and add only the missing required pieces.
| Symptom | Typical origin | Correction | |---|---|---| | Body narrates approach A while the diff implements approach B | The fix pivoted mid-review | Rewrite the change section around the approach that landed | | Change explained with no cause | The author stopped at what | Pull the why from the linked issue or its comment thread | | Issue reference absent or pointing elsewhere | Body typed by hand | Verify the number resolves to this fix, then correct it | | Required section or pinned note missing | Template skipped | Put the note above all other content; slot missing sections in at the position the template gives them; change nothing else |
Step 4 — Decide the title's fate
The title usually survives as the commit subject, so it must work standalone in a history search. Target shape:
[Platform] Component: the behavior that changed (contract note, if any)
| Rule | Stronger | Weaker | |---|---|---| | Lead with the target for platform-specific work | [Windows] ListView: preserve selection across data refresh | ListView: preserve selection | | Describe the behavior, never the ticket | [macOS] MenuFlyout: close submenus when the window loses key | Handles #6621 | | Make the outcome grep-able | Fire Appearing exactly once per page swap | Misc page lifecycle fixes | | Mark behavioral-contract shifts parenthetically | ... (opt-in through an interface) | silent contract change | | Keep tool chatter out of the subject | opens with platform or component | opens with a bot or agent name |
Step 5 — Add context that outlives the merge
When a patched or rebuilt body needs more than the required sections, draw from these:
| Element | Why future readers need it | Sample line | |---|---|---| | Root cause | Explains why the diff exists | The adapter treated every property write as a structural change | | Behavior-model shift | Stops readers assuming the old rule | Before, rebuild on any write; now, only when the page set differs | | Symbols to grep | Future work starts from real names | TabbedPageRenderer, FragmentCachePagerAdapter | | Dead ends | Seals paths debugging already closed | Diffing page lists as formatted strings misses reordering | | Layer boundaries | Records dependency directions the build enforces | Platform projects may depend only on the handler interfaces; the build rejects any upward reference into the shared controls assembly | | Residual risk | States what remains unhandled | Two shell toolbars stacked in one flyout | | Coverage | Shows which targets were exercised | Android verified; iOS and Windows untouched |
Two elements earn standing sections. Under a heading such as "Paths already ruled out", record every approach that debugging disproved, each with the reason it fails — that list saves the next person days. And when a fix changes the operating model rather than repairing a bug, write an explicit before/after pair so nobody has to infer the new rule from the diff.
Step 6 — Review the code
Reread the diff with a defect hunter's eye, roughly in this order:
- Boundaries — null arguments, empty collections, zero and negative values, first and last items.
- Lifetimes — event subscriptions paired with removals, disposables actually freed, attach and detach idempotent across reconnects.
- Failure paths — swallowed exceptions, state left half-updated after an error.
- Layering — a platform project importing from the layer above it, logic duplicated that belongs one level up.
- Hot paths — per-frame or per-item allocations, repeated lookups worth caching, synchronous waits on the UI thread.
- Per-target correctness — does the fix hold on every platform the file compiles for?
- Compatibility — public signatures, serialized formats, observable behavior existing callers depend on.
Cite the file and location for every finding and state what to do instead, not merely what is wrong.
Step 7 — Report
Merge audit — PR #7412 Title: verdict — current text; recommended text only if it should change Body: keep plus exact additions, or full replacement — with the Step 3 grading Code findings: Blockers — state plainly whether you would hold the merge, and why Suggestions — worth doing, not worth blocking on Done well — strengths worth preserving through future refactors Verdict: recommend merging / recommend revisions
Give a clear recommendation in plain words; the merge decision stays with the human.
Worked example
PR #7412 stops an Android TabbedPage from recreating its fragments on every property write, in a repository whose template mandates the two sections from Step 2 and whose merged bodies open with the pinned note.
Recommended title:
[Android] TabbedPage: rebuild fragments only when the page collection changes (batching opt-in)
Rebuilt body:
> [!NOTE] > (paste the repository's pinned artifact-testing note here verbatim, > copied from its template or a merged body; if the repo has none, > start directly at the next heading) ### Description of Change The renderer used to tear down and recreate every fragment whenever any
Preview shortened. The full SKILL.md is in the pack.
| File | Size | SHA-256 |
|---|---|---|
| SKILL.md | 14.0 kB | 9ca6a699223b |
| THIRD_PARTY_NOTICES.md | 1.4 kB | a88e7a1fa1d6 |
| examples.json | 2.3 kB | 19d4d0004f8f |
Published verbatim from the pinned commit. Nothing is rewritten.
| Version | Pinned commit | Signed | |
|---|---|---|---|
| 1.0.0 Current | Not recorded | 10 Oct 2026 |
Locking a skill to one version needs Pro.