---
description: "Code review — local uncommitted changes or GitHub PR (pass PR number/URL for PR mode)"
---

# Code Review

Review code quality and security of uncommitted changes or a GitHub Pull Request.

## Usage

`/code-review [pr-number | pr-url]`

- Without arguments: review local uncommitted changes (`git diff HEAD`)
- With PR number or URL: review a GitHub Pull Request

## Local Review

1. Run `git diff --name-only HEAD` to list changed files
2. Read each changed file in full
3. Check for security issues (credentials, injection, XSS, input validation)
4. Check for code quality issues (large functions, deep nesting, missing error handling)
5. Check for testing gaps

## PR Review

1. Fetch PR diff with `gh pr view <NUMBER>` and `gh pr diff <NUMBER>`
2. Read changed files in full
3. Validate with project-appropriate tools (typecheck, lint, test, build)
4. Post review with severity-graded findings

## Related

- Skill: `skill://requesting-code-review`
- Command: `/security-scan`
