agentleFS
allysgrandiose674allysgrandiose674/Armory/review/SKILL.md

review

Skill1 starsChanged 8 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

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.
  • dzhngSkill

    close-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

  • dzhngSkill

    design-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

  • LambenthanSkill

    daily-arxiv

    每日从 arXiv 拉取新论文,过滤相关性,auto-ingest 高优先级论文,检测 SOTA 更新

    Also in 5 projects that use this

  • LambenthanSkill

    exp-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

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 11 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 156 edited versions we read keep these.

  • 11

    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
  1. Distinctive:

    No argument defaults to staged + unstaged changes (git diff HEAD)

    line 22
  2. Distinctive:

    Before reviewing, check for project-level style guides and conventions:

    line 42
  3. Very specific:

    Read CLAUDE.md, .eslintrc*, tsconfig.json, .prettierrc*, pyproject.toml, Cargo.toml, or equivalent config files at the repo root

    line 43
  4. Distinctive:

    Run each pass across ALL files in scope.

    line 49
  5. Distinctive:

    API patterns: Do new functions/endpoints follow the existing signatures and return types?

    line 108
  6. Distinctive:

    Naming conventions: Do new identifiers follow the project's established patterns?

    line 109
  7. Distinctive:

    Every finding MUST include:

    line 114
  8. Very specific:

    If a pass finds nothing, state: Pass N ({name}): No findings.

    line 129
  9. Distinctive:

    Before delivering the review:

    line 145
  10. Distinctive:

    Findings don't duplicate linter output: Don't flag things the project's linter/formatter would catch (missing semicolons, wrong …

    line 150
  11. Distinctive:

    Line numbers are accurate: Verify each cited line number against the file content.

    line 151
  12. Distinctive:

    If the user provided a diff range, also note which findings are in new/changed code vs.

    line 191
  13. Distinctive:

    Do not offer to fix anything unless asked.

    line 193

“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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Identity

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

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 from the user's input. If a diff range, run git diff to get the changed files and hunks. If a directory, glob for source files. Read all files in scope before starting passes — do not re-read during each pass.

For diff mode, also read the full file for each changed file so you have context beyond the hunks.

Step 2 — Load project conventions

Before reviewing, check for project-level style guides and conventions:

  • Read CLAUDE.md, .eslintrc*, tsconfig.json, .prettierrc*, pyproject.toml, Cargo.toml, or equivalent config files at the repo root
  • Note the project's import style, error handling patterns, naming conventions, and test patterns
  • These become the baseline for Pass 5 (Consistency). If no conventions exist, skip convention-specific findings in Pass 5 but still flag internal inconsistency within the reviewed code

Step 3 — Execute 5 passes

Run each pass across ALL files in scope. Do not skip a pass even if you think it won't find anything — confirm that explicitly.

Pass 1: Correctness

Scan for:

  • Logic errors (inverted conditions, wrong operator, incorrect boolean logic)
  • Off-by-one errors in loops, slices, and index access
  • Null/undefined dereference without guards
  • Unhandled promise rejections or missing awaits
  • Race conditions (shared mutable state accessed from async code without synchronization)
  • Type coercion bugs (loose equality, implicit conversions)
  • Resource leaks (opened connections/handles/subscriptions never closed)
  • Missing cleanup in effect hooks or lifecycle methods
  • Edge cases: empty arrays, zero values, negative numbers, very large inputs
  • State mutations that bypass the expected mutation path (e.g., direct state modification in immutable-by-convention codebases)

Pass 2: Security

