Code review, Sentry practices

Reviews a change by Sentry's guidelines: runtime errors, performance and N+1 queries, side effects, compatibility, security, design and tests, with a polite tone and approval once only minor issues remain. Use when reviewing a pull request or branch.

Code reviewPack: Sentry skills102 linescode-review
Author
Source
getsentry/skills/skills/code-review @ a582c51
License
Apache-2.0 · Copyright 2025 Functional Software, Inc. dba Sentry

About this skill

What it does

The skill turns Sentry's reviewer guidelines into instructions: what to look for in a change and how to word the feedback. The checklist covers runtime errors, performance (unbounded O(n²) work, N+1 queries, needless allocations), side effects on other components, backwards compatibility of APIs, costly Django ORM queries, and security: injection, XSS, access-control gaps, exposed secrets. It also asks whether the design fits the architecture and whether tests cover the requirements and edge cases.

Schema changes, API contract changes, a new framework or library, performance-critical paths and security-sensitive code are flagged for a senior engineer. On tone: polite, actionable comments, questions when unsure, approval once only minor issues remain, no blocking over style; the stated goal is less risk, not perfect code. Examples show what to flag: an N+1 query in Django, a missing useEffect dependency in React, SQL built with an f-string.

It has no step for fetching the diff, no report format and no severity scale; the agent decides those. The folder holds only SKILL.md and the licence.

When to use it, and when not

Use it to review a pull request or a branch, especially in Python/Django or TypeScript/React code.

For a deep security or bug hunt it is thin: it names categories, not how to trace them.

How to run it

The install command below puts the folder in place. The agent picks the skill up by its description when you ask for a review; to call it yourself:

  • Claude Code: /code-review, or ask for the skill by name.
  • Codex: $code-review.
  • Cursor: type / in the Agent chat and pick code-review.

Example: /code-review Review the changes on this branch against main and say whether you would approve them.

Installed in ~/.claude/skills/code-review, this skill replaces Claude Code's built-in /code-review: the command now runs Sentry's checklist, and the built-in review stays reachable only through its alias /review.

Code review against standards and spec has the same slug: both install into a code-review folder, so only one can be installed at a time.

How it differs from similar skills

Find bugs in branch changes from the same pack is the procedure this skill lacks: it reads the full branch diff, runs an eleven-item security checklist per file and reports each finding with evidence. PR review from our catalog fixes a report format and requires a failure scenario for each bug. Multi-axis code review grades five axes and checks whether the tests would catch a regression. Matt Pocock's skill measures the diff against written standards and the spec. This one is the lightest: a checklist and reviewing etiquette.

Install

Run one command — it saves SKILL.md and the files it uses into your agent's skills folder. Claude Code and Codex pick up a new skill without a restart; if it does not show up, restart the agent.

Claude Code — macOS, Linux
curl -fsSL --create-dirs -o ~/.claude/skills/code-review/SKILL.md https://anymodel.org/en/skills/sentry/code-review/SKILL.md -o ~/.claude/skills/code-review/LICENSE https://anymodel.org/en/skills/sentry/code-review/LICENSE
Codex, Cursor — macOS, Linux
curl -fsSL --create-dirs -o ~/.agents/skills/code-review/SKILL.md https://anymodel.org/en/skills/sentry/code-review/SKILL.md -o ~/.agents/skills/code-review/LICENSE https://anymodel.org/en/skills/sentry/code-review/LICENSE
Claude Code — Windows PowerShell
foreach ($f in 'SKILL.md','LICENSE') { $p = Join-Path "$HOME\.claude\skills\code-review" $f; New-Item -ItemType Directory -Force (Split-Path $p) | Out-Null; Invoke-WebRequest "https://anymodel.org/en/skills/sentry/code-review/$f" -UseBasicParsing -OutFile $p }
Codex, Cursor — Windows PowerShell
foreach ($f in 'SKILL.md','LICENSE') { $p = Join-Path "$HOME\.agents\skills\code-review" $f; New-Item -ItemType Directory -Force (Split-Path $p) | Out-Null; Invoke-WebRequest "https://anymodel.org/en/skills/sentry/code-review/$f" -UseBasicParsing -OutFile $p }

Any other agent: save the file into its skills folder, or give it the link to the file: https://anymodel.org/en/skills/sentry/code-review/SKILL.md

SKILL.md

Raw

Sentry Code Review

Follow these guidelines when reviewing code for Sentry projects.

Review Checklist

Identifying Problems

Look for these issues in code changes:

  • Runtime errors: Potential exceptions, null pointer issues, out-of-bounds access
  • Performance: Unbounded O(n²) operations, N+1 queries, unnecessary allocations
  • Side effects: Unintended behavioral changes affecting other components
  • Backwards compatibility: Breaking API changes without migration path
  • ORM queries: Complex Django ORM with unexpected query performance
  • Security vulnerabilities: Injection, XSS, access control gaps, secrets exposure

Design Assessment

  • Do component interactions make logical sense?
  • Does the change align with existing project architecture?
  • Are there conflicts with current requirements or goals?

Test Coverage

Every PR should have appropriate test coverage:

  • Functional tests for business logic
  • Integration tests for component interactions
  • End-to-end tests for critical user paths

