agentleFS
itsaspacestationitsaspacestation/natural-intelligence/skills/code-review/SKILL.md

code-review

Skill1 starsChanged 2 months agoApache-2.0View on GitHub

Use when the user asks for a full review of a change, pull request, or merge request against the personal checklist, covering design, tests, performance, security, and correctness — including local changes before pushing or opening an MR/PR. Also use when the user asks to read, address, answer, or reply to reviewer comments or threads, to post findings as applicable suggestions on GitLab or GitHub, or to prepare a plan from reviewer feedback, on any forge, including GitLab merge requests through glab (MR discussions, unresolved threads, suggestion blocks, glab auth) and GitHub pull requests through gh (PR discussions, review threads, suggestion blocks, gh auth).

188 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

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

  • AWSSkill

    resolving-merge-conflicts

    Use when you need to resolve an in-progress git merge/rebase conflict.

    Also in 48 projects that use this

  • +1 more from mrgoonie
  • +2 more from aws

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. 0 are common, 13 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 175 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When the diff is under 50 changed lines, run step 2 inline instead of with subagents.

    line 35
  2. Very specific:

    Built-in review first: Run Claude Code's built-in code-review skill (the diff reviewer for correctness bugs and simplification) on the same …

    line 42
  3. Distinctive:

    When the defect shows in one file but the fix lands in another, the suggestion goes on the fix's file.

    line 78
  4. Distinctive:

    Read first, both directions: No suggestion without the real file open.

    line 81
  5. Distinctive:

    Keep: exact line numbers, exact symbol names in backticks, a concrete fix rather than "consider refactoring", and the why when the fix is …

    line 111
  6. Distinctive:

    Prefer collaborative tone.

    line 194
  7. Distinctive:

    read -> preview -> approve -> post + resolve: Never write first. One approval covers the whole write: the preview states, per thread, the …

    line 201
  8. Distinctive:

    Always preview and wait for explicit approval before any write to the forge.

    line 208
  9. Distinctive:

    Never unresolve, approve, merge, close, or delete anything: those stay the user's calls.

    line 211
  10. Very specific:

    Follow the git rules in git-conventions.

    line 212
  11. Distinctive:

    Follow the read-first rule in the classification ladder before proposing any suggestion.

    line 214
  12. Distinctive:

    If a comment is unclear or technically questionable, say so in the preview instead of complying.

    line 215
  13. Distinctive:

    Write the preview to the session scratchpad by default.

    line 216
  14. Distinctive:

    Every thread in the preview carries a Disposition, whatever the output format.

    line 253
  15. Very specific:

    When a markdown output is asked, create one section per unresolved thread in <scratchpad>/<change-id>-suggestions.md, where change-id is …

    line 265
  16. Distinctive:

    If the user narrows or overrides a disposition in their answer, theirs wins.

    line 292
  17. Very specific:

    Every thread previewed as reply only with no outstanding item named

    line 305

“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

Based on "What to look for in a code review" by Trisha Gee (Java Champion, JetBrains) and personal notes

When to use

  • User asks to review code, local changes before pushing, a pull request, or a merge request
  • User asks for the review checklist
  • User wants to assess the quality of a change
  • User mentions design, readability, test coverage, security, or correctness concerns
  • User asks what reviewers said, or to address, answer, or reply to review feedback
  • User asks for a plan built from review comments

Overview

Two sides of a review, both language- and forge-agnostic:

  1. Giving a review — the built-in review, then the checklist below run by two subagents. Reviews reduce cognitive load, catch correctness issues, and share knowledge — not just find bugs.
  2. Answering a review — the flow in "Answering review feedback". Read, preview, get approval, then write. Never write first.

Forge commands (reading threads, posting, resolving) live in gitlab.md or github.md per the forge routing rule; git rules in the git-conventions skill.

Giving a review

Four steps, in this order. Do not start the checklist before step 1 has returned. When the diff is under 50 changed lines, run step 2 inline instead of with subagents.

