agentleFS
rafidonerafidone/agent-skills/skills/code-review-and-quality/SKILL.md

code-review-and-quality

Skill1 starsChanged 23 days agoMITView on GitHub

Reviews a diff for correctness, risk, and missing evidence before merge. Use when preparing a change for commit, reviewing a pull request, reviewing AI-generated code, or deciding whether work is genuinely done.

98 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use accessibility-engineering, observability-and-instrumentation and 8 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.
  • steven123397Skill

    accessibility-engineering

    Audits existing interfaces for WCAG 2.2 AA conformance and remediates the violations found. Use when auditing a page or component for accessibility, running axe-core or pa11y, triaging a11y violations, or checking screen reader and contrast issues before shipping.

    Also in 4 projects that use this

  • jaydubya818Skill

    observability-and-instrumentation

    Add or review logs, metrics, traces, and actionable alerts.

    Also in 44 projects that use this

  • seikaikyoSkill

    doubt-driven-development

    對非平凡決策啟動新鮮 context 對抗審查(找碴不背書),在修正還便宜的時候抓出錯誤方向。適用:高風險改動(production、資安敏感邏輯、不可逆操作)、不熟的程式碼、要宣稱「這樣是安全的 / 可行的」之前。機械性操作與一行修改不適用。

    Also in 48 projects that use this

  • jaydubya818Skill

    deprecation-and-migration

    Retire APIs or migrate consumers and persistent data across releases.

    Also in 41 projects that use this

  • HK-hubSkill

    source-driven-development

    Grounds every implementation decision in official documentation. Use when you want authoritative, source-cited code free from outdated patterns. Use when building with any framework or library where correctness matters.

    Also in 42 projects that use this

  • seikaikyoSkill

    interview-me

    需求不明時的意圖萃取訪談:一次一題、每題附上自己的猜測、聽出「真正想要 vs 覺得應該要」,直到能預測使用者反應(約 95% 信心)才動工。適用:需求缺少對象 / 動機 / 成功標準 / 約束,或使用者點名「訪談我」「先確認一下」「我們確定嗎」。明確自足的指示、純資訊查詢、機械性操作不適用。

    Also in 48 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 91 edited versions we read keep these.

  • 7

    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:

    Use this skill when:

    line 29
  2. Distinctive:

    Do not use it for:

    line 37
  3. Distinctive:

    Read the linked spec, issue, or commit message first.

    line 50
  4. Distinctive:

    If evidence is missing, the review is not complete.

    line 80
  5. Distinctive:

    Look for tests that cannot fail, assert nothing meaningful, mock the logic under test, depend on order, or cover only the happy path.

    line 105
  6. Distinctive:

    When the author says a blocker is fixed, re-read the relevant diff and the test output.

    line 116
  7. Distinctive:

    Exit condition: every acceptance criterion has evidence, every blocker is resolved, and the diff contains only the intended change.

    line 119

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

Overview

A review is the last point where a defect can be caught cheaply. It is not a style preference exercise and not a rubber stamp. The question is whether the diff does what the spec says, without breaking anything else, and with evidence that it was actually run.

Agents need this gate more than humans do. Generated code tends to be plausible: it compiles, it reads well, and it often works on the happy path. Plausibility is not correctness. The reviewer's job is to demand the evidence.

Review the tests before the implementation. Tests reveal what the author believed the behavior to be, and weak tests are easier to spot than subtle bugs.

When to Use

Use this skill when:

  • Preparing any change for commit, push, or merge.
  • Reviewing a pull request, including your own before requesting review.
  • Reviewing AI-generated or AI-assisted code.
  • Deciding whether a task is complete.
  • A change touches security, money, permissions, migrations, or public APIs.

Do not use it for:

  • Reading code to understand it, with no decision to make.
  • A documentation-only change with no executable behavior, beyond a link and spelling check.

Related: use the test-driven-development skill to produce the evidence this skill checks, and the shipping-and-launch skill after merge.

Core Process

1. Establish intent

Read the linked spec, issue, or commit message first. Without intent, you can only judge style. If there is no stated intent, request one before reviewing the diff.

2. Read the diff in a deliberate order

  1. Tests — do they describe the behavior, including failure paths?
  2. Production code — does it implement only that behavior?
  3. Configuration and migrations — are they reversible and safe?
  4. Unrelated changes — was anything included that the spec did not ask for?