Verify tests cover actual requirements and edge cases. Avoid excessive branching or looping in test code.

Long-Term Impact

Flag for senior engineer review when changes involve:

  • Database schema modifications
  • API contract changes
  • New framework or library adoption
  • Performance-critical code paths
  • Security-sensitive functionality

Feedback Guidelines

Tone

  • Be polite and empathetic
  • Provide actionable suggestions, not vague criticism
  • Phrase as questions when uncertain: "Have you considered...?"

Approval

  • Approve when only minor issues remain
  • Don't block PRs for stylistic preferences
  • Remember: the goal is risk reduction, not perfect code

Common Patterns to Flag

Python/Django

# Bad: N+1 query
for user in users:
    print(user.profile.name)  # Separate query per user

# Good: Prefetch related
users = User.objects.prefetch_related('profile')

TypeScript/React

// Bad: Missing dependency in useEffect
useEffect(() => {
  fetchData(userId);
}, []);  // userId not in deps

// Good: Include all dependencies
useEffect(() => {
  fetchData(userId);
}, [userId]);

Security

# Bad: SQL injection risk
cursor.execute(f"SELECT * FROM users WHERE id = {user_id}")

# Good: Parameterized query
cursor.execute("SELECT * FROM users WHERE id = %s", [user_id])

References

Connect through AnyModel API

This skill runs on whatever model your agent uses. Point Claude Code, Codex or Cursor at AnyModel to run it on Claude, GPT, Gemini and more with one key — pay per token, no subscription.

More from the pack Sentry skills

AGENTS.md and CLAUDE.md writer

Writes or trims a repository's AGENTS.md to under 60 lines of commands, conventions and pointers to existing docs, checks every path, and makes CLAUDE.md a symlink to it. Use when a repo needs agent instructions or its current file has grown long or stale.

Claude Code settings audit

Detects a repository's stack and proposes a Claude Code settings.json allow list of read-only commands for the tools it actually uses, plus docs domains and Sentry or Linear MCP entries. Use when setting up Claude Code permissions or auditing existing ones.

Code simplifier

Simplifies recently changed code without changing behaviour: less nesting, no nested ternaries, clearer names, no redundant abstractions, while following CLAUDE.md conventions. Use when code works but reads heavier than it should and needs a cleanup pass.

Conventional commit messages

Commits in Sentry's Conventional Commits style: a feature branch instead of main, a typed capitalised subject up to 70 characters, Fixes or Refs footers, no personal data. Use when asked to commit changes or draft a commit message.

Django access control review

Audits Django and DRF code for IDOR and broken access control by learning the app's authorization model and tracing each endpoint from ID to query, reporting only confirmed gaps with enforcing fixes. Use when reviewing views, viewsets or tenant isolation.

Find bugs in branch changes

Reviews the commits on the current branch for security holes, bugs and quality issues with an eleven-item checklist and reports verified findings with file, line, severity and fix, without editing code. Use when you want a security-first pass before a PR.

GitHub Actions security review

Audits GitHub Actions workflows for attacks an outsider without write access can run: pwn requests, expression injection, comment commands, token theft, poisoned agent configs, unpinned actions. Use when reviewing CI security or changing workflows.

Iterate a PR until CI is green

Drives an open PR to green: fixes failing CI and high and medium review comments, verifies locally, commits, pushes and repeats, stopping at human approval or draft gates. Use when a PR is red or has review feedback to work through.

PR title and description writer

Writes or refreshes a PR title in Sentry's conventional format and a short reviewer-facing description without template headings or test logs, then opens a draft or updates the PR. Use when opening a PR or after commits change its scope.

Prompt optimizer

Writes, repairs or ports system and agent prompts against a small eval set, comparing candidate rewrites on the same cases and checking the winner on held-out ones. Use when a prompt is unreliable, moves to another model family or needs evals.

Secret leaks through serialization

Finds secrets that leak when a credential field on a dataclass, pydantic model or JS object meets code that logs or traces whole objects, searching the whole repository for the other half. Use when a change adds such a field or a wholesale sink.

SECURITY_MODEL.md for review tools

Writes and maintains SECURITY_MODEL.md, telling security review tools a repository's exposure, invariants, reportable finding classes and owner-confirmed exclusions, with a script that flags stale references. Use when preparing a repo for automated review.

Agent skill security scanner

Audits an agent skill before installation: a static scan for prompt injection, hidden Unicode, secrets, risky scripts and structural traps, then a review of intent and permissions ending in a verdict. Use when a skill comes from an outside source.

Skill writer by the Agent Skills spec

Creates and improves agent skills by Sentry's workflow: sources with provenance, the simplest execution shape, SPEC.md and SOURCES.md, precision passes after each change and a structural validator. Use when building a skill that a team will maintain.

Security review, Sentry

Reviews a file, diff or component for exploitable vulnerabilities with OWASP-based references, researches the codebase before flagging and reports only findings reached by attacker-controlled input. Use when a change needs a low-noise security review.

Django performance review

Reviews Django and DRF code for N+1 queries, unbounded querysets, missing indexes and write loops, validating table size and hot paths before reporting. Use when a Django view or endpoint is slow or a change touches large tables.