agentleFS
luigi-dvluigi-dv/react-ts-vite/.claude/skills/clean-code-review/SKILL.md

clean-code-review

Skill1 starsChanged 26 days agoMITView on GitHub

Review a diff or pull request against this project's rules — architecture placement, import direction, types, component design, design-system usage, accessibility, tests and docs — and report findings by severity with concrete fixes. Use when asked to review, audit or critique code, or before opening a PR.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    No dead code, commented-out code, console.log, TODO without owner.

    line 50
  2. Very specific:

    No secrets or tokens in code.

    line 56

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

Clean code review

Procedure

  1. Run the gate: npm run check. Anything it reports is a blocking finding (never suggest disabling a rule).
  2. Read the diff file by file with the checklist below. Open the surrounding code when a change's intent is unclear.
  3. Report findings ordered by severity, each with file:line, the rule or principle, why it matters, and the fix. Three sections: Blocking, Should fix, Nits. Finish with one line on what is good.

Checklist

Architecture & modules

  • Module sits in the layer matching its role (project-architecture); no new top-level src/ folders.
  • Imports use aliases; no ../; no imports against the dependency direction (npm run arch:check).
  • Slices/features expose a public index.ts; no deep imports into other slices.

TypeScript

  • No any, no unchecked casts, no ! without justification; import type for types.
  • Exhaustive handling of unions (switch with never default or satisfies).
  • Public functions have explicit return types where inference is unclear.

React

  • Components are presentational; data flows through hooks; no @services in components.
  • No setState in effects, no derived state stored in state, stable keys in lists, event handlers not recreated needlessly where it matters.
  • Component under ~150 lines and single-responsibility; props typed; named export (default only for pages).

Design system & accessibility

  • Tailwind utilities with brand-* tokens, dark: variants present, Prettier class order.
  • Headless UI for interactive patterns; Heroicons aria-hidden; icon-only controls have sr-only labels.
  • Semantic elements, one h1, labels on inputs, errors linked via aria-describedby, visible focus.

Tests

  • Behaviour covered (happy path + error/empty state); page has a smoke test; mocks at the service boundary; no snapshot of large trees.

Cleanliness

  • No dead code, commented-out code, console.log, TODO without owner.
  • Comments explain why; names reveal intent; duplication extracted only when it is real duplication (same reason to change).
  • Generated files regenerated, not hand-edited; CHANGELOG.md updated for user-visible changes; docs updated for new scripts/templates.

Security & robustness

  • No secrets or tokens in code; dangerouslySetInnerHTML only with sanitised input; external links with rel="noopener"; user input validated at the boundary.

Severity guide

  • Blocking: breaks the build/gate, violates architecture direction, security issue, missing tests for new behaviour.
  • Should fix: readability, type looseness, accessibility gaps, duplicated logic.
  • Nit: naming, comment wording, minor ordering.

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.