review
Skill4 starsChanged 4 months agoMITView on GitHub
5-pass structured code review — correctness, security, performance, readability, consistency
192 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- microsoft/veronatheir own version, first seen Nov 8, 2026
- microsoft/FluidFrameworktheir own version, first seen Nov 8, 2026
- charliee1w/consolidation-memorytheir own version, first seen Nov 8, 2026
- jisuzzzz/haechitheir own version, first seen Nov 8, 2026
- apokamo/kajitheir own version, first seen Nov 8, 2026
- dirien/yet-another-agent-harnesstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use close-spec, design-with-images and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
dzhngSkillclose-spec
When a spec under specs/<feature>/ is done shipping (a write-spec build, or any planned task that produced a spec), archive it to specs/done/ and rewrite it from a build-plan into a durable rationale — the why, the principles, the invariants — pointing back to the real code for the how. Use when implementation has landed and the plan no longer matches what shipped, or the user says a feature/spec is finished. Pairs with [write-spec](../write-spec/SKILL.md) (the plan this closes) and [review](../review/SKILL.md) (run before closing).
Also in 5 projects that use this
dzhngSkilldesign-with-images
Explore UI and visual design with image generation, then iterate the real implementation against the user-selected concept. Use when brainstorming visual directions, offering mockup variants, or implementing an approved generated design; do not stop at the mockups or the first code approximation.
Also in 5 projects that use this
LambenthanSkilldaily-arxiv
每日从 arXiv 拉取新论文,过滤相关性,auto-ingest 高优先级论文,检测 SOTA 更新
Also in 5 projects that use this
LambenthanSkillexp-eval
实验判决门:Review LLM 独立评判实验结果 → 4 种判决路径 → 自动更新 claims confidence、ideas status、graph edges
Also in 5 projects that use this
- +3 more from dzhng
- +5 more from Lambenthan
Other versions192 projects use a version of this.
Word for word · 1
- SethGammon/Citadel★ 927100% same
Edited · 1
- SethGammon/Armory★ 1942% same
Wrote their own version · 190
- garrytan/gstack★ 141ksame name
- ansible/ansible★ 71ksame name
- docling-project/docling★ 70ksame name
- traefik/traefik★ 65ksame name
- ClickHouse/ClickHouse★ 51ksame name
- temporalio/temporal★ 24ksame name
- tisfeng/Easydict★ 15ksame name
- juicedata/juicefs★ 15ksame name
- elie222/inbox-zero★ 13ksame name
- gitkraken/vscode-gitlens★ 10ksame name
180 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository50 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- architectSkill
- archonSkill
- ascii-diagramSkill
- autopilotSkill
- costSkill
- create-appSkill
- create-skillSkill
- daemonSkill
- dashboardSkill
- decision-mapSkill
- deploy-stewardSkill
- designSkill
- doc-genSkill
- doSkill
- evolveSkill
- experimentSkill
- fleetSkill
- grillSkill
- housecleanSkill
- improveSkill
- infra-auditSkill
- learnSkill
- live-previewSkill
- loopSkill
- mapSkill
- marshalSkill
- merge-reviewSkill
- organizeSkill
- postmortemSkill
- prdSkill
- pr-watchSkill
- qaSkill
- refactorSkill
- research-fleetSkill
- researchSkill
- scaffoldSkill
- scheduleSkill
- session-handoffSkill
- setupSkill
- systematic-debuggingSkill
- telemetrySkill
- test-genSkill
- triageSkill
- unharnessSkill
- verifySkill
- watchSkill
- wikiSkill
- workspaceSkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 7 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 156 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
No argument defaults to staged + unstaged changes (git diff HEAD)
- Very specific: line 47
Read CLAUDE.md, .eslintrc*, tsconfig.json, .prettierrc*, or equivalent config at repo root.
- Distinctive: line 51
Run each pass across ALL files.
- Very specific: line 104
Every finding must include: File (absolute path), Line, Severity (CRITICAL / WARNING / INFO), Finding (one sentence), Code (problematic …
- Distinctive: line 129
Every finding is actionable — no "consider" without a concrete fix.
- Distinctive: line 130
No false positives: verify the "bug" isn't handled elsewhere, the "unused import" isn't in a type annotation, the "missing null check" …
- Distinctive: line 132
No linter-catchable findings (missing semicolons, indentation).
- Distinctive: line 179
If the user provided a diff range, also note which findings are in new/changed code vs.
- Distinctive: line 181
Do not offer to fix anything unless asked.
“Common” is measured: kept by at least 6 in 10 of the 156 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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~3or/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.parseon untrusted input without schema validation,pickle.loads,yaml.loadwithout 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 = conditional problems or maintenance burden; INFO = minor clarity/style. Group by pass, sort by severity within each pass. If a pass finds nothing: **Pass N ({name})**: No findings.
Step 5 — Produce verdict
Count findings across all passes:
| Verdict | Criteria |
| PASS | 0 critical, 3 or fewer warnings |
| CONDITIONAL | 0 critical, more than 3 warnings |
| FAIL | Any critical finding |
Output the verdict with a one-line rationale and the finding counts.
Contextual Gates
Disclosure: "Running structured code review. Read-only — no files modified." Reversibility: green — read-only 5-pass review; no files modified Trust gates:
- Any: run review on any target; findings are advisory
Quality Gates
- Every finding is actionable — no "consider" without a concrete fix.
- No false positives: verify the "bug" isn't handled elsewhere, the "unused import" isn't in a type annotation, the "missing null check" isn't guarded by the caller.
- Severity is calibrated — style nit is never CRITICAL, SQL injection is never INFO.
- No linter-catchable findings (missing semicolons, indentation). Focus on semantic issues.
- Line numbers are accurate — verify against file content.
Fringe Cases
- No diff vs. main: output "No diff found. Confirm branch or specify base ref."
- Binary files: skip; note as "(skipped: binary)".
- Diff >500 lines: warn; note limitation in verdict.
Exit Protocol
Deliver the review in this structure:
## Code Review: {target}
**Scope**: {N files, M total lines} | **Mode**: {file | directory | diff}
---
### Pass 1: Correctness
{findings or "No findings."}
### Pass 2: Security
{findings or "No findings."}
### Pass 3: Performance
{findings or "No findings."}
### Pass 4: Readability
{findings or "No findings."}
### Pass 5: Consistency
{findings or "No findings."}
---
## Verdict: {PASS | CONDITIONAL | FAIL}
{one-line rationale}
| Severity | Count |
|---|---|
| Critical | N |
| Warning | N |
| Info | N |If the user provided a diff range, also note which findings are in new/changed code vs. pre-existing code surfaced by context — the user should prioritize new-code findings.
Do not offer to fix anything unless asked. The review is the deliverable.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

