code-review
anthropics/knowledge-work-plugins
Review code changes for security, performance, and correctness issues before merging.
What is code-review?
Analyzes code diffs, pull requests, or file paths for security vulnerabilities, performance bottlenecks, correctness gaps, and maintainability concerns. Use it before merging, when checking for injection risks or N+1 queries, or to audit unfamiliar code.
- Security audit covering OWASP top 10, injection, authentication, secrets, and deserialization risks
- Performance review identifying N+1 queries, memory leaks, algorithmic complexity, and resource leaks
- Correctness checks for edge cases, race conditions, error handling, and type safety
- Maintainability assessment of naming, structure, duplication, and test coverage
- Structured output with critical issues, suggestions, and approval verdict
- Actionable recommendations with code examples
How to install code-review
npx skills add https://github.com/anthropics/knowledge-work-plugins --skill code-reviewHow to use code-review
- 1.Provide a PR URL, file path, or paste a diff directly
- 2./code-review <PR URL or file path>
- 3.Review the structured output covering security, performance, correctness, and maintainability
- 4.Address critical issues before merging; prioritize suggestions by severity and impact
- 5.Optionally connect source control, project tracker, or knowledge base for enhanced automation
Use cases
- Review a pull request URL before merging to catch security and performance issues
- Audit a code diff for SQL injection, XSS, or authentication flaws
- Check a database query for N+1 problems and missing indexes
- Verify error handling and edge case coverage in critical code paths
- Validate code against team standards when connectors are configured
- Software engineers and code reviewers
- Security-conscious development teams
- Performance-focused backend developers
- Teams using pull request workflows
code-review FAQ
The skill analyzes any code language. It focuses on universal concerns like security patterns, performance anti-patterns, and error handling rather than language-specific syntax.
Yes. Specify your concern when triggering: 'Focus on security', 'Check for N+1 queries', or 'Verify error handling' to narrow the review scope.
Yes. You can paste a diff, provide a file path, or share a PR URL directly. Connected source control, project tracker, and knowledge base tools enhance automation but are optional.
The verdict is Approve (merge safely), Request Changes (fix issues first), or Needs Discussion (clarify intent before merging).
Mention if code is in a hot path, handles sensitive data, or has specific performance requirements. Include related tests for coverage assessment.
Full instructions (SKILL.md)
Source of truth, from anthropics/knowledge-work-plugins.
name: code-review description: Review code changes for security, performance, and correctness. Trigger with a PR URL or diff, "review this before I merge", "is this code safe?", or when checking a change for N+1 queries, injection risks, missing edge cases, or error handling gaps. argument-hint: "<PR URL, diff, or file path>"
/code-review
If you see unfamiliar placeholders or need to check which tools are connected, see CONNECTORS.md.
Review code changes with a structured lens on security, performance, correctness, and maintainability.
Usage
/code-review <PR URL or file path>
Review the provided code changes: @$1
If no specific file or URL is provided, ask what to review.
How It Works
┌─────────────────────────────────────────────────────────────────┐
│ CODE REVIEW │
├─────────────────────────────────────────────────────────────────┤
│ STANDALONE (always works) │
│ ✓ Paste a diff, PR URL, or point to files │
│ ✓ Security audit (OWASP top 10, injection, auth) │
│ ✓ Performance review (N+1, memory leaks, complexity) │
│ ✓ Correctness (edge cases, error handling, race conditions) │
│ ✓ Style (naming, structure, readability) │
│ ✓ Actionable suggestions with code examples │
├─────────────────────────────────────────────────────────────────┤
│ SUPERCHARGED (when you connect your tools) │
│ + Source control: Pull PR diff automatically │
│ + Project tracker: Link findings to tickets │
│ + Knowledge base: Check against team coding standards │
└─────────────────────────────────────────────────────────────────┘
Review Dimensions
Security
- SQL injection, XSS, CSRF
- Authentication and authorization flaws
- Secrets or credentials in code
- Insecure deserialization
- Path traversal
- SSRF
Performance
- N+1 queries
- Unnecessary memory allocations
- Algorithmic complexity (O(n²) in hot paths)
- Missing database indexes
- Unbounded queries or loops
- Resource leaks
Correctness
- Edge cases (empty input, null, overflow)
- Race conditions and concurrency issues
- Error handling and propagation
- Off-by-one errors
- Type safety
Maintainability
- Naming clarity
- Single responsibility
- Duplication
- Test coverage
- Documentation for non-obvious logic
Output
## Code Review: [PR title or file]
### Summary
[1-2 sentence overview of the changes and overall quality]
### Critical Issues
| # | File | Line | Issue | Severity |
|---|------|------|-------|----------|
| 1 | [file] | [line] | [description] | 🔴 Critical |
### Suggestions
| # | File | Line | Suggestion | Category |
|---|------|------|------------|----------|
| 1 | [file] | [line] | [description] | Performance |
### What Looks Good
- [Positive observations]
### Verdict
[Approve / Request Changes / Needs Discussion]
If Connectors Available
If ~~source control is connected:
- Pull the PR diff automatically from the URL
- Check CI status and test results
If ~~project tracker is connected:
- Link findings to related tickets
- Verify the PR addresses the stated requirements
If ~~knowledge base is connected:
- Check changes against team coding standards and style guides
Tips
- Provide context — "This is a hot path" or "This handles PII" helps me focus.
- Specify concerns — "Focus on security" narrows the review.
- Include tests — I'll check test coverage and quality too.
Related skills
More from anthropics/knowledge-work-plugins and the wider catalog.

comp-analysis
Benchmark compensation, analyze pay bands, and model equity grants for hiring and retention.

competitive-brief
Research competitors and identify positioning gaps, messaging opportunities, and market threats.

competitive-intelligence
Analyze competitive wins, losses, and battlecards to win more deals against named competitors.

compliance-check
Identify regulations, required approvals, and compliance risks before launching features or initiatives.

compliance-tracking
Track compliance requirements, controls, and audit readiness across SOC 2, ISO 27001, GDPR, and other frameworks.

compose-outreach
Generate personalized outreach messages using Common Room signals and web research.