agentleFS
Sir-chawakornSir-chawakorn/sanook-cli/skills/code-review/SKILL.md

code-review

Skill9 starsChanged 5 months agoApache-2.0View on GitHub

Reviews the current git diff (or a target PR/branch) for correctness bugs, logic errors, edge cases, and missing error handling, grouping findings by severity (Critical/Warning/Suggestion). Use after implementing a non-trivial change and before declaring it done, or when asked to review a PR.

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

We split this skill into the rules it gives an agent

5 rules. 0 are common, 5 are distinctive, and 0 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.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When explicitly asked to review a PR, branch, or working-tree diff.

    line 10
  2. Distinctive:

    When a change touches logic, control flow, data handling, or error paths across one or more files.

    line 11
  3. Distinctive:

    If unsure what to review, default to git diff HEAD plus staged changes.

    line 24
  4. Distinctive:

    Lock scope to changed lines + their blast radius: Read only the changed hunks and the immediate surrounding function/caller needed to judge …

    line 26
  5. Distinctive:

    Every checklist category in step 3 was considered for each changed hunk (not silently skipped).

    line 58

“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

When to Use

  • Right after finishing a non-trivial implementation, before reporting it as done.
  • When explicitly asked to review a PR, branch, or working-tree diff.
  • When a change touches logic, control flow, data handling, or error paths across one or more files.

Skip it for changes whose full effect fits in one sentence (typo fix, rename, comment, log-string tweak) — reviewing those wastes a pass.

This skill hunts for correctness defects only. Style, naming, and refactor opportunities are out of scope; leave those to a cleanup/refactor pass. Never block a change on style.

Steps

  1. Get the exact diff — never review the whole repo. Pick the source:
    • Working tree (uncommitted): git diff and git diff --staged
    • Last commit: git diff HEAD~1
    • Branch vs base: git diff $(git merge-base HEAD <base>)...HEAD (base is usually the default branch)
    • A PR: gh pr diff <number> (or gh pr diff <number> --patch) If unsure what to review, default to git diff HEAD plus staged changes.
  2. Lock scope to changed lines + their blast radius. Read only the changed hunks and the immediate surrounding function/caller needed to judge correctness. If a changed function is called elsewhere, open just those call sites — do not audit unrelated files.
  3. Run the correctness checklist over each hunk. For every changed function/branch, ask:
    • Null / undefined / None: new value dereferenced without a guard? optional/map-lookup assumed present? empty string/array/0/false mishandled by a truthiness check?
    • Off-by-one / bounds: loop < vs <=, slice/index ranges, first/last element, empty-collection case.
    • Async / concurrency: missing await, unhandled rejected promise, shared state mutated without ordering guarantee, race between read and write, fire-and-forget that should block.
    • Error paths: failures swallowed or only logged; thrown error left uncaught; partial failure leaves state half-updated; non-happy-path return value ignored.
    • Boundaries / inputs: untrusted or empty input, very large input, negative/zero, unicode, timezone/locale, numeric overflow or float precision.
    • Resource leaks: file/socket/db handle, lock, timer, subscription, or listener opened but not closed on all exit paths (including the error path).
    • Logic regressions: inverted condition, wrong variable, changed default that alters existing behavior, broken invariant a caller depends on.
  4. Triage each finding by severity and report with path:line, a one-line explanation of the failure mode, and a concrete suggested fix:
    • Critical — will produce wrong results, crash, data loss, or a security hole on a realistic input. Must be fixed before done.
    • Warning — plausible bug in an edge case, or correctness depends on an assumption that isn't enforced. Should be fixed or explicitly justified.
    • Suggestion — minor robustness/clarity improvement that affects correctness only weakly. Optional. Order findings most-severe-first. If a section is empty, say so (e.g. "Critical: none") rather than omitting it.
  5. Apply fixes (or hand them to the implementer), then re-review the new diff — focus on whether each fix is correct and whether it introduced a new issue. Do not declare done while any Critical remains unresolved.

Common Errors

  • Reviewing the whole repo instead of the diff. Floods the report with pre-existing issues you didn't change and weren't asked about. Always diff first; comment only on changed lines and their direct callers.
  • Drowning in false positives. Reporting "could be null" on a value the surrounding code already guarantees non-null. Read enough context to confirm the path is actually reachable before flagging; if you can't tell, mark it Warning, not Critical, and say what you assumed.
  • Nitpicking style as if it were a bug. Renames, formatting, "prefer const", import order — out of scope here. Flagging them buries the real findings and trains the reader to ignore the report.
  • Severity inflation. Marking everything Critical destroys the signal of the Critical tier. Reserve Critical for "wrong on a realistic input," not "theoretically possible if three unlikely things happen."
  • Reviewing intent instead of code. Judge what the diff does, not what the description says it should do; the two diverging is itself a finding.
  • Stopping after the first pass. A fix can introduce a fresh bug. The change isn't reviewed until the post-fix diff is clean.

Verify

The review is complete when:

  • The diff source is explicit and covers exactly the intended change set (and nothing unrelated).
  • Every checklist category in step 3 was considered for each changed hunk (not silently skipped).
  • Findings are grouped Critical / Warning / Suggestion, each with path:line + failure mode + suggested fix; empty tiers stated explicitly.
  • Zero Critical findings remain open — every one is either fixed (and the fix re-reviewed) or has a written justification for why it's not a defect.
  • The final reported diff differs from the initial one only by the applied fixes, and re-review of those fixes surfaced no new issues.

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.