.agents/skills/gh-pr-review/references/local-review.md
Single-agent review for local changes. Reviews the diff, presents confirmed issues, and lets the user interactively choose which ones to fix.
| File | Purpose |
|---|---|
code-checklist.md | Code review checklist |
doc-checklist.md | Document review checklist |
cherry-review-guidance.md | Cherry Studio project-specific review boundaries |
judgment-matrix.md | Risk levels, worth-fixing criteria, special rules |
checklist-evolution.md | Checklist update flow and rules |
Determine the diff to review based on $ARGUMENTS and working tree state:
$ARGUMENTS, uncommitted changes exist: scope is
uncommitted changes only. Fetch with git diff HEAD (staged + unstaged
tracked files). Also check for untracked files with git status --porcelain
(?? lines) and read their contents for review.$ARGUMENTS, no uncommitted changes: find the base branch by
checking common base branches in order: main, master. Use the first one
that exists. Fetch the branch diff:
git merge-base origin/{base_branch} HEAD
git diff <merge-base-sha>
git status --porcelain (?? lines).abc123): validate with git rev-parse --verify,
then git show.abc123..def456 or abc123...def456): validate both
endpoints. Fetch the diff including both endpoints:
git diff A~1..B
If diff is empty → show usage examples and exit:
/gh-pr-review (uncommitted changes or current branch),
/gh-pr-review a1b2c3d, /gh-pr-review a1b2c3d..e4f5g6h,
/gh-pr-review src/foo.ts, /gh-pr-review 123,
/gh-pr-review https://github.com/.../pull/123.
Review the diff. Apply code-checklist.md to code files,
doc-checklist.md to documentation files. Apply cherry-review-guidance.md to
code, mixed, Cherry architecture documentation, and project-skill changes. For
React component changes, also consult vercel-react-best-practices skill for
detailed performance patterns. When changed lines depend on surrounding context,
read the relevant sections or related definitions as needed. Untracked files
have no diff — review their full contents as new code.
If the branch has an associated GitHub PR, inspect its checks with gh pr checks and include failing or pending CI in the review. Do not run pnpm lint,
pnpm test, or pnpm format locally during review. If no associated PR exists,
state that CI validation is unavailable and keep the result explicitly limited
to static review.
For each issue found:
git diff --name-only or file search before reporting.Output rule: only present the final confirmed issues to the user. Do not output analysis process, exclusion reasoning, or issues that were considered but ruled out.
Consult judgment-matrix.md for risk level assessment, worth-fixing criteria,
and special rules. Discard issues that are not worth reporting.
If no issues remain after filtering → report "no issues found" and exit.
Present a summary of what was reviewed, then list all confirmed issues. Ask
which ones to fix via multi-select. Each option's label is the issue summary
(e.g., [risk] file:line — description). Follow the grouping rule in
SKILL.md: ≤4 items → one question; >4 items → group by priority or category
(each group ≤4 options), then present all groups as separate questions in a
single prompt.
If the user selects any issues, apply the fixes. Do not run local lint, test, or format commands as part of the review flow. Report that existing CI covers the reviewed commit, not unpushed local fixes; re-check CI only after the fixes are published through a user-authorized workflow.
Review all confirmed issues from this session. If any represent a recurring
pattern not covered by the current checklist, read checklist-evolution.md and
follow its steps.