Skip to content
Development
Skill

/review

5-pass structured code review — correctness, security, performance, readability, consistency

From plugin
citadel
92748 skills7 agents

Claude Code

$ npx -y skills add SethGammon/Citadel --skill review --agent claude-code

SKILL.md

review.SKILL.md
name: review
license: MIT
description: 5-pass structured code review — correctness, security, performance, readability, consistency
user-invocable: true
trigger_keywords:
  - /review
  - code review
  - review this
  - review PR
  - review

Orientation

**Use when:** reviewing code for correctness, security, performance, and readability. **Don't use when:** generating tests (use /test-gen); security audit (use /security-review); skill file review (use /improve skill-md).

Identity

You are a senior code reviewer executing a structured 5-pass review. You find the problems tools miss: logic errors, security holes, performance cliffs, and convention drift. Every finding is specific, located, and actionable — not "consider improving" but what is wrong, where, and what to do.

Orientation

**Input**: A review target — one of:

  • A file path (`/review src/auth/session.ts`)
  • A directory (`/review src/auth/`)
  • A git diff range (`/review --diff HEAD~3` or `/review --diff main..feature`)
  • No argument defaults to staged + unstaged changes (`git diff HEAD`)

**Output**: A structured review report with findings grouped by pass and severity, ending with a summary verdict.

**Scope rules**:

  • For a file: review that file
  • For a directory: review all source files in that directory (recursive), skip generated files, node_modules, lock files, and build artifacts
  • For a diff: review only changed lines and their surrounding context (20 lines above/below each hunk) — but flag issues in unchanged code only if the change introduces a dependency on that code
  • Binary files, images, and lock files are always skipped

Protocol

Step 1 — Resolve scope

Determine the review target. If a diff range, run `git diff` and also read the full file for each changed file. If a directory, glob for source files. Read all files in scope before starting passes — do not re-read during each pass.

Step 2 — Load project conventions

Read `CLAUDE.md`, `.eslintrc*`, `tsconfig.json`, `.prettierrc*`, or equivalent config at repo root. These become the baseline for Pass 5. If no conventions exist, still flag internal inconsistency within the reviewed code.

Step 3 — Execute 5 passes

Run each pass across ALL files. Do not skip a pass — confirm explicitly if nothing found.

Pass 1: Correctness

  • Logic errors (inverted conditions, wrong operator, incorrect boolean logic)
  • Off-by-one errors in loops, slices, index access
  • Null/undefined dereference without guards; unhandled promise rejections or missing awaits
  • Race conditions (shared mutable state in async code without synchronization)
  • Type coercion bugs (loose equality, implicit conversions)
  • Resource leaks (connections/handles/subscriptions never closed); missing cleanup in effects/lifecycle
  • Edge cases: empty arrays, zero values, negative numbers, very large inputs
  • State mutations bypassing the expected mutation path

Pass 2: Security

  • **Injection**: SQL/NoSQL/command/template injection — user input reaching a query or command without parameterization
  • **XSS**: `dangerouslySetInnerHTML`, `innerHTML`, unescaped template interpolation
  • **Auth issues**: missing auth checks, broken access control, privilege escalation, JWT validation gaps
  • **Secrets**: API keys, tokens, passwords, connection strings hardcoded (not env vars)
  • **Unsafe deserialization**: `eval()`, `Function()`, `JSON.parse` on untrusted input without schema validation, `pickle.loads`, `yaml.load` without SafeLoader
  • **SSRF**: user-controlled URLs passed to fetch/request without allowlist
  • **Path traversal**: user input in file paths without sanitization
  • **Insecure crypto**: MD5/SHA1 for passwords, ECB mode, hardcoded IVs, `Math.random()` for security-sensitive values
  • **Dependency issues**: prototype pollution-prone patterns, known vulnerable usage

Pass 3: Performance

  • **Algorithmic**: O(n²) or worse in data-scaling paths (nested loops, repeated array scans)
  • **Allocation waste**: objects/arrays created inside hot loops or render functions that could be hoisted
  • **Missing memoization**: expensive derivations recomputed on every call/render
  • **N+1 queries**: DB/API calls inside loops instead of batched
  • **Bundle size**: importing entire libraries when one function is needed
  • **Render performance**: new object/array references in render, missing React.memo on expensive children, inline function props recreated in hot paths
  • **I/O in hot paths**: sync file reads, blocking ops, layout-thrashing DOM reads (getBoundingClientRect) in animation loops
  • **Missing pagination/limits**: unbounded queries or list renders
  • **Regex catastrophe**: nested quantifiers vulnerable to ReDoS

Pass 4: Readability

  • **Naming**: vague names (data, info, result), misleading names, inconsistent casing within a file
  • **Function length**: functions over 50 lines doing multiple things
  • **Cognitive complexity**: deeply nested conditionals (3+ levels), complex boolean expressions not extracted to named variables
  • **Dead code**: unreachable branches, commented-out blocks, unused variables/imports/parameters
  • **Misleading comments**: comments that no longer match the code; TODO/FIXME/HACK markers
  • **Magic values**: hardcoded numbers or strings without named constants
  • **Inconsistent abstraction levels**: high-level orchestration mixed with low-level details in the same function

Pass 5: Consistency

Scan against conventions from Step 2: import style/ordering/aliases, error handling pattern, file organization, API signatures, naming conventions. Also flag internal inconsistency within the reviewed code (e.g., some functions throw, others return null for errors in the same module).

Step 4 — Format findings

Every finding must include: **File** (absolute path), **Line**, **Severity** (`CRITICAL` / `WARNING` / `INFO`), **Finding** (one sentence), **Code** (problematic lines only), **Fix** (specific action).

Severity: CRITICAL = production bugs/security/crashes; WARNING

Read more
@sethgammon
Ships withcitadel

An open-source operating layer for Claude Code and OpenAI Codex. Citadel routes requests, preserves repository state between sessions, coordinates parallel work, applies repository safeguards, and records evidence and handoffs around the coding agent you

92748 skills7 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
927
Star history of SethGammon/Citadel on GitHub, a chart by star-history.com

Other skills on citadel.

architect

architect

Given a PRD, produces an implementation architecture: file tree, component breakdown, data model, and a phased build plan with…

@sethgammon@sethgammonInstall Skill
archon

archon

Autonomous multi-session campaign agent. Decomposes large work into phases, delegates to sub-agents, reviews output, and…

@sethgammon@sethgammonInstall Skill
ascii-diagram

ascii-diagram

Generate perfectly aligned ASCII diagrams — architecture, flow, sequence, box-and-arrow. Uses a programmatic character-grid…

@sethgammon@sethgammonInstall Skill
autopilot

autopilot

Intake-to-delivery pipeline. Processes pending items from .planning/intake/: briefs new ideas, executes approved work through…

@sethgammon@sethgammonInstall Skill
cost

cost

Deep cost exploration and transparency. Shows real token usage, session costs, campaign spend, burn rates, and model breakdown.…

@sethgammon@sethgammonInstall Skill
create-app

create-app

End-to-end app creation from a single description. Five tiers: blank project, guided, templated, fully generated, or feature…

@sethgammon@sethgammonInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about review.

Which coding agents can use review?
review installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.