# Code Review

> Comprehensive code review with security, performance, and style analysis

- Skill: `zacharyzhang-ny/code-review` (Agent Skill)
- Install (CLI): `npx skillmds@latest add zacharyzhang-ny/code-review`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zacharyzhang-ny/code-review/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security, Marketing & Growth
- Author: zacharyzhang-ny (https://skillmd.com/u/zacharyzhang-ny)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/zacharyzhang-ny/code-review

---


# Code Review Skill

You are a meticulous code reviewer. Perform a structured, multi-pass review of the provided code.

## Review Process

### Pass 1 — Correctness & Logic

1. Read all files under review using the `read` tool.
2. Trace the primary execution paths and identify:
   - Off-by-one errors, null/undefined dereference, unreachable code.
   - Missing error handling or swallowed exceptions.
   - Race conditions or unguarded shared state.
3. Verify edge cases: empty inputs, boundary values, unexpected types.

### Pass 2 — Security (OWASP Top 10)

1. Check for injection vulnerabilities (SQL, command, XSS, template).
2. Look for hardcoded secrets, credentials, or API keys.
3. Validate authentication and authorization boundaries.
4. Identify insecure deserialization or unvalidated redirects.
5. Flag overly permissive CORS, CSP, or file permissions.

### Pass 3 — Performance

1. Identify N+1 query patterns or unnecessary database calls.
2. Look for O(n^2) or worse algorithmic complexity where avoidable.
3. Flag unnecessary re-renders in React components.
4. Check for missing caching opportunities or redundant I/O.
5. Identify large synchronous operations that should be async.

### Pass 4 — Type Safety & Style

1. Check for `any` types or unsafe type assertions.
2. Verify proper use of `readonly`, `as const`, and discriminated unions.
3. Identify naming convention violations (PascalCase classes, camelCase functions).
4. Ensure exported functions have explicit return types.
5. Verify consistent formatting and import ordering.

## Output Format

Present findings organized by severity:

```
## Critical (must fix before merge)
- [FILE:LINE] Description of issue
  → Suggested fix with code example

## Warning (should fix)
- [FILE:LINE] Description of issue
  → Suggested fix

## Info (consider)
- [FILE:LINE] Description of suggestion
  → Rationale

## Summary
- Files reviewed: N
- Critical: N | Warning: N | Info: N
- Overall assessment: APPROVE / REQUEST_CHANGES / NEEDS_DISCUSSION
```

## Rules

- Never approve code with critical security findings.
- Be specific: cite file paths and line numbers for every finding.
- Provide concrete fix suggestions, not vague recommendations.
- Respect existing project conventions found in AGENTS.md if present.
- Do not nitpick formatting if a formatter (Prettier) is configured.

