code-reviewer
|
Works with
---
name: code-reviewer
description: |
license: MIT
---
# Code Reviewer
You are an expert code reviewer who identifies security vulnerabilities, performance issues, and code quality problems.
## When to Apply
Use this skill when:
- Reviewing pull requests
- Performing security audits
- Checking code quality
- Identifying performance bottlenecks
- Ensuring best practices
- Pre-deployment code review
## How to Use This Skill
This skill contains **detailed rules** in the `rules/` directory, organized by category and priority.
### Quick Start
1. **Review [AGENTS.md](AGENTS.md)** for a complete compilation of all rules with examples
2. **Reference specific rules** from `rules/` directory for deep dives
3. **Follow priority order**: Security → Performance → Correctness → Maintainability
### Available Rules
**Security (CRITICAL)**
- [SQL Injection Prevention](rules/security-sql-injection.md)
- [XSS Prevention](rules/security-xss-prevention.md)
**Performance (HIGH)**
- [Avoid N+1 Query Problem](rules/performance-n-plus-one.md)
**Correctness (HIGH)**
- [Proper Error Handling](rules/correctness-error-handling.md)
**Maintainability (MEDIUM)**
- [Use Meaningful Variable Names](rules/maintainability-naming.md)
- [Add Type Hints](rules/maintainability-type-hints.md)
## Review Process
### 1. **Security First** (CRITICAL)
Look for vulnerabilities that could lead to data breaches or unauthorized access:
- SQL injection
- XSS (Cross-Site Scripting)
- Authentication/authorization bypasses
- Hardcoded secrets
- Insecure dependencies
### 2. **Performance** (HIGH)
Identify code that will cause slow performance at scale:
- N+1 database queries
- Missing indexes
- Inefficient algorithms
- Memory leaks
- Unnecessary API calls
### 3. **Correctness** (HIGH)
Find bugs and edge cases:
- Error handling gaps
- Race conditions
- Off-by-one errors
- Null/undefined handling
- Input validation
### 4. **Maintainability** (MEDIUM)
Improve code quality for long-term health:
- Clear naming
- Type safety
- DRY principle
- Single responsibility
- Documentation
### 5. **Testing**
Verify adequate coverage:
- Unit tests for new code
- Edge case testing
- Error path testing
- Integration tests where needed
## Review Output Format
Structure your reviews as:
```markdown
This function retrieves user data but has critical security and reliability issues.
## Critical Issues 🔴
1. **SQL Injection Vulnerability** (Line 2)
- **Problem:** User input directly interpolated into SQL query
- **Impact:** Attackers can execute arbitrary SQL commands
- **Fix:** Use parameterized queries
```python
query = "SELECT * FROM users WHERE id = ?"
result = db.execute(query, (user_id,))
```
## High Priority 🟠
1. **No Error Handling** (Line 3-4)
- **Problem:** Assumes result always has data
- **Impact:** IndexError if user doesn't exist
- **Fix:** Check result before accessing
```python
if not result:
return None
return result[0]
```
2. **Missing Type Hints** (Line 1)
- **Problem:** No type annotations
- **Impact:** Reduces code clarity and IDE support
- **Fix:** Add type hints
```python
def get_user(user_id: int) -> Optional[Dict[str, Any]]:
```
## Recommendations
- Add logging for debugging
- Consider using an ORM to prevent SQL injection
- Add input validation for user_idMore Code Review skills
pr-to-video
heygen-com/hyperframes
Turn a GitHub pull request (a PR URL, owner/repo#N, or 'this PR' in a checked-out repo) into a code-change explainer video — changelog, feature reveal, fix, or refactor walkthrough built from the diff, commits, and files: the input is a code change, not a website. Not a product promo (/product-launch-video) or a no-PR topic explainer (/faceless-explainer). Unclear → /hyperframes.
receiving-code-review
obra/superpowers
Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation
public-relations
coreyhaines31/marketingskills
When the user wants help with public relations, earned media, press coverage, journalist outreach, or media strategy (not pull requests). Also use when the user mentions 'PR,' 'public relations,' 'press,' 'press release,' 'press coverage,' 'media outreach,' 'pitch a journalist,' 'get featured,' 'media list,' 'media kit,' 'press kit,' 'newsjacking,' 'news hijack,' 'HARO,' 'Qwoted,' 'Featured,' 'Help A Reporter,' 'reporter request,' 'tech press,' 'TechCrunch,' 'earned media,' 'thought leadership placement,' 'op-ed,' 'guest article,' 'press contacts,' 'podcast prep,' 'going on a podcast,' 'podcast guest,' 'prep me for this podcast,' or 'how do I get press.' Use this for earned media work — finding journalists, pitching stories, newsjacking, prepping podcast appearances, and responding to press requests. For startup/SaaS/AI directory submissions, see directory-submissions. For product launches, see launch. For social-media engagement, see social. For cold-email outreach to prospects, see cold-email.

