agentleFS
Gord1yGord1y/countersign-skills/skills/thorough-diff-review/SKILL.md

thorough-diff-review

Skill2 starsChanged 38 days agoMITView on GitHub

Thorough local review of a diff: bugs, architecture boundaries, security, translations, conventions, reuse. Staged changes by default, or a branch, range or PR.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 7 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run the same checklist the CI reviewer uses, locally, before pushing.

    line 9
  2. Distinctive:

    no args / "staged" → git diff --staged.

    line 32
  3. Distinctive:

    Check that imports respect the layer rules from Repo facts.

    line 60
  4. Distinctive:

    Run the full check command.

    line 80
  5. Distinctive:

    Run the unit test command.

    line 81
  6. Distinctive:

    If the diff touches translation catalogs, run the translation check too.

    line 82
  7. Distinctive:

    Run the e2e command only when Repo facts says this diff requires it.

    line 87
  8. Very specific:

    If local.md exists next to this file, read it.

    line 89

≈ “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

Thorough diff review

Run the same checklist the CI reviewer uses, locally, before pushing. This is the local analogue of the repo's automated review workflow, with one source of truth: the review checklist file.

Repo facts

This skill needs the facts below. Look each one up in the repo's CLAUDE.md (or AGENTS.md) and the files it imports or points to (of a repo-facts file, only this skill's section: sed -n '/^## thorough-diff-review$/,/^## /p' <file>), then in local.md next to this file. If neither has it, ask the user once, then suggest the one line to add to CLAUDE.md so the next run finds it.

FactExample
Review checklist filedocs/review-checklist.md
Convention docs or skills to read for each touched areaa forms skill, a schemas skill
Architecture rules and the tool that enforces themlayers import only downward, boundary linter
Shared utilities to reuse before writing new onessrc/lib (logger, validators)
The full check commandpnpm check
Unit test commandpnpm test
e2e command and when it's requiredpnpm e2e, only on release PRs
Translation check and generate commands, if the repo has translationspnpm i18n:check, pnpm i18n:gen

1. Resolve the diff scope (from args)

  • no args / "staged" → git diff --staged. If nothing is staged, say so and stop; do not guess.
  • a branch name → git diff <branch>...HEAD
  • "last commit" → git show HEAD
  • a commit range a..b → git diff a..b
  • a PR number or URL → gh pr diff <n>

2. Read the real code, not just the diff

The diff is the entry point, not the boundary. For each change, read the surrounding full files and the related code that could DISPROVE a finding: callers, the definitions of the functions and types it uses, validators, existing patterns. Judging from changed hunks alone is the #1 source of false positives. Ground every finding before asserting it; if you cannot verify it, raise it as a question, not a defect.

3. Run the checklist

Walk every section of the review checklist and evaluate every changed file against it. When the change touches an area with convention docs or skills (a schema, a form, a mutation, a query key, a message catalog, a file's name or location), read the matching one and flag any violation.

Reuse before re-implementing: before flagging duplicated logic, check whether a shared utility from Repo facts already exists that the change should have reused.

A UI change is reviewed in its loading, empty, error and success states; a data-driven screen without that state matrix, or tests that skip it, is a finding.

4. Architecture boundary violations

Check that imports respect the layer rules from Repo facts. Flag any upward or cross-slice import and propose the fix the repo's rules prescribe.

5. Impact check

For a diff you can't prove safe by reading alone (shared code, a data or wire format, timing and teardown, a library upgrade), run impact-check and bring back its premise and the evidence label that premise reached: run, read or assumed. Skip it for a diff that is safe on its face.

6. Output

Report findings directly in the conversation (no report file unless asked). Group by severity: Blocker, Major, Minor, Nit. These four names are the whole set; never write Critical, High, Medium, Low or Warning. Cite file:line and give a concrete fix. Do not invent issues to fill space; if the diff is clean, say so briefly.

For a risky diff, a Safe because line: the fact and the ladder step it reached, or unproven.

7. Verify gate (before calling the change done)

  • Run the full check command. Every stage must pass; a single red stage is a red gate.
  • Run the unit test command. A changed component whose spec no longer covers its states is not done.
  • If the diff touches translation catalogs, run the translation check too; it may be a separate gate outside the full check. Authors translate new or changed strings before pushing; CI only verifies. Flag hand-mirrored source-language text in another language's file: an identical-text check treats it as untranslated. A new namespace or validation key needs the generate command, so generated types, loaders and fallbacks are regenerated.
  • Run the e2e command only when Repo facts says this diff requires it.

If local.md exists next to this file, read it; where it disagrees with this file, it wins.

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.