3. Check correctness

  • Does each acceptance criterion have a passing test?
  • Are boundaries handled: empty, one, many, maximum, negative, null?
  • Are errors propagated or deliberately handled, not swallowed?
  • Is state shared safely under concurrency?
  • Is data validated at the boundary?
  • Does the change preserve backward compatibility where required?
  • Is the logic readable without the author explaining it?

4. Check the evidence

Claims are not evidence. Look for the commands and their output:

  • The red test before the fix.
  • The full relevant suite after it.
  • Lint, format, type check, and build.
  • A manual check only where automation is impossible, with steps recorded.

If evidence is missing, the review is not complete. "CI will run it" is not evidence that it passed.

5. Check risk

  • Secrets, credentials, and personal data are absent from the diff and logs.
  • Migrations are reversible or have a tested recovery path.
  • External calls have timeouts and bounded retries.
  • Destructive operations require approval and a rollback.
  • Feature flags default to the safe state.

6. Label findings by severity

SeverityMeaningEffect
BlockerIncorrect, unsafe, or unverified behaviorMust be fixed before merge
MajorLikely defect or missing coverage of an important pathShould be fixed before merge
MinorMaintainability issue with no current defectFix now or file a task
NitPreference or local styleAuthor's discretion

Cite the file and line. State the problem, why it matters, and the smallest acceptable fix. Do not rewrite the change in a comment unless asked.

7. Review the tests as carefully as the code

Look for tests that cannot fail, assert nothing meaningful, mock the logic under test, depend on order, or cover only the happy path. A weakened test is a blocker, not a nit.

8. Decide and record

End with one of: approve, approve with nits, or request changes. List the blockers explicitly. A review that ends in vague encouragement is not a review.

9. Verify the follow-up

When the author says a blocker is fixed, re-read the relevant diff and the test output. Do not approve on the strength of the reply alone.

Exit condition: every acceptance criterion has evidence, every blocker is resolved, and the diff contains only the intended change.

Common Rationalizations

RationalizationWhy it is wrongRequired action
"The tests pass, so it is fine."Tests can be weak, incomplete, or testing the mock.Read the tests and check they would fail without the fix.
"It is a small diff."Small diffs cause outages too, and small diffs are cheap to review properly.Review it with the same checklist.
"The author is senior."Seniority is not evidence, and everyone ships mistakes.Ask for the command output.
"I will fix it in a follow-up."Follow-ups are dropped, and the defect ships now.Block on defects, not on preferences.
"The linter is green."Lint checks syntax and style, not behavior or safety.Check correctness and risk separately.
"We are late; approve now."Shipping a defect costs more time than a short delay.State the risk and let the owner decide explicitly.
"I reviewed it in my head."A mental review cannot be verified and misses the diff.Read the actual diff, tests first.
"AI wrote it, so it is probably fine."Generated code is plausible by construction, not correct by construction.Demand the same evidence as any other change.
"The tests were already failing."That is a baseline claim, not an exemption.Require a clean baseline or an explicit, scoped exception.

Red Flags

  • The tests are not in the diff, or were added afterward.
  • The test asserts the mock, not the behavior.
  • The full suite was not run, and the report says "should pass".
  • A failing test was skipped or loosened to get green.
  • The diff includes unrelated refactoring or formatting.
  • New behavior has no acceptance criterion.
  • Secrets or personal data appear in code, fixtures, or logs.
  • A migration is irreversible with no recovery plan.
  • Error paths swallow exceptions or return success on failure.
  • The review has no severity labels, so nothing is actually blocking.
  • Approval was given without reading the tests.

Verification

  • The intent and spec are linked and understood.
  • Tests were reviewed before production code.
  • Every acceptance criterion has a test that would fail without the change.
  • Failure paths and boundaries are covered.
  • The full relevant suite was run and its output recorded.
  • Lint, format, type check, and build passed.
  • No tests were skipped, deleted, or weakened.
  • Secrets, credentials, and personal data are absent.
  • Migrations and destructive changes have rollback plans.
  • Every finding has a severity, a location, and a concrete fix.
  • The diff contains no out-of-scope changes.
  • Blockers are resolved and re-verified, not merely acknowledged.

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.