ワンクリックで
review
// Review a GitHub pull request for a Rust codebase. Focuses on security, performance, test coverage, and Rust idioms. Runs in GitHub Actions and posts comments directly to the PR.
// Review a GitHub pull request for a Rust codebase. Focuses on security, performance, test coverage, and Rust idioms. Runs in GitHub Actions and posts comments directly to the PR.
| name | review |
| description | Review a GitHub pull request for a Rust codebase. Focuses on security, performance, test coverage, and Rust idioms. Runs in GitHub Actions and posts comments directly to the PR. |
| allowed-tools | Bash(gh:*), Bash(git diff*), Bash(git log*), Bash(git show*), Read, Grep, Glob |
Review the current PR with a focus on high-signal, actionable feedback. Avoid nitpicks and style preferences unless they impact correctness or maintainability.
/review
This skill runs in GitHub Actions and automatically reviews the current PR, posting inline comments and a summary directly to GitHub.
Before reviewing, familiarize yourself with Apollo's Rust best practices by reading the rust-best-practices skill. Read ALL relevant chapters in the same turn in parallel. Reference these files when providing feedback:
Additionally, you MUST ALWAYS read @.claude/MEMORIES.md which is a long term memory file of feedback you have been given on your reviews on previous PRs. You should utilize and consider these memories when determining what feedback to leave on the PR.
Fetch PR information:
PR Metadata: !gh pr view --json number,title,body,author,baseRefName,headRefName,commits,headRepository,headRepositoryOwner
PR Diff: !gh pr diff
PR Level Comments: !gh pr view --json comments
Get existing inline review comments: gh api repos/{owner}/{repo}/pulls/{pr_number}/comments
DO NOT:
All automated checks (tests, linting, clippy, formatting) are handled by GitHub Actions. Focus exclusively on reviewing the code diffs.
You have a maximum of 10 turns to complete this review. Allocate turns strategically:
Gather all context (single turn - run all commands in parallel)
Analyze the changes
Manual review using the criteria below, referencing the best practices documents
unsafe necessary? Is the invariant documented with // SAFETY:? Is there a safe alternative?unwrap() or expect() on user input, network data, or file contents (see Chapter 4)Reference Chapter 1 and Chapter 3 for details:
.clone() where a borrow would sufficeString or Vec allocations in loops or frequently-called functions.collect() followed by iteration, when chaining would work (see Chapter 1.5)spawn_blockingCow: Could Cow<str> or Cow<[T]> avoid allocations? (see Chapter 3.2)unwrap_or, map_or instead of _else variants when allocation is involved (see Chapter 1.4)Reference Chapter 5 for testing best practices:
Err cases and edge conditions tested? (see Chapter 4.6)Reference Chapter 1, 4, and 6:
unwrap(), expect(), panic!() in library code that should return Resultlet _ = fallible_operation() without justification#[must_use]: Functions returning Result or important valuesMutex/RwLock poisoning (see Chapter 9)'static bounds, overly restrictive lifetimesReference Chapter 4:
thiserror with proper #[from] and #[error] attributes?anyhow being used in library code? (should use thiserror instead)? used instead of verbose match chains?Reference Chapter 6 and 7:
dyn Trait used only when necessary? (see Chapter 6)Reference Chapter 8:
///?Post review comments directly on the PR using inline comments on specific lines of code:
CRITICAL: Inline comment parameters:
line and side parameters — NEVER use position. The position parameter refers to a diff hunk offset and will fail with HTTP 422 errors.line value must be a line number that appears in the PR diff for that file. If the line you want to comment on is not in the diff, comment on the nearest changed line and reference the actual line in the body, or use a general PR comment instead.-F line=N (not -f line=N) so the value is sent as an integer.# For line-specific comments:
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments \
-f body="**[Blocking]** Issue description here. See Chapter X for details." \
-f commit_id="<commit_sha>" \
-f path="src/foo.rs" \
-f side="RIGHT" \
-f subject_type="line" \
-F line=42
# For the summary comment, always update an existing one if present (instead of creating a new one):
COMMENT_ID=$(gh api repos/{owner}/{repo}/issues/{pr_number}/comments --jq '.[] | select(.body | contains("Reviewed by Claude Code")) | .id' | tail -1)
BODY="## Review Summary\n\n...\n\n---\n_Reviewed by Claude Code {model}_"
if [ -n "$COMMENT_ID" ]; then
gh api repos/{owner}/{repo}/issues/comments/$COMMENT_ID -X PATCH -f body="$BODY"
else
gh pr comment {pr_number} --body "$BODY"
fi
Each inline comment should:
**[Blocking]**, **[Should Fix]**, or **[Consider]**After posting inline comments, add a summary comment with:
_Reviewed by Claude Code {model}_ where {model} is the current model name (e.g., "Opus 4.5")Important: Always update the existing summary comment rather than creating a new one. Use the find-and-update pattern shown above.
Batch all findings into a single turn:
gh api callsThis approach reduces turn count by avoiding iterative comment posting.