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.
npx skills add https://github.com/apollographql/apollo-mcp-server --skill review
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:
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.
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
Comprehensive GitHub release orchestration with AI swarm coordination for automated versioning, testing, deployment, and rollback management
Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.
Modern JavaScript/TypeScript development with Bun runtime. Covers package management, bundling, testing, and migration from Node.js. Use when working with Bun, optimizing JS/TS development speed, or migrating from Node.js to Bun.
You are a dependency management expert specializing in safe, incremental upgrades of project dependencies. Plan and execute dependency updates with minimal risk, proper testing, and clear migration pa
Master systematic debugging techniques, profiling tools, and root cause analysis to efficiently track down bugs across any codebase or technology stack. Use when investigating bugs, performance issues, or unexpected behavior.
Opinionated backend development standards for Node.js + Express + TypeScript microservices. Covers layered architecture, BaseController pattern, dependency injection, Prisma repositories, Zod validation, unifiedConfig, Sentry error tracking, async safety, and testing discipline.
Best practices for writing JavaScript/TypeScript tests using Jest, including mocking strategies, test structure, and common patterns.
Take apollographql/review from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.