.mimocode/skills/pr-review/SKILL.md
Use this skill when the user provides a GitHub PR URL or number and asks to review it. This covers the full review lifecycle: data gathering, code review, CI verification, and posting the result.
AGENTS.md for the repository's adversarial validation policy and change-style rules.adversarial-validation skill handles the review role playbooks; this skill orchestrates the workflow around it.gh pr view <N> --json title,author,state,body,additions,deletions,changedFiles,commits,baseRefName,headRefName
gh pr diff <N> --name-only
Read the PR body and linked issues to understand the change's purpose. If the PR references an issue, fetch that too:
gh issue view <ISSUE> --json title,body,state
git fetch origin pull/<N>/head:pr-<N>
git diff main...pr-<N> --stat
Classify the change by risk tier (per AGENTS.md):
Group the changed files into logical clusters (by crate or functional area). For each cluster, spawn a subagent with a focused review prompt that includes:
adversarial-validation skill).For standard-tier changes: correctness adversary + simplicity adversary + test-coverage skeptic, plus every role whose domain the diff touches. For high-risk changes: run all seven roles.
Each subagent must produce findings (concrete failure scenario with file:line) or a null report ("attacked X, Y, Z — no break found").
gh pr checks <N>
If any checks fail, investigate:
gh run view --log-failed --job=<JOB_ID>
Determine whether failures are pre-existing (on main), flaky, or caused by the PR.
Combine all subagent findings into a structured review:
Write the review body to a temp file and post via CLI:
# Request changes
gh pr review <N> --request-changes --body-file /tmp/pr_review.md
# Approve
gh pr review <N> --approve --body-file /tmp/pr_review.md
# Comment only (no verdict)
gh pr review <N> --comment --body-file /tmp/pr_review.md
For inline comments on specific lines, use the GitHub API:
cat > /tmp/pr_review.json <<'EOF'
{
"body": "review body",
"event": "REQUEST_CHANGES",
"comments": [
{
"path": "crates/foo/src/bar.rs",
"line": 42,
"body": "finding description"
}
]
}
EOF
gh api --method POST /repos/{owner}/{repo}/pulls/<N>/reviews --input /tmp/pr_review.json
Always use --body-file or --input, never inline multiline --body.
If the review requests changes:
gh pr view <N> --json commitsgit diff pr-<N>..origin/pull/<N>/headIf CI was failing due to pre-existing main breakage:
gh pr update-branch <N>Author: <author> Risk tier: exempt | mechanical | standard | high-risk Changed files: <count> across <cluster count> clusters
| Severity | Location | Finding |
|---|---|---|
| critical | file:line | concrete failure scenario |
APPROVE / REQUEST_CHANGES / COMMENT
maintainerCanModify before attempting to push fixes.