Review this codebase for bugs, design issues, and code cleanliness problems. Be specific and cite file paths and line numbers.
Scope the review to $ARGUMENTS if provided, otherwise review the entire project. Examples: src/auth/, lib/api.ts, security, tests/.
Skip vendored dependencies, build output, generated/minified code, and lockfiles (e.g. node_modules/, dist/, build/, vendor/, *.min.js, package-lock.json, go.sum).
What to look for
Prioritize by severity:
| Severity |
Category |
| Critical |
Security vulnerabilities, data loss, crashes |
| High |
Correctness bugs, missing error handling, race conditions |
| Medium |
Design issues, code smells, missing validation |
| Low |
Style inconsistencies, naming, minor cleanup |
Common patterns worth checking for (not exhaustive):
- Correctness — off-by-one/boundary errors, null/undefined derefs, wrong comparison (
== vs ===, identity vs value), operator-precedence mistakes.
- Error handling — swallowed exceptions, ignored return/error values, bare
except/catch, no rollback on partial failure.
- Resources — leaked handles/connections/goroutines, missing
defer/finally/close, unbounded growth.
- Concurrency — unsynchronized shared state, races, deadlocks, missing
await on async calls.
- Security — unvalidated input, injection (SQL/command/path), secrets in source, missing authz checks.
- API/contract — callers not updated for a signature change, nullable returns treated as non-null, silent type coercion.
Process
For each issue found:
- Check for duplicates in both GitHub issues (
gh issue list) and the local .issues/ directory. GitHub issues lack structured file:line metadata — search titles and bodies for the file path instead (gh issue list --search "<path>"). If gh is unavailable, unauthenticated, or errors (non-GitHub, offline, or unconfigured repo), skip the GitHub dedup step and note this in the final summary instead of failing.
- Skip if a matching issue already exists — match by the same
file:line plus the same issue category (e.g., another "missing null check" at that location)
- Otherwise, create a markdown file in
.issues/ with a descriptive kebab-case filename
Create .issues/ if it doesn't already exist. For very large scopes that would produce many files, prioritize Critical/High severity issues first, and traverse deliberately — entry points and core modules first, then remaining directories one at a time — so coverage is systematic rather than a random sample.
Each issue file should follow this format:
# Title
**Severity:** critical | high | medium | low
**Location:** `file:line`
## Description
What's wrong and why it matters.
## Suggested fix
Concrete recommendation.
Summary
After creating all issue files, output a summary:
| # | Severity | File:Line | Issue |
|---|----------|-----------|-------|
| 1 | high | src/a.ts:42 | Missing null check |
| 2 | medium | lib/b.py:17 | Bare except clause |
Total: {N} issues ({critical} critical, {high} high, {medium} medium, {low} low)
Files created in .issues/
Do not use when
- Reviewing harness customizations (skills, hooks, settings) — use
/doctor, or skill-cleaner for skill hygiene
- Reviewing a specific staged or branch diff — use
/code-review
1---2name: code-audit-23description: Reviews a codebase for bugs, design issues, and code cleanliness problems with specific file paths and line numbers. Use when auditing code quality, finding bugs, doing a code review, or reviewing a project for issues. Writes issues to `.issues/`.4---56Review this codebase for bugs, design issues, and code cleanliness problems. Be specific and cite file paths and line numbers.78Scope the review to `$ARGUMENTS` if provided, otherwise review the entire project. Examples: `src/auth/`, `lib/api.ts`, `security`, `tests/`.910Skip vendored dependencies, build output, generated/minified code, and lockfiles (e.g. `node_modules/`, `dist/`, `build/`, `vendor/`, `*.min.js`, `package-lock.json`, `go.sum`).1112## What to look for1314Prioritize by severity:1516| Severity | Category |17| ------------ | --------------------------------------------------------- |18| **Critical** | Security vulnerabilities, data loss, crashes |19| **High** | Correctness bugs, missing error handling, race conditions |20| **Medium** | Design issues, code smells, missing validation |21| **Low** | Style inconsistencies, naming, minor cleanup |2223Common patterns worth checking for (not exhaustive):2425- **Correctness** — off-by-one/boundary errors, null/undefined derefs, wrong comparison (`==` vs `===`, identity vs value), operator-precedence mistakes.26- **Error handling** — swallowed exceptions, ignored return/error values, bare `except`/`catch`, no rollback on partial failure.27- **Resources** — leaked handles/connections/goroutines, missing `defer`/`finally`/close, unbounded growth.28- **Concurrency** — unsynchronized shared state, races, deadlocks, missing `await` on async calls.29- **Security** — unvalidated input, injection (SQL/command/path), secrets in source, missing authz checks.30- **API/contract** — callers not updated for a signature change, nullable returns treated as non-null, silent type coercion.3132## Process3334For each issue found:35361. Check for duplicates in both GitHub issues (`gh issue list`) and the local `.issues/` directory. GitHub issues lack structured `file:line` metadata — search titles and bodies for the file path instead (`gh issue list --search "<path>"`). If `gh` is unavailable, unauthenticated, or errors (non-GitHub, offline, or unconfigured repo), skip the GitHub dedup step and note this in the final summary instead of failing.372. Skip if a matching issue already exists — match by the same `file:line` plus the same issue category (e.g., another "missing null check" at that location)383. Otherwise, create a markdown file in `.issues/` with a descriptive kebab-case filename3940Create `.issues/` if it doesn't already exist. For very large scopes that would produce many files, prioritize Critical/High severity issues first, and traverse deliberately — entry points and core modules first, then remaining directories one at a time — so coverage is systematic rather than a random sample.4142Each issue file should follow this format:4344```text45# Title4647**Severity:** critical | high | medium | low48**Location:** `file:line`4950## Description5152What's wrong and why it matters.5354## Suggested fix5556Concrete recommendation.57```5859## Summary6061After creating all issue files, output a summary:6263```text64| # | Severity | File:Line | Issue |65|---|----------|-----------|-------|66| 1 | high | src/a.ts:42 | Missing null check |67| 2 | medium | lib/b.py:17 | Bare except clause |6869Total: {N} issues ({critical} critical, {high} high, {medium} medium, {low} low)70Files created in .issues/71```7273## Do not use when7475- Reviewing harness customizations (skills, hooks, settings) — use `/doctor`, or `skill-cleaner` for skill hygiene76- Reviewing a specific staged or branch diff — use `/code-review`