code-review · getsentry — Claude Code skill: Sentry-style PR review
A skill that reviews pull requests and code changes against Sentry engineering practices: security, performance, tests, design.
npx skills add getsentry/skills --skill code-review -a claude-codeWhat code-review does
The skill hands the agent a checklist to work through on a diff. It starts with defects: possible exceptions, null dereferences, out-of-bounds access, unbounded O(n²) work, N+1 queries, needless allocations. It also looks for side effects that break other components and for breaking API changes with no migration path. Complex Django ORM queries are on the list too.
Design comes next. Do the component interactions make sense, does the change fit the existing architecture, does it conflict with current requirements? Tests get checked for real requirements and edge cases, and heavy branching or looping inside test code is treated as a smell. Database schema changes, API contract changes, new libraries, and performance- or security-sensitive paths get flagged for a senior engineer.
Feedback tone is spelled out: polite, with actionable suggestions, and uncertain points phrased as questions. Approve once only minor issues remain, and don't block a PR over stylistic preference. Worked examples cover Python/Django, TypeScript/React and SQL injection. The checklist is written for Sentry projects, so expect to drop some items in your own repo.
What it helps with
- catch an N+1 query in Django before merge
- check whether a change breaks API backwards compatibility
- spot an injection flaw or a leaked secret
- judge whether tests cover edge cases
- route risky changes to a senior reviewer
Example prompts for the agent
- Review this pull request against the code-review checklist
- Check the changes in
views.pyfor N+1 queries and performance issues - Look at this diff for security problems: injection, XSS, access control
How to install code-review
1Skills CLI (Vercel)
npx skills add getsentry/skills --skill code-review -a claude-code2Manually: put the files in place
~/.claude/skills/code-review/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/code-review/
1Skills CLI (Vercel)
npx skills add getsentry/skills --skill code-review -a codex2Manually: put the files in place
.agents/skills/code-review/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add getsentry/skills --skill code-review -a cursor2Manually: put the files in place
.cursor/skills/code-review/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install getsentry/skills code-review2Manually: put the files in place
.github/skills/code-review/SKILL.md1Skills CLI (Vercel)
npx skills add getsentry/skills --skill code-review -a gemini-cli2Platform CLI
gemini skills install https://github.com/getsentry/skills --path skills/code-reviewManually: put the files in place
.devin/skills/code-review/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add getsentry/skills --skill code-review -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about code-review
How do I install code-review in Claude?
Run npx skills add getsentry/skills --skill code-review -a claude-code. The skill lands in ~/.claude/skills/code-review/SKILL.md.
What does code-review do?
It walks a diff through the Sentry checklist: runtime errors, performance, side effects, backwards compatibility, security, design and test coverage. You get concrete suggestions instead of vague criticism.
Does it work outside Sentry projects?
The checklist encodes Sentry's practices and some items tie into their process. In your own repo, keep the parts that match your review rules.
Source text
SKILL.md · Apache-2.0
---
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/)
© getsentry · Apache-2.0 · getsentry/skills
Similar skills
All skills for Code review and refactoring →code-review by other authors comes first.