PR Review Hardening
Overview
Turn a submitted PR review into a trustworthy, merge-ready change set. The
default failure mode is to blindly apply every review comment — including
false positives, out-of-diff items, and severity over-ratings — then declare
victory on a green local test run that the real CI later rejects. This skill
enforces three gates: verify accuracy first, fix one seam per commit,
and confirm with the actual CI run, not the local build.
When to Use
- The user pastes a PR review (their own draft or a teammate's) and asks to act
on it ("fix these", "apply", "is this accurate?", "review and merge").
- A review is in Request-changes state and the next step is remediation.
- Any task touching a GitHub PR where CI status must be trusted (not assumed).
Workflow
Phase 1 — Verify review accuracy before touching code
Do not start editing on the first reading of the review. For each numbered
item, verify against the real repository state:
- Existence. Does the cited bug exist at the cited file/line? Read the
actual file on the relevant branch/commit; grep the symbol. Line numbers in
the review may be from a stale read or a different branch.
- False-positive. Did the review claim something is missing when it
already exists? Reviewers frequently read only part of a large file. Grep
the whole file (especially the
#[cfg(test)] / test module at the bottom)
before accepting "no test / not implemented" claims.
- Scope. Is the item inside this PR's diff? Run
git diff --stat BASE..HEAD (or the PR's merge-base). Files/lines
outside the diff are out of scope — flag them, do not fix them in this PR.
- Missed items. While reading, record real bugs the review omitted (e.g.,
an error path that leaks a temp file, a dead-code branch that can never
trigger). Add them as additional findings.
- Blast radius. Don't inherit the review's severity. A "symlink rejection
is dead code" sounds like a remote exploit but is defense-in-depth if it
only validates a locally-fetched file.
Produce a corrected review before editing: for each original item mark
Confirmed / False-positive (evidence: …) / Out-of-scope (not in diff) /
Missed (new finding), and list new findings. See
references/workflow.md for the template. This protects the user from acting on
wrong claims.
Phase 2 — Fix one seam per commit
- One commit per concern. Zero behavior change within a seam. The commit
message references the review item ID, e.g.
#3 LocalTransport::download_file → std::fs::copy(remote, local).
- Prefer
git commit -F FILE (and gh pr create --body-file FILE): the
default shell is fish, where heredocs, VAR=x cmd prefixes, and long
inline bodies fail. Write bodies to a temp file under /tmp.
- Run the acceptance gates per seam (fmt / clippy
-D warnings / targeted
test) before committing so a failure is attributable to one change.
Phase 3 — Confirm with the real CI run (never local-green alone)
Local cargo test / npm test green is necessary but not sufficient.
- After opening the PR:
gh run list --branch BRANCH --limit 5 to find the
run IDs, then gh run watch RUN_ID (or
gh run view ID --json conclusion -q .conclusion). Watch BOTH the "CI"
run (includes security/audit jobs) and the "Integration Matrix" run.
- After
gh pr merge, git fetch and re-verify main's post-merge runs — a
green PR branch does not guarantee green main (matrix/merge interactions).
- Verify a squash-merged commit's scope:
git show --stat SHA. GitHub's
merge echo can look like it touched many files when it changed one.
Environment Gotchas
- Shell is fish. Avoid multi-line
if/for and heredocs; use bash for
control flow; write message bodies to files and pass --body-file.
- clippy
-D warnings flags needless_borrows_for_generic_args:
untimed(&format!(...)) → drop the & → untimed(format!(...)).
- Concurrent automation may switch git branches / stash your work
mid-session. Commit early; if preserving a WIP, use a named stash and verify
non-destructively (
git stash apply then git diff HEAD --stat) BEFORE
git stash drop. If the apply is a no-op (content already in HEAD), the
stash is redundant and safe to drop.
- Baseline env failures.
cargo test may show a pre-existing,
env-dependent failure unrelated to the change (e.g., test_config_timeout_default
when VB_TIMEOUT is set). Confirm it is pre-existing, not a regression.
Resources
references/workflow.md — corrected-review template, per-phase command
recipes, and a seam-commit checklist.
1---2name: pr-review-hardening3description: Verify the accuracy of a GitHub PR review (or a pasted review draft) against the actual code before acting, fix the confirmed bugs one seam at a time, and confirm with the real CI run rather than trusting local-green. Use when the user hands over a PR review and asks to fix the review comments, apply these changes, review this and merge, or confirm whether a review is accurate. This skill applies when the task involves acting on a code review, a GitHub PR, the gh CLI, CI verification, or single-seam commit discipline.4---56# PR Review Hardening78## Overview910Turn a submitted PR review into a trustworthy, merge-ready change set. The11default failure mode is to blindly apply every review comment — including12false positives, out-of-diff items, and severity over-ratings — then declare13victory on a green local test run that the real CI later rejects. This skill14enforces three gates: **verify accuracy first**, **fix one seam per commit**,15and **confirm with the actual CI run**, not the local build.1617## When to Use1819- The user pastes a PR review (their own draft or a teammate's) and asks to act20 on it ("fix these", "apply", "is this accurate?", "review and merge").21- A review is in Request-changes state and the next step is remediation.22- Any task touching a GitHub PR where CI status must be trusted (not assumed).2324## Workflow2526### Phase 1 — Verify review accuracy before touching code2728Do not start editing on the first reading of the review. For each numbered29item, verify against the real repository state:30311. **Existence.** Does the cited bug exist at the cited file/line? Read the32 actual file on the relevant branch/commit; grep the symbol. Line numbers in33 the review may be from a stale read or a different branch.342. **False-positive.** Did the review claim something is missing when it35 already exists? Reviewers frequently read only part of a large file. Grep36 the whole file (especially the `#[cfg(test)]` / test module at the bottom)37 before accepting "no test / not implemented" claims.383. **Scope.** Is the item inside this PR's diff? Run39 `git diff --stat BASE..HEAD` (or the PR's merge-base). Files/lines40 outside the diff are out of scope — flag them, do not fix them in this PR.414. **Missed items.** While reading, record real bugs the review omitted (e.g.,42 an error path that leaks a temp file, a dead-code branch that can never43 trigger). Add them as additional findings.445. **Blast radius.** Don't inherit the review's severity. A "symlink rejection45 is dead code" sounds like a remote exploit but is defense-in-depth if it46 only validates a locally-fetched file.4748Produce a **corrected review** before editing: for each original item mark49`Confirmed` / `False-positive (evidence: …)` / `Out-of-scope (not in diff)` /50`Missed (new finding)`, and list new findings. See51`references/workflow.md` for the template. This protects the user from acting on52wrong claims.5354### Phase 2 — Fix one seam per commit5556- One commit per concern. Zero behavior change within a seam. The commit57 message references the review item ID, e.g.58 `#3 LocalTransport::download_file → std::fs::copy(remote, local)`.59- Prefer `git commit -F FILE` (and `gh pr create --body-file FILE`): the60 default shell is **fish**, where heredocs, `VAR=x cmd` prefixes, and long61 inline bodies fail. Write bodies to a temp file under `/tmp`.62- Run the acceptance gates per seam (fmt / clippy `-D warnings` / targeted63 test) before committing so a failure is attributable to one change.6465### Phase 3 — Confirm with the real CI run (never local-green alone)6667Local `cargo test` / `npm test` green is necessary but not sufficient.68691. After opening the PR: `gh run list --branch BRANCH --limit 5` to find the70 run IDs, then `gh run watch RUN_ID` (or71 `gh run view ID --json conclusion -q .conclusion`). Watch BOTH the "CI"72 run (includes security/audit jobs) and the "Integration Matrix" run.732. After `gh pr merge`, `git fetch` and re-verify `main`'s post-merge runs — a74 green PR branch does not guarantee green `main` (matrix/merge interactions).753. Verify a squash-merged commit's scope: `git show --stat SHA`. GitHub's76 merge echo can look like it touched many files when it changed one.7778## Environment Gotchas7980- **Shell is fish.** Avoid multi-line `if`/`for` and heredocs; use `bash` for81 control flow; write message bodies to files and pass `--body-file`.82- **clippy `-D warnings`** flags `needless_borrows_for_generic_args`:83 `untimed(&format!(...))` → drop the `&` → `untimed(format!(...))`.84- **Concurrent automation may switch git branches / stash your work**85 mid-session. Commit early; if preserving a WIP, use a named stash and verify86 non-destructively (`git stash apply` then `git diff HEAD --stat`) BEFORE87 `git stash drop`. If the apply is a no-op (content already in HEAD), the88 stash is redundant and safe to drop.89- **Baseline env failures.** `cargo test` may show a pre-existing,90 env-dependent failure unrelated to the change (e.g., `test_config_timeout_default`91 when `VB_TIMEOUT` is set). Confirm it is pre-existing, not a regression.9293## Resources9495`references/workflow.md` — corrected-review template, per-phase command96recipes, and a seam-commit checklist.