Scan for OWASP Top 10 and common vulnerabilities:

  • Injection: SQL/NoSQL injection, command injection, template injection, LDAP injection — any user input reaching a query or command without parameterization
  • XSS: User input rendered as HTML without sanitization, dangerouslySetInnerHTML, innerHTML, unescaped template interpolation
  • Auth issues: Missing authentication checks on endpoints, broken access control, privilege escalation paths, JWT validation gaps
  • Secrets: API keys, tokens, passwords, or connection strings hardcoded in source (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 validation
  • 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: Known vulnerable patterns even without running npm audit (e.g., prototype pollution-prone lodash usage)

Pass 3: Performance

Scan for:

  • Algorithmic: O(n^2) or worse in paths that scale with data (nested loops over collections, repeated array scans)
  • Allocation waste: Creating objects/arrays inside hot loops or render functions that could be hoisted or cached
  • Missing memoization: Expensive derivations recomputed on every call/render when inputs haven't changed
  • N+1 queries: Database/API calls inside loops instead of batched operations
  • Bundle size: Importing entire libraries when only one function is needed (import lodash vs import get from 'lodash/get')
  • Render performance (frontend): New object/array references in render causing unnecessary child re-renders, missing React.memo on expensive children, inline function props recreated every render in hot paths
  • I/O in hot paths: Synchronous file reads, blocking operations, or layout-thrashing DOM reads (getBoundingClientRect) inside animation loops
  • Missing pagination/limits: Unbounded queries or list renders that will degrade with data growth
  • Regex catastrophe: Regexes with nested quantifiers vulnerable to ReDoS

Pass 4: Readability

Scan for:

  • Naming: Vague names (data, info, result, handle, process), misleading names (e.g., isValid that returns a string), inconsistent naming (camelCase mixed with snake_case in same file)
  • Function length: Functions over 50 lines that do multiple things and could be decomposed
  • Cognitive complexity: Deeply nested conditionals (3+ levels), complex boolean expressions without extraction to named variables
  • Dead code: Unreachable branches, commented-out code blocks, unused variables/imports/parameters
  • Misleading comments: Comments that describe what the code did before a change but no longer match, TODO/FIXME/HACK markers older than the review scope
  • Magic values: Hardcoded numbers or strings without named constants (except obvious ones like 0, 1, "", true)
  • Inconsistent abstraction levels: High-level orchestration mixed with low-level implementation details in the same function

Pass 5: Consistency

Scan against project conventions loaded in Step 2:

  • Import style: Does the code follow the project's import ordering, alias usage, and grouping?
  • Error handling pattern: Does the code use the project's standard error handling (e.g., Result types, try/catch conventions, error boundary patterns)?
  • File organization: Does the file structure match project conventions (exports at bottom, types at top, etc.)?
  • API patterns: Do new functions/endpoints follow the existing signatures and return types?
  • Naming conventions: Do new identifiers follow the project's established patterns?
  • Internal inconsistency: Even without project conventions, flag inconsistency within the reviewed code itself (e.g., some functions throw and others return null for errors in the same module)

Step 4 — Format findings

Every finding MUST include:

  • File: Absolute path
  • Line: Line number (or range)
  • Severity: CRITICAL, WARNING, or INFO
  • Finding: One sentence describing the problem
  • Code: The specific snippet (keep it short — just the problematic lines)
  • Fix: What to do about it (specific, not vague)

Severity guidelines:

  • CRITICAL: Will cause bugs, security vulnerabilities, data loss, or crashes in production
  • WARNING: Will cause problems under specific conditions, degrades performance measurably, or creates maintenance burden
  • INFO: Style improvement, minor clarity gain, or preventive suggestion

Group findings by pass, then sort by severity (critical first) within each pass.

If a pass finds nothing, state: **Pass N ({name})**: No findings.

Step 5 — Produce verdict

Count findings across all passes:

VerdictCriteria
PASS0 critical, 3 or fewer warnings
CONDITIONAL0 critical, more than 3 warnings
FAILAny critical finding

Output the verdict with a one-line rationale and the finding counts.

Quality Gates

Before delivering the review:

  1. Every finding is actionable. Re-read each finding. If it says "consider", "might want to", or "could be improved" without a specific fix, rewrite it with a concrete action.
  2. No false positives from skimming. For each finding, verify you actually read the surrounding code. Check that the "bug" isn't handled elsewhere in the same function, that the "unused import" isn't used in a type annotation, that the "missing null check" isn't guarded by the caller.
  3. Severity is calibrated. A style nit is never CRITICAL. A SQL injection is never INFO. Re-check every severity assignment.
  4. Findings don't duplicate linter output. Don't flag things the project's linter/formatter would catch (missing semicolons, wrong indentation). Focus on semantic issues.
  5. Line numbers are accurate. Verify each cited line number against the file content. A finding pointing to the wrong line is worse than no finding.

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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.