Local target (working tree, staged, or an unpushed branch — the common pre-push review): diff via local git against the merge-base of the target branch, no forge routing. Steps 1–3 unchanged; step 4 does not apply — the findings report is the deliverable; fixes go straight to the working tree on request, no suggestion fences.

  1. Built-in review first. Run Claude Code's built-in code-review skill (the diff reviewer for correctness bugs and simplification) on the same target, at the effort level the user gave, or medium when none was given. Keep its findings.
  2. Checklist with two subagents in parallel. Dispatch two subagents in the same message, each with the diff target and its half of the checklist below:

    • Subagent 1: Design, Readability & Maintainability, Tests (items 1-16)
    • Subagent 2: Performance, Data Structures, Security, Correctness, Cross-cutting (items 17-36)

    Each subagent reads the actual code around every finding and returns one line per finding in the format below, prefixed with the item number; none without a file:line.

  3. Merge and report once. Drop checklist findings the built-in review already reported, dedupe across the two subagents, rank by severity, and report in one message. Say which step each finding came from.
  4. Post after approval. Once the user approves the findings report, post each finding as its own diff-anchored discussion: suggestion per the ladder below, prose fallback, assembled per the read-first rule; forge commands in the reference files, routed as above.

Quick bug pass without the checklist: spawn ni:reviewer — same one-line format, nothing else.

Classification ladder

A finding posts as an applicable suggestion only when ALL hold: (a) the fix is mechanical — final code for one contiguous span, no judgement left to the reviewee; (b) the span anchors on kept or added lines inside the current diff — deleted-line targets never carry a fence; (c) the note anchors in the file the fix changes — a fence never rides a note anchored in another file; (d) it fits one hunk and the forge's range cap. An insertion (new code, such as a missing test) is still mechanical: anchor on a kept or added line of the target file adjacent to the insertion point and include that line verbatim in the block — mechanics in the forge reference file. Paste-ready code in a plain code fence is a failed suggestion, not prose: when the body carries final code and the target file has a kept or added line in the diff, post it as a suggestion there. Prose fallback is for genuine judgement calls, or a target file with no kept or added line in the diff — and it still states the concrete fix. Severity is orthogonal: a mechanical bug fix still gets a suggestion. Anchoring errors: refetch refs once, retry once, then prose. One concern per thread; a suggestion is a posting mechanism, never a licence for bigger rewrites. When the defect shows in one file but the fix lands in another, the suggestion goes on the fix's file; a one-line pointer on the defect's line may reference it.

Read first, both directions. No suggestion without the real file open. Replacement lines are edited copies of the actual lines, exact indentation kept, never regenerated from memory or from comment text alone. The posting step above and the answering flow below both follow this rule.

Own-thread resolution. On re-review of a change with new commits, check each thread you yourself opened: re-read the anchored span at the new head and the diff since the finding was posted. When the posted fix, or an equivalent that removes the defect, is present, reply with one line naming the fixing commit, then resolve the thread. Own threads only — never resolve another reviewer's thread. Ambiguous: leave open, no nag replies. An applied suggestion resolves the thread natively on GitLab; this rule covers the manual-fix path and GitHub.

Finding format

One line per finding. Location, problem, fix. No throat-clearing.

Format: file:L42: <severity>: <problem>. <fix>. Multi-file diffs always carry the file.

SeverityUse for
bugWrong output, crash, security hole, data loss
riskWorks but fragile: race, leak, missing guard, perf cliff
nitStyle, naming, micro-optimisation. The author can ignore it
qGenuine question. Use it instead of hedging

Drop: "I noticed that", "it seems like", "you might want to consider", "this is just a suggestion" (use nit), praise per comment (say it once at the top), restating what the line does, hedging ("perhaps", "maybe", "I think": use q).

Keep: exact line numbers, exact symbol names in backticks, a concrete fix rather than "consider refactoring", and the why when the fix is not obvious from the problem.

Examples:

  • Not: "I noticed that on line 42 you're not checking if the user object is null before accessing the email property. This could cause a crash. You might want to add a null check."
  • Yes: src/user.ts:L42: bug: user can be null after .find(). Add guard before .email.
  • Yes: src/order.ts:L88-140: nit: 50-line function does 4 things. Extract validate, normalise, persist.
  • Yes: src/client.ts:L23: risk: no retry on 429. Wrap in withBackoff(3).

