agentleFS
HeathWangHeathWang/hw-cc-plugin/skills/code-review-with-files/SKILL.md

code-review-with-files

Skill1 starsChanged 3 months agoMITView on GitHub

Use when reviewing source files, diffs, commits, pull requests, or bugfixes for correctness issues, regressions, security problems, performance risks, edge cases, or missing tests across any language or framework.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    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:

    Do not use it for pure explanation, rewriting, or style-only feedback.

    line 19
  2. Distinctive:

    Do not edit, stage, unstage, reset, or regroup files.

    line 28
  3. Distinctive:

    Run only safe, targeted checks that materially improve confidence.

    line 29
  4. Distinctive:

    Read callers, contracts, types, schemas, configuration, lifecycle code, and the original bug path only when a conclusion depends on them.

    line 32
  5. Distinctive:

    If critical context is unavailable, state what is missing and what cannot be confirmed.

    line 34
  6. Distinctive:

    Check cross-cutting risks: security, concurrency, resources, performance, compatibility, and observability.

    line 41
  7. Distinctive:

    Do not perform a mechanical line-by-line nitpick pass.

    line 45
  8. Distinctive:

    Use impact, likelihood, blast radius, and recoverability.

    line 62
  9. Distinctive:

    Use a findings-first structure by default unless the user explicitly asks for another format:

    line 75
  10. Distinctive:

    Use the language of the most recent review request

    line 98

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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 With Files

Overview

This skill defines a findings-first, read-only code review protocol.

Inspect the complete review boundary, then report every actionable issue supported by evidence. Prioritize correctness, security, regressions, and runtime risk over style.

When to Use

  • The user asks to review source files, a diff, commit, branch, pull request, or bug fix.
  • The goal is to find correctness, regression, security, performance, edge-case, or test problems.

Do not use it for pure explanation, rewriting, or style-only feedback.

Scope and Safety

Identify the target and baseline first. Inspect the entire supplied file or patch. For a commit, branch, or pull request, compare the intended base to the complete head change, not only the latest commit. Honor explicit scope and exclusions.

A change finding must be introduced, worsened, or made newly reachable by the review target. Do not misattribute pre-existing defects; report only an immediate critical one separately as a Pre-existing Risk.

Review is read-only unless changes are separately requested:

  • Do not edit, stage, unstage, reset, or regroup files.
  • Run only safe, targeted checks that materially improve confidence.
  • Inspect the full requested boundary rather than stopping at the first issue.

Read callers, contracts, types, schemas, configuration, lifecycle code, and the original bug path only when a conclusion depends on them. Read relevant existing tests early enough to establish intent, but reconcile them with contracts and callers rather than treating them as automatic truth.

If critical context is unavailable, state what is missing and what cannot be confirmed. Report only supported conclusions.

Review Workflow

  1. Define the boundary: changed behavior, entry points, callers, data structures, contracts, and tests.
  2. Establish intended behavior from code, types, documentation, callers, and relevant existing tests.
  3. Walk execution paths: inputs, state transitions, errors, returns, side effects, cleanup, and rollback.
  4. Check cross-cutting risks: security, concurrency, resources, performance, compatibility, and observability.
  5. Evaluate test coverage after understanding the implementation: happy path, failure path, edge cases, and regression proof.
  6. Complete the full boundary pass. Consolidate repeated manifestations of one root cause instead of duplicating findings.

Do not perform a mechanical line-by-line nitpick pass. Focus on behavior that can actually break.

Subjective style is not a finding unless the user explicitly requests style feedback or it creates a concrete maintenance risk.

Finding Threshold

A finding must be:

  • Attributable: caused, worsened, or exposed by the target
  • Verifiable: identifies a trigger, violated contract, call path, or failure
  • Consequential: explains the user, system, security, or maintenance impact
  • Actionable: gives a realistic fix direction
  • Atomic: covers one root cause; combine duplicate instances with the same fix

Resolve assumptions from available context before reporting. If missing evidence can materially change the judgment, use an open question instead of inventing a finding.

Severity and Merge Readiness

Use impact, likelihood, blast radius, and recoverability. Defect type alone never determines severity: crashes, security issues, and performance problems can occur at any level.

LabelWhen to use it
criticalReachable data loss, corruption, broad outage, exploitable boundary failure, or severe unrecoverable results
highLikely regression or security failure on a supported/common path with important impact
mediumConditional or limited incorrect behavior, material maintenance risk, weak regression proof, or bounded degradation
lowLocalized low-impact issue or optional polish with a concrete benefit

Unless project policy says otherwise, critical and high findings block merge; medium and low findings do not. Do not raise severity merely because evidence is uncertain or lower it because the fix is easy.

Output Contract

Use a findings-first structure by default unless the user explicitly asks for another format:

**Findings**
1. [severity] [path:line] Conclusion
   Trigger/evidence and impact
   Fix direction

2. ...

**Pre-existing Risks** (optional)

**Open Questions** (optional)

**Summary**
Overall risk, merge readiness, tests run, and testing gaps

Requirements:

  • Sort findings by severity, then by impact and confidence within the same severity
  • Include a location, trigger/evidence, impact, and fix direction; use locating context if no exact line is available
  • Suggest rather than implement fixes unless the user asks
  • Omit empty Pre-existing Risks and Open Questions sections
  • Use the language of the most recent review request
  • With zero findings, say No actionable findings found and note residual risk or testing gaps
  • With only non-blocking findings, say No blocking findings only in the summary

Example:

1. [high] `foo/bar.ts:87`
   This path updates local state to success even when `save()` fails, so callers can observe "saved" while persistence never completed.
   That turns a retriable failure into silent data inconsistency.
   Commit state only after persistence succeeds, or roll back and surface the error on the failure path.

Common Mistakes

  • Reporting an unchanged defect as if the reviewed change introduced it
  • Assigning severity from labels such as "crash" without calibrating realistic impact
  • Finalizing before reading context or tests on which the conclusion depends
  • Stopping after the first finding or duplicating one root cause across several findings

Quick Heuristics

  • For bug fixes, check whether the patch fixes only one symptom while leaving sibling paths broken
  • For new flags or branches, enumerate meaningful combinations and preserved invariants
  • For cache, retry, concurrency, or async callback code, check ordering and idempotency
  • For parsing, SQL, HTML, filesystem, or permission logic, check security boundaries first
  • For schema, DTO, or interface field changes, check compatibility and default behavior

Final Check Before Sending

Before sending:

  • Are findings first, attributable, evidence-backed, actionable, and ordered by calibrated severity?
  • Was the complete boundary inspected without duplicate root causes?
  • Is any context required for a conclusion still unread?
  • Are tests run and testing gaps stated accurately?
  • With zero findings, does the response say No actionable findings found?

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.