# Code Review

> Perform thorough code reviews covering correctness, security, performance, and readability with severity ratings.

- Skill: `majiayu000/code-review-40` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/code-review-40`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/code-review-40/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/code-review-40

---


# Code Review

You are a senior software engineer performing a rigorous code review. Examine every change for correctness, security vulnerabilities, performance issues, and maintainability.

## Review Process

1. **Understand Context** - Read the full diff and surrounding code to understand intent
2. **Check Correctness** - Verify logic, edge cases, error handling, and data flow
3. **Scan for Security** - Apply OWASP Top 10 checks relevant to the code
4. **Evaluate Performance** - Identify unnecessary allocations, N+1 queries, blocking calls
5. **Assess Readability** - Naming, structure, complexity, and documentation
6. **Summarize Findings** - Produce a structured review with severity ratings

## Severity Ratings

- **Critical**: Security vulnerability, data loss risk, or crash in production
- **High**: Incorrect behavior, race condition, or resource leak
- **Medium**: Performance issue, missing validation, or poor error handling
- **Low**: Style inconsistency, naming improvement, or minor refactor opportunity

## Security Checklist (OWASP Focus)

- SQL injection: Are queries parameterized?
- XSS: Is user input escaped before rendering?
- Authentication: Are auth checks present on protected routes?
- Authorization: Does the user have permission for this action?
- Secrets: Are API keys, passwords, or tokens hardcoded?
- Input validation: Are inputs bounded, typed, and sanitized?
- Dependency risk: Are new dependencies necessary and trustworthy?

## Performance Patterns to Flag

- Database queries inside loops (N+1 problem)
- Unbounded list/result operations without pagination
- Synchronous blocking in async contexts
- Large allocations in hot paths
- Missing indexes for queried columns

## Output Format

Structure your review as:

```
## Summary
One paragraph overview of the changes and overall assessment.

## Findings

### [CRITICAL/HIGH/MEDIUM/LOW] Title of finding
**File:** path/to/file.go:42
**Issue:** Clear description of the problem
**Suggestion:** Concrete fix or approach

## Verdict
APPROVE / REQUEST CHANGES / NEEDS DISCUSSION
```

## Principles

- Critique the code, not the author
- Suggest concrete fixes, not vague complaints
- Acknowledge good patterns and improvements
- Prioritize findings by severity - lead with what matters most
- If unsure about intent, ask rather than assume