Full prose instead of one line for: security findings (state the risk and a reference), architectural disagreements (rationale needed), and an author new to the codebase who needs the why. Write the paragraph, then resume the one-line format.

Adapted from the MIT-licensed caveman-review skill by Julius Brussee.

Checklist

Design

  1. Architecture fit — Does the change align with the overall architecture and existing conventions?
  2. SOLID — Are Single Responsibility, Open/Closed, Liskov, Interface Segregation, and Dependency Inversion respected?
  3. DDD — Are domain concepts clearly named and properly modelled?
  4. YAGNI / KISS — No speculative generality; prefer the simplest solution that works
  5. Code reuse — Is there a refactoring or extraction opportunity to avoid duplication?

Readability & Maintainability

  1. Understandability — Can a new reader understand the intent without context?
  2. Naming — Are names precise, consistent, and self-documenting?
  3. Happy path vs exceptional cases — Are both paths handled explicitly and clearly?
  4. Configuration vs hard-coded values — No magic constants; prefer named config

Tests

  1. Coverage of new code — Are all new branches and edge cases covered?
  2. Test intent — Does each test name and assertion communicate why, not just what?
  3. Tests are code — Apply the same quality rules (naming, readability, no duplication)
  4. Granularity — Right level: unit > integration > end-to-end; avoid testing implementation details
  5. Edge cases — Cardinality (empty, single, many), nullability, boundary values, error paths
  6. Limitations — Are test limitations intentional and documented, or accidental gaps?
  7. Performance & security tests — Are they needed? Are they present?

Performance

  1. Requirements — Does the implementation meet the stated performance requirements?
  2. Readability vs performance trade-off — Only optimise when measurements justify it
  3. Network cost — Are batching and call counts considered?
  4. Resource management — Are connections, streams, and handles properly closed?
  5. Memory leaks — Are data lifecycle and collection bounds controlled?
  6. Locks & race conditions — Are shared resources properly protected?
  7. Concurrency vs parallelism — Is the right model applied?
  8. Pool configuration — Use safe defaults; only tune with evidence

Data Structures

  1. Right choice — Is the data structure appropriate for the access pattern and complexity (Big-O)?
  2. Pitfalls — Watch for lazy evaluation traps, infinite streams, or iterator invalidation
  3. Optionality — Is absence of a value modelled explicitly (Option/Maybe/Optional) rather than null?

Security

  1. Automated checks — Are dependency scanners (e.g. Dependabot) and SAST tools in CI?
  2. Dependency surface — Are new dependencies justified and minimal?
  3. Regulatory requirements — Does the change touch data subject to compliance rules (GDPR, PCI, …)?

Correctness

  1. Wrong data structure — Could the structure cause subtle bugs (e.g. set vs list, map ordering)?
  2. Race conditions — Is concurrent access safe?
  3. Caching — Are cache invalidation and staleness handled correctly?

Cross-cutting Concerns

  1. Documentation impact — Does the change require updating docs, ADRs, or READMEs?
  2. UI / error messages — Are user-visible messages clear, actionable, and tested?
  3. Automated vs human review split — Delegate formatting/style to linters; focus human review on design and logic

Culture

  • Share tooling: IDE configs, linter rules, and CI checks should be committed and consistent
  • Reviewers should ask "Have you thought about…?" for security, edge cases, and docs — not just critique
  • Prefer collaborative tone; a review is a knowledge-sharing session, not an audit
  • Pair review option: a reviewer can write the missing tests as part of the review, as a follow-up to the findings

Answering review feedback

Turn reviewer threads into a table preview of replies and code suggestions; write to the forge only after the user approves the preview. The flow is always: read -> preview -> approve -> post + resolve. Never write first. One approval covers the whole write: the preview states, per thread, the reply and whether it resolves; posting does both in one pass — never come back to ask about resolving. First review with no reviewer threads yet: use the checklist above.

