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.
Bookmark
Bookmarks are kept in your free account, so you can find this page again on any device.
Sign in to bookmarkInstall
Commands are pinned to commit a582c51, the version we read, wherever the install method supports it.
npx skills
npx skills add getsentry/skills@a582c51ee29d0f35e6ac321340796f77d43da733 --skill code-review -a claude-codeCopies the skill into .claude/skills/ in this project, pinned to the reviewed commit.
Plugin marketplace
/plugin marketplace add getsentry/skills
/plugin install sentry-skills@sentry-skillsRun inside Claude Code. Installs the whole sentry-skills plugin from its default branch, not the pinned commit.
Upload
git clone https://github.com/getsentry/skills.git
cd skills && git checkout a582c51ee29d0f35e6ac321340796f77d43da733
cd skills && zip -r ~/code-review.zip code-reviewThen in Claude open Customize > Skills, choose + > Upload a skill and pick the zip. Code execution must be enabled in Settings > Capabilities.
npx skills
npx skills add getsentry/skills@a582c51ee29d0f35e6ac321340796f77d43da733 --skill code-review -a codexInstalls to .agents/skills/, which Codex scans from the working directory up to the repo root.
npx skills
npx skills add getsentry/skills@a582c51ee29d0f35e6ac321340796f77d43da733 --skill code-review -a cursorInstalls to .agents/skills/, one of the folders Cursor reads skills from.
gh skill
gh skill install getsentry/skills skills/code-review --pin a582c51ee29d0f35e6ac321340796f77d43da733 --agent github-copilotNeeds GitHub CLI 2.90.0 or later. Use --scope user to install for every repository.
npx skills
npx skills add getsentry/skills@a582c51ee29d0f35e6ac321340796f77d43da733 --skill code-reviewPinned to the commit we reviewed. The CLI asks which agents to install for; add -g to install for your user instead of this project.
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
a582c51the 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.
---
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/)Related skills
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.
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.
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.
Guides and recipes that use Code review (Sentry)
- Code review with Claude Code on every pull request
Write your checklist once, dry-run it locally, then review every pull request in GitHub Actions and post the findings.
- Agent Skill best practices: nine design patterns with real examples
Agent skill best practices as nine design patterns, from checklists and routers to script-backed and gated skills, each with a real example and when to use it.
- AI code review
Using models to review pull requests, and reviewing AI-written code critically.