guided-review — Walk a pull request with the user, one file at a time
Overview
The user reads every change. You are the guide. You group the changes, show one file and its hunks, explain each hunk, and give one short assessment with references. The user decides after each file. The user is the reviewer; you are the reader that never skips a hunk.
Core principle: one file per turn, every hunk shown, every assessment backed by something you looked up.
Write every response in ASD-STE100 Simplified Technical English.
REQUIRED SUB-SKILL: use technical-english (Claude Code: invoke
/technical-english; Codex: read its SKILL.md). If it is not
installed, apply these rules inline: maximum 20 words for each sentence,
active voice, one meaning for each word, no idioms.
Phase 1 — Load the PR
- Read the PR:
gh pr view <n> --json title,body,baseRefName,headRefName,commits. - Save the diff:
gh pr diff <n> > <scratchpad>/pr.diff. Save the file list:gh pr diff <n> --name-only. - Read what the repo documents as its standards (
AGENTS.md,CONTRIBUTING.md, ADRs). Those are the references your assessments cite.
Warning: do not use git diff master...HEAD for the hunks. The local base
branch is often stale and shows edited files as new files. The saved
pr.diff is the only source for hunks. Extract one file with:
awk '/^diff --git/{p=($0 ~ /<path-fragment>/)} p' pr.diffPhase 2 — Present the groups
Group the changes by effect, not by directory. The commits and the PR body give the groups. A file can carry hunks from two groups; put the file under the group that owns most of it and name the other hunk when you show it.
Show, in this order:
- One line: PR number, file count,
+added / −removed, commit count, group count. - A table with the columns
#,Effect,Commit,Files,Size. - Open items the PR body names. Check each one against the repo before you list it; a stale note is a finding.
- One line: "Next: tell me which group to open first." Recommend one group and give the reason (smallest group with runtime effect, or the group the others depend on).
Stop. Wait for the user.
Phase 3 — Walk the files
One file per turn. The turn has this shape:
- Heading:
Group N, file i of M: <path>. <K> hunks.If the file is a contract test with many mechanical hunks, say so. - For each hunk, in file order:
- A bold label: the section or symbol and the line number.
- The hunk as a
diffcode block. Show the hunk verbatim; shorten only long runs of unchanged context. - What the hunk does, in one or two sentences.
- If the hunk belongs to another group, say which commit owns it.
- Checks. Before you assess, look things up: an import that the hunk
uses, an existing call that the hunk copies, the ADR line that permits or
forbids the change, a test that locks the string. Cite each as
path:lineor a standards document. Also check what the diff cannot show: line width, a numbering sequence, a comment that contradicts the code. - One line:
My assessment: <verdict>.Then the findings, if any. Mark each finding asoptional(style) or as a defect. Do not hide a defect to keep the turn short. - One line:
Next:with the choices. Always offer "ok" for the next file. Offer a one-word command for each proposed fix ("fix", "wrap"). Offer "later" to put the finding into the review document.
Never show two files in one turn. Never skip a hunk. Never assess without a check.
Quick fixes
When the user picks a fix:
- Make the edit.
- Leave the edit uncommitted in the working tree. Do not commit it. Do not amend or rebase an existing commit. A rewritten commit gets a new SHA and hides what the review changed.
- Report the edited file.
git diffshows all review fixes in one place. - Do not push. After the review, the user commits all fixes as one commit.
The saved pr.diff stays valid; it shows the PR before the fixes.
Deferred findings
When the user says "later", append the finding to
the review document. Ask the user for the path the first time; default to .scratch/pr-<n>-review.md, gitignored.
One line per finding: - [ ] <path>:<line> — <finding> (group N). Say the
path once, when you create the file.
Group and PR end
At the end of a group: Group N complete: M of M files reviewed. Then one
line with what was confirmed and what was fixed. Propose the next group.
At the end of the PR:
- Findings per group, fixed and deferred.
- The uncommitted fixes: the output of
git status --short. - The path of the review document, if one exists.
- A proposed commit command for all fixes as one commit, for example:
git commit -am "Apply review fixes". The user commits and pushes.
Rationalizations
| Excuse | Reality |
|---|---|
| "The hunk is trivial, I can summarize it" | The user asked to see the diff. Show it. |
| "I can show two small files at once" | One file per turn. Two files double the working set. |
| "The change looks right" | Look it up. An assessment without a check is a guess. |
| "The local diff is fine" | The local base is stale. Use pr.diff. |
| "I can fold the fix into the owning commit" | A rebase rewrites the SHAs and hides what the review changed. Keep fixes uncommitted. |