Rules

  1. Always preview and wait for explicit approval before any write to the forge.
  2. Resolve every approved thread whose preview Disposition said reply + resolve. This is required, not optional, and happens in the same pass as the reply. Never unresolve, approve, merge, close, or delete anything: those stay the user's calls.
  3. Follow the git rules in git-conventions.
  4. Quote the reviewer's comment verbatim in the preview. Do not paraphrase feedback.
  5. Follow the read-first rule in the classification ladder before proposing any suggestion.
  6. If a comment is unclear or technically questionable, say so in the preview instead of complying.
  7. Write the preview to the session scratchpad by default. Write it into the repository only when the user asks.
  8. One suggestion per discussion thread. Do not bundle unrelated changes into one note.
  9. Comments may live on an earlier MR/PR while the fix lives in a follow-up. Reply and resolve on the one that carries the thread, not the one that carries the code.

Preview format

One row per thread, two tables. Replies to existing reviewer threads (main case):

| # | File:line | Discussion | Reviewer comment (verbatim) | Reply | Suggestion | Resolve? |
|---|---|---|---|---|---|---|
| 1 | src/Domain/Booking.cs:42 | abc12345 | "Verbatim reviewer comment." | Agreed, null check added | line: `if (booking is null) return NotFound();` | yes |
| 2 | src/Api/Handler.cs:17 | def67890 | "Verbatim reviewer comment." | Fixed, test still to add | range: one-line summary | no - test missing |
| 3 | general | 0123abcd | "Verbatim reviewer comment." | Question back to reviewer | none | no - needs @user |

New comments on lines with no existing thread:

| # | File:line | Comment | Suggestion |
|---|---|---|---|
| 4 | src/Domain/Booking.cs:58 | Same null check as thread 1 applies here | line: one-line summary |

End with Not addressed: item, reason.

Column rules:

  • File:line is the path and line on the new side of the diff, or general for a non-diff thread.
  • Discussion is a short id prefix; keep the full id for the write.
  • Reviewer comment is quoted verbatim, trimmed with ... only when long.
  • Suggestion is line, range, or none, plus the replacement when it fits one line, otherwise a summary; the full fenced block goes in the markdown file or the note body. The range syntax is forge-specific (see gitlab.md or github.md).
  • Resolve? is yes for reply + resolve, or no - reason for reply only and leave open. It maps to the Disposition below.

Every thread in the preview carries a Disposition, whatever the output format. It is a required field with exactly one of three values:

DispositionMeaningWrite on approval
reply + resolveThe comment is answered and the ask is donereply, then resolve
reply onlyAnswered, but something real is still outstanding — say whatreply, leave open
leave openNeeds the user, another person, or a decision — say who or whatnothing

reply + resolve is the normal case for a comment whose ask has landed; defaulting to reply only to stay safe leaves the user closing threads by hand — the work this flow removes.

When a markdown output is asked, create one section per unresolved thread in <scratchpad>/<change-id>-suggestions.md, where change-id is the MR iid or PR number:

## 1. src/Domain/Booking.cs:42 - @reviewer  [discussion: abc12345]

> Verbatim reviewer comment.

**Assessment:** what the comment is actually asking, and whether it holds.

**Disposition:** reply + resolve

**Current code** (src/Domain/Booking.cs:40-44):
```csharp
<actual lines read from the file>
```

**Proposed reply** (the fence's range syntax is forge-specific):
```suggestion
<replacement for line 42>
```

End the file with a short Not addressed list for anything skipped, with the reason.

Then ask one question: which numbered items to write, taking the previewed dispositions as read. Write only those, and resolve exactly the approved reply + resolve ones. If the user narrows or overrides a disposition in their answer, theirs wins.

After approval

Post the replies, resolve the approved threads, then verify and report in one message: posted note ids, threads now resolved, and threads left open with their disposition's reason. Commands: gitlab.md or github.md, per the forge routing rule.

Red flags - the write is not finished

  • Replies posted, resolve left for the user
  • "Resolving is the user's call" — it was, at preview time, and they answered
  • A second question about resolving after the replies are already up
  • Every thread previewed as reply only with no outstanding item named
  • Reporting note ids without saying which threads are resolved

All of these mean: go back and resolve the approved threads now.

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.