Skip to content
AI Skills Central

Type to search Agent Skills, workflows, tutorials, tools and the glossary.

Agent Skill

Code review (Sentry)

Sentry's pull-request review checklist: correctness, design, test coverage and long-term impact, with Python, TypeScript and security patterns to flag.

name: code-reviewBy SentryChecked
View source on GitHub
Bookmark

Bookmarks are kept in your free account, so you can find this page again on any device.

Sign in to bookmark

Install

Commands are pinned to commit a582c51, the version we read, wherever the install method supports it.

npx skills

Terminal
npx skills add getsentry/skills@a582c51ee29d0f35e6ac321340796f77d43da733 --skill code-review -a claude-code

Copies the skill into .claude/skills/ in this project, pinned to the reviewed commit.

Plugin marketplace

Claude Code prompt
/plugin marketplace add getsentry/skills
/plugin install sentry-skills@sentry-skills

Run inside Claude Code. Installs the whole sentry-skills plugin from its default branch, not the pinned commit.

What it does

A compact review checklist taken from Sentry’s engineering practices. It asks the agent to look for problems first (bugs, security, performance), then assess design, test coverage and long-term maintenance cost, and it sets a tone for feedback: specific, actionable, and clear about what blocks approval. The examples are concrete, such as an N+1 query in Django with the prefetch_related fix and a string-built SQL query next to its parameterised version.

When to use it

Reviewing a teammate’s pull request with a consistent checklist and a clear line between blocking issues and suggestions. It is a good default review skill for any team, and the tone guidance keeps comments useful rather than nitpicky.

When to skip it

Your own unpushed branch, where find bugs is the narrower tool, and security-only reviews, where differential review or security review go further.

Try it

Review PR #312. Lead with anything that blocks approval, then design
and test coverage, and mark every comment as blocking or optional.

What it can touch

Bundles scripts
No
Pre-approved tools
None declared
Needs
Nothing beyond the agent
Client-specific fields
None, spec fields only
Files
At commit a582c51 the SKILL.md is 103 lines long and it is the only file in the folder.

Its instructions steer what your agent does, and it may have changed since the commit we read. How to check a skill.

Instructions only. The Python and React examples reflect Sentry’s own stack, so on a Go or Rust codebase you get the general checklist but fewer worked patterns.

Alternatives

Differential review and security review for security, find bugs for self-review, and requesting code review for agents reviewing their own work. Our code review with Claude Code workflow combines them.

SKILL.md

The file exactly as published at the reviewed commit, reproduced under its Apache-2.0 licence.

skills/code-review/SKILL.md
---
name: code-review
description: Perform code reviews following Sentry engineering practices. Use when reviewing pull requests, examining code changes, or providing feedback on code quality. Covers security, performance, testing, and design review.
---

# 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

```python
# 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

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

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

### Security

```python
# 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

- [Sentry Code Review Guidelines](https://develop.sentry.dev/engineering-practices/code-review/)
  • Address PR comments (OpenAI, deprecated repo)

    Pulls every review thread on the current branch's PR with gh, numbers them, asks which to fix, then applies only those. Source repo is deprecated.

    Bundles scriptsChecked at 49f948f

  • Differential security review (Trail of Bits)

    Trail of Bits' security-focused review of a PR, commit or diff that scales its depth to the change, measures blast radius and writes a Markdown report.

    Checked at 149d7b2

  • Find bugs (Sentry)

    Reviews the changes on your current branch for bugs and security issues: gathers the full diff, maps attack surface, then runs a checklist per file.

    Checked at a582c51