agentleFS
leekleek/agent-skills/skills/code-review/SKILL.md

code-review

Skill3 starsChanged 2 months agoMITView on GitHub

Three-axis review of the diff since a fixed point: Correctness (bugs, failure modes, security), Standards (repo conventions) and Spec (ticket/PRD fidelity). Use when the user wants to review a branch, PR, WIP changes, or asks to \"review since X\".

188 other projects use a version of this, 16 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use starter, media-processing and 7 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.
  • ww-w-aiSkill

    starter

    Static web development guide for beginners. Covers HTML/CSS/JavaScript and Next.js App Router basics. Project initialization with "init starter". Triggers: static website, portfolio, landing page, HTML CSS, beginner, 정적 웹, 포트폴리오, 초보자, 静的サイト, 初心者, 静态网站, 初学者, sitio web estático, site statique, statische Website, sito web statico Do NOT use for: fullstack apps (use $dynamic), enterprise (use $enterprise).

    Also in 4 projects that use this

  • mrgoonieSkill

    media-processing

    Process multimedia files with FFmpeg (video/audio encoding, conversion, streaming, filtering, hardware acceleration) and ImageMagick (image manipulation, format conversion, batch processing, effects, composition). Use when converting media formats, encoding videos with specific codecs (H.264, H.265, VP9), resizing/cropping images, extracting audio from video, applying filters and effects, optimizing file sizes, creating streaming manifests (HLS/DASH), generating thumbnails, batch processing images, creating composite images, or implementing media processing pipelines. Supports 100+ formats, hardware acceleration (NVENC, QSV), and complex filtergraphs.

    Also in 5 projects that use this

  • loulanyueSkill

    setup-ts-deep-modules

    Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.

    Also in 15 projects that use this

  • mrgoonieSkill

    aesthetic

    Create aesthetically beautiful interfaces following proven design principles. Use when building UI/UX, analyzing designs from inspiration sites, generating design images with ai-multimodal, implementing visual hierarchy and color theory, adding micro-interactions, or creating design documentation. Includes workflows for capturing and analyzing inspiration screenshots with chrome-devtools and ai-multimodal, iterative design image generation until aesthetic standards are met, and comprehensive design system guidance covering BEAUTIFUL (aesthetic principles), RIGHT (functionality/accessibility), SATISFYING (micro-interactions), and PEAK (storytelling) stages. Integrates with chrome-devtools, ai-multimodal, media-processing, ui-styling, and web-frameworks skills.

    Also in 4 projects that use this

  • AWSSkill

    ask-matt

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

    Also in 32 projects that use this

  • pahwarangerSkill

    setup-skills

    Sets up an `## Agent skills` block in AGENTS.md/CLAUDE.md and `docs/agents/` so the engineering skills know this repo's ticket tracker (GitHub or local markdown), triage label vocabulary, and domain doc layout. Run before first use of `to-tickets`, `to-prd`, `triage`, `diagnose`, `tdd`, `improve-codebase-architecture`, or `zoom-out` — or if those skills appear to be missing context about the ticket tracker, triage labels, or domain docs.

    Also in 7 projects that use this

  • +1 more from mrgoonie

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 175 edited versions we read keep these.

  • 5

    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. Very specific:

    When the caller passes a path scope (as implement does, so parallel sessions sharing one branch don't pollute the range), append it to …

    line 26
  2. Very specific:

    Before going further, confirm the fixed point resolves (git rev-parse <fixed-point>) and the diff is non-empty.

    line 28
  3. Distinctive:

    Look for the originating spec, in this order:

    line 32
  4. Distinctive:

    If nothing is found, ask the user where the spec is.

    line 37
  5. Distinctive:

    When both AGENTS.md and a harness-specific root file exist, prefer AGENTS.md for cross-harness conventions.

    line 46
  6. Distinctive:

    If sub-agents are unavailable: run the reviews inline in this session, Correctness first, then Standards, then Spec (or skip Spec when no …

    line 74
  7. Distinctive:

    If the spec is missing, skip the Spec axis and note this in the final report.

    line 90

“Common” is measured: kept by at least 6 in 10 of the 175 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

Code Review

Three-axis review of the diff between HEAD and a fixed point the user supplies:

  • Correctness: would this change break something? Bugs, failure modes (what a side effect does when it fails, repeats, or races), security, data, broken contracts, missing tests.
  • Standards: does the code conform to how this repo writes code?
  • Spec: does the code faithfully implement the originating ticket / PRD / spec?

The axes run separately so they don't pollute each other's context, then this skill aggregates their findings. Prefer parallel sub-agents when the harness supports them; otherwise run the reviews inline in sequence in this session. Either path must finish every axis before aggregating: never leave a review handle running past session end.

Process

1. Pin the fixed point

Whatever the user said is the fixed point: a commit SHA, branch name, tag, main, HEAD~5, etc. If they didn't specify one, ask for it (when invoked from implement, it's the ticket's base commit).

Capture the diff command once: git diff <fixed-point>...HEAD (three-dot, so the comparison is against the merge-base). Also note the list of commits via git log <fixed-point>..HEAD --oneline.

When the caller passes a path scope (as implement does, so parallel sessions sharing one branch don't pollute the range), append it to both: git diff <fixed-point>...HEAD -- <paths> and git log <fixed-point>..HEAD --oneline -- <paths>.

Before going further, confirm the fixed point resolves (git rev-parse <fixed-point>) and the diff is non-empty. A bad ref or empty diff should fail here, not inside three parallel reviews.

2. Identify the spec source

Look for the originating spec, in this order:

  1. Ticket references in the commit messages or branch name: read the matching markdown file under .scratch/ (or wherever .agents/issue-tracker.md, written by /setup, says this repo keeps them).
  2. A path the user passed as an argument.
  3. A PRD/spec file under docs/, specs/, or .scratch/ matching the branch name or feature.
  4. If nothing is found, ask the user where the spec is. If they say there isn't one, the Spec axis skips and reports "no spec available".

3. Identify the standards sources

Anything in the repo that documents how code should be written, in priority order:

  1. AGENTS.md at the repo root (and any standards docs under docs/ it points at).
  2. CONTRIBUTING.md, CODING_STANDARDS.md, or other project standards under docs/.
  3. Harness-specific or colocated rule files: root and directory-scoped CLAUDE.md, .cursor/rules, or equivalents in directories the diff touches. Colocated rules are binding for their tree and override generic guidance for that path.
  4. When both AGENTS.md and a harness-specific root file exist, prefer AGENTS.md for cross-harness conventions; apply harness-specific files as additional constraints for that environment.

Skip anything tooling already enforces. Formatters, type checkers, and mechanical upgrade tools own their domains; a finding those tools would catch or fix is noise, not a review finding. In a Laravel repo that typically means Pint, Larastan, and Rector.

On top of whatever the repo documents, the Standards axis always carries the smell baseline below: a fixed set of Fowler code smells (Refactoring, ch.3) that applies even when a repo documents nothing. Two rules bind it:

  • The repo overrides. A documented repo standard always wins; where it endorses something the baseline would flag, suppress the smell.
  • Always a judgement call. Each smell is a labelled heuristic ("possible Feature Envy"), never a hard violation.

Each smell reads what it is → how to fix; match it against the diff:

  • Mysterious Name: a function, variable, or type whose name doesn't reveal what it does or holds. → rename it; if no honest name comes, the design's murky.
  • Duplicated Code: the same logic shape appears in more than one hunk or file in the change. → extract the shared shape, call it from both.
  • Feature Envy: a method that reaches into another object's data more than its own. → move the method onto the data it envies.
  • Data Clumps: the same few fields or params keep travelling together (a type wanting to be born). → bundle them into one type, pass that.
  • Primitive Obsession: a primitive or string standing in for a domain concept that deserves its own type. → give the concept its own small type.
  • Repeated Switches: the same switch/if-cascade on the same type recurs across the change. → replace with polymorphism, or one map both sites share.
  • Shotgun Surgery: one logical change forces scattered edits across many files in the diff. → gather what changes together into one module.
  • Divergent Change: one file or module is edited for several unrelated reasons. → split so each module changes for one reason.
  • Speculative Generality: abstraction, parameters, or hooks added for needs the spec doesn't have. → delete it; inline back until a real need shows.
  • Message Chains: long a.b().c().d() navigation the caller shouldn't depend on. → hide the walk behind one method on the first object.
  • Middle Man: a class or function that mostly just delegates onward. → cut it, call the real target direct.
  • Refused Bequest: a subclass or implementer that ignores or overrides most of what it inherits. → drop the inheritance, use composition.

4. Run the axes: sub-agents or inline

If the harness can spawn parallel sub-agents (e.g. Claude Code Agent tool, Grok spawn_subagent, or equivalent): launch three foreground sub-agents in parallel, wait for all results before writing anything. Do not background them, a background handle can die with the session. In Claude Code with this plugin installed, use the typed agents leek-skills:pr-reviewer, leek-skills:standards-reviewer and leek-skills:spec-reviewer (read-only tools enforced, the Standards one remembers this repo's recurring violations); elsewhere, any general sub-agent with the briefs below, the Correctness one on your strongest model.

If sub-agents are unavailable: run the reviews inline in this session, Correctness first, then Standards, then Spec (or skip Spec when no source was found). Same briefs, same output shape, only the execution host changes.

Correctness brief: hand over the brief in triage-github-pr/references/independent-review.md in full, failure-mode probes included, with the diff command and commit list as its range, the commit messages as intent, and the repo's AGENTS.md / CLAUDE.md. Do not pass any PR review comments: this axis is the view they did not shape. Its output is the brief's Self N: [BLOCKING | MAJOR | MINOR] lines, each with a concrete failing case.

Standards brief: include:

  • The full diff command and commit list.
  • The list of standards-source files you found in step 3, plus the smell baseline from step 3 pasted in full: a sub-agent has no other access to it.
  • The brief: "Report (per file/hunk where relevant) (a) every place the diff violates a documented standard: cite the standard (file + the rule); and (b) any baseline smell you spot: name it and quote the hunk. Distinguish hard violations from judgement calls, documented-standard breaches can be hard, but baseline smells are always judgement calls, and a documented repo standard overrides the baseline. Skip anything formatters, type checkers, or mechanical upgrade tools enforce. Under 400 words."

Spec brief: include:

  • The diff command and commit list.
  • The path or fetched contents of the spec.
  • The brief: "Report: (a) requirements the spec asked for that are missing or partial; (b) behaviour in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but where the implementation looks wrong. Quote the spec line for each finding. Under 400 words."

If the spec is missing, skip the Spec axis and note this in the final report.

5. Aggregate

Present the reports under ## Correctness, ## Standards and ## Spec headings, verbatim or lightly cleaned. Do not merge or rerank findings; the axes are deliberately separate (see Why three axes).

End with a one-line summary: total findings per axis, and the worst issue within each axis (if any). Don't pick a single winner across axes, that's the reranking the separation exists to prevent.

Why three axes

A change can pass any axis and fail another:

  • Code that follows every standard but implements the wrong thing → Standards pass, Spec fail.
  • Code that does exactly what the issue asked but breaks the project's conventions → Spec pass, Standards fail.
  • Code that is conventional and faithful to the spec but loses work when a queue push fails, or races a concurrent request → Standards and Spec pass, Correctness fail. This is the axis PR review bots spend most of their rounds on; asking it here, before the PR, is what keeps those rounds short.

Reporting them separately stops one axis from masking another.

When you're done

Invoked from implement, hand the findings back to its loop; it decides what's real and fixes before committing; print no block. Invoked standalone, print the end-of-session block using the frame in wayfinder/references/pipeline-end-block.md:

---
Pipeline: decide → spec → tickets → **build**   (review runs inside build)
Done: <n Correctness, m Standards, k Spec findings; the worst per axis>
Next:
  • <condition> → /<skill> <ref>

Stage-specific Next conditions (only those that apply):

  • Real findings to fix → fix them, or /implement <ticket> if they belong to an open ticket
  • Spec axis skipped (no spec) → /to-spec if this work deserved one
  • Clean on every axis → nothing to run; say so

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.