agentleFS
fagemxfagemx/edda/.claude/skills/code-review/SKILL.md

code-review

Skill36 starsChanged 3 months agoApache-2.0View on GitHub

Review merged code, commit ranges, or codebase paths for correctness, security, architecture, and test risk; use pr-review for open PRs

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

Show its rules and text

We split this skill into the rules it gives an agent

30 rules. 0 are common, 19 are distinctive, and 11 are very specific to this project.

  • 0

    Common

    Most of the 174 edited versions we read keep these.

  • 19

    Distinctive

    This author's own choices. Worth a look.

  • 11

    Very specific

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

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

    Use pr-review instead when the user wants a pre-merge review of an open pull request.

    line 10
  2. Distinctive:

    Use Git as the source of truth so ignored build output is not scanned:

    line 59
  3. Very specific:

    Keep source code and behavior-bearing project configuration.

    line 88
  4. Distinctive:

    Never exclude tests merely because they are tests

    line 93
  5. Very specific:

    If zero reviewable files remain, stop with NO REVIEWABLE FILES, show the raw paths and exclusion reasons, and do not produce a score.

    line 95
  6. Very specific:

    If relevant files have uncommitted changes, stop and ask whether to review the working tree or committed HEAD.

    line 97
  7. Distinctive:

    Create an internal scope manifest containing:

    line 99
  8. Distinctive:

    Read context in this order:

    line 109
  9. Very specific:

    If .claude/review-config.md is absent, derive provisional criteria in memory and show the assumptions in the final report.

    line 118
  10. Distinctive:

    Use project structure and imports first, then naming heuristics.

    line 132
  11. Very specific:

    If a track has no files, mark it N/A with the reason.

    line 142
  12. Distinctive:

    Use commands documented by the project.

    line 146
  13. Distinctive:

    Run the non-empty tracks in parallel when agent delegation is available.

    line 162
  14. Distinctive:

    Every reviewer must read the relevant code before judging it, trace definitions and call sites far enough to prove reachability, and remain …

    line 170
  15. Distinctive:

    Check documented layer and module boundaries against actual imports and manifests.

    line 174
  16. Very specific:

    Treat unsafe, panic paths, suppression attributes, unchecked conversions, and swallowed errors according to project rules and reachability.

    line 176
  17. Distinctive:

    Check bounds and resource controls where user input can amplify work.

    line 184
  18. Distinctive:

    Only report a finding when all required fields are supported:

    line 195
  19. Distinctive:

    Use this exact structure:

    line 233
  20. Very specific:

    Do not show an A verdict when checks were skipped or coverage is incomplete.

    line 277
  21. Distinctive:

    Create one draft per P0. Group P1s only when they share a root cause, module, and acceptance boundary.

    line 284
  22. Distinctive:

    Keep each issue to one independently verifiable PR.

    line 285
  23. Distinctive:

    Check repository and existing labels before proposing them:

    line 286
  24. Distinctive:

    Explicit confirmation required: STOP and create nothing until the user explicitly approves that table.

    line 296
  25. Very specific:

    After approval, run gh issue create for approved rows only and report each returned URL.

    line 297
  26. Distinctive:

    Never create missing labels, modify code, or broaden issue scope as part of this skill unless the user separately asks.

    line 299
  27. Very specific:

    Hardcoded layout or language: - never assume src/, TypeScript, or Rust without manifest evidence.

    line 316
  28. Distinctive:

    Silent sampling: - never review the first N files and imply full coverage.

    line 317
  29. Very specific:

    Vague findings: - every P0/P1 needs file:line, reachable impact, and confidence.

    line 320
  30. Distinctive:

    Style review: - leave formatting and lint-only concerns to configured tooling.

    line 322

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

Retrospective Code Review

You are the tech lead performing an evidence-driven review of code that already exists. Review the requested scope without modifying code, distinguish proven defects from questions, and never claim coverage you did not complete.

Use pr-review instead when the user wants a pre-merge review of an open pull request. Use issue-scan when the goal is broad work discovery rather than a bounded quality review.

Usage

code-review                                      # Review all tracked, reviewable files
code-review <commit-range>                       # Review a Git range, e.g. HEAD~5..HEAD
code-review --path <file-or-directory>           # Review one tracked path
code-review [<range> | --path <path>] --create-issues

<commit-range> and --path are mutually exclusive scope selectors. --create-issues is only a modifier: it does not authorize issue creation until the user approves the final issue draft table.

Mode Routing

Parse args once at the start:

InputModeScope source
no scope selectorfullall tracked, reviewable files
one positional Git rangerangefiles changed by that range
--path <path>pathtracked files below that path
any mode + --create-issuessame mode + issue draftfindings from this review only

Reject ambiguous or incomplete input instead of guessing:

  • range together with --path
  • more than one positional range
  • missing value after --path
  • unknown flags
  • a path outside the repository

Workflow

Step 0: Parse and Validate Scope

Establish repository state before reading code:

git rev-parse --show-toplevel
git status --short

Then validate the selected mode. For --path, validate existence and repository containment before enumerating files; a string that merely resembles a path is not sufficient.

Full mode

Use Git as the source of truth so ignored build output is not scanned:

git ls-files

Range mode

Validate that the range resolves, then list added, copied, modified, renamed, and deleted paths. Deletions are review evidence and must not disappear from scope:

git rev-list --count "<commit-range>"
git diff --name-status --find-renames --diff-filter=ACMRD "<commit-range>" --

Normalize rename rows into old and new paths, and retain the status in the scope manifest. Review deleted code from the range diff or its preimage, then inspect surviving callers for breakage. Do not expand range mode into a whole-codebase review. Read unchanged definitions and callers only as supporting context; findings must concern behavior affected by the range.

Path mode

Resolve <path> against the repository root and validate that the result remains inside it. Then enumerate tracked files:

git ls-files -- "<path>"

A directory existing on disk is not enough: ignored or untracked files are outside the default retrospective scope. If the user explicitly requests untracked files, disclose that exception in the report.

Reviewable files

Keep source code and behavior-bearing project configuration. Detect the stack from real manifests; do not assume TypeScript, Rust, or a src/ layout.

  • Source: .rs, .py, .ts, .tsx, .js, .jsx, .go, .java, .kt, .c, .cc, .cpp, .h, .hpp, .cs, .rb, .php, .swift, .scala, .sh
  • Build/runtime configuration: Cargo.toml, package.json, pyproject.toml, go.mod, build.gradle*, Dockerfile*, and CI workflow YAML
  • Exclude binary files, lock files, generated files, vendored code, and patterns from .claude/review-config.md
  • Never exclude tests merely because they are tests

If zero reviewable files remain, stop with NO REVIEWABLE FILES, show the raw paths and exclusion reasons, and do not produce a score.

If relevant files have uncommitted changes, stop and ask whether to review the working tree or committed HEAD; do not silently mix both states.

Create an internal scope manifest containing:

mode | scope expression | included files | excluded files with reason | repository state

For a large scope, partition by crate/package/module and maintain a coverage ledger. Never silently sample. If the available context cannot cover every file, return INCOMPLETE with the exact unreviewed paths and no overall grade.

Step 1: Load Project Evidence

Read context in this order:

  1. AGENTS.md and CLAUDE.md when present
  2. .claude/review-config.md when present
  3. detected manifests such as Cargo.toml, package.json, pyproject.toml, or go.mod
  4. architecture, contract, and safety documents referenced by those files

Project-specific rules override generic checklist items. Verify external APIs and framework behavior from repository examples or primary documentation; mark anything unverified instead of guessing.

If .claude/review-config.md is absent, derive provisional criteria in memory and show the assumptions in the final report. Write a new config only after explicit user approval; a code review is read-only by default.

For Edda, the existing review config defines crate layering, module boundaries, safety invariants, Rust checks, and ignore patterns. Treat those rules as review evidence, not optional suggestions.

Step 2: Build Three Review Tracks

The tracks are review lenses, not mutually exclusive buckets. A file may appear in more than one track when it contains both production behavior and tests.

TrackIncludePrimary questions
Coredomain logic, persistence, state, engines, manifests, wiringCan behavior violate architecture, invariants, data integrity, or concurrency guarantees?
InterfaceAPI/HTTP handlers, CLI, MCP, bridges, schemas, parsers, external integrationsAre trust boundaries validated, contracts stable, errors safe, and dependency failures handled?
Teststest directories/files plus inline test modules in production filesDo tests prove important behavior, failure paths, boundaries, and isolation without false positives?

Use project structure and imports first, then naming heuristics. For Rust, find inline tests explicitly:

rg -l '#\[cfg\(test\)\]|#\[(tokio::)?test\]' --glob '*.rs' .

Intersect these results with the scope manifest. Do not pass hundreds of file paths on the command line or allow this repository-wide discovery command to broaden range/path findings.

Typical Interface hints include routes/, handlers/, schemas/, api/, cli/, mcp/, bridge/, integrations/, and project-specific boundary crates. A public lib.rs, main.rs, or manifest can also belong to Core because it defines wiring or dependencies.

If a track has no files, mark it N/A with the reason. Do not launch an empty review agent and do not penalize the score.

Step 3: Run Non-Mutating Validation

Use commands documented by the project. Do not invent scripts or change files to make checks pass.

For a Cargo workspace whose project rules match Edda:

cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace

For a focused crate, first read its Cargo.toml to obtain the actual package name, then use -p <package-name>. For JavaScript/TypeScript, read package.json and run only scripts that actually exist. Apply the same evidence-first rule to other stacks.

Record each command, exit status, and relevant failure excerpt. A failed check is evidence to investigate, not automatically a P0. If a tool is unavailable, a command times out, or the project documents no suitable command, report NOT RUN with the reason.

Step 4: Execute Track Reviews

Run the non-empty tracks in parallel when agent delegation is available; otherwise run three separate passes with the same contracts. Give each track:

  1. its exact file list
  2. the scope manifest and project evidence
  3. relevant validation output
  4. the track questions below
  5. the finding contract

Every reviewer must read the relevant code before judging it, trace definitions and call sites far enough to prove reachability, and remain inside the assigned review scope.

Core lens

  • Check documented layer and module boundaries against actual imports and manifests.
  • Trace state transitions, transactions, serialization, concurrency, and error paths for invariant violations.
  • Treat unsafe, panic paths, suppression attributes, unchecked conversions, and swallowed errors according to project rules and reachability.
  • Distinguish dead code from public extension points using callers and tests, not naming alone.

Interface lens

  • Identify every trust boundary and verify input shape, size, encoding, authentication/authorization when applicable, and command/SQL construction.
  • Compare request, response, CLI, event, and schema behavior with existing contracts and callers.
  • Trace external dependency failures, timeouts, retries, cancellation, error exposure, and partial success.
  • Check bounds and resource controls where user input can amplify work.

Tests lens

  • Map critical production behavior to happy path, error path, and boundary assertions.
  • Include Rust inline #[cfg(test)] modules; do not rely only on filenames or tests/ directories.
  • Detect assertions that can pass without proving the result, order-dependent state, over-mocking, leaked resources, and ignored failures.
  • Report missing tests only when tied to a concrete risk or changed behavior.

Finding Contract

Only report a finding when all required fields are supported:

#### [P0|P1] <short problem statement>
- Evidence: `<file>:<line>` - <specific code behavior>
- Impact: <reachable failure or violated invariant>
- Required outcome: <observable condition that must become true>
- Confidence: High | Medium

Severity rules:

SeverityUse when
P0Proven exploitable security issue, data loss/corruption, broken build/runtime critical path, or documented safety invariant violation
P1Proven material correctness, reliability, maintainability, or test risk that is not immediately critical
omitStyle preference, speculative concern, or behavior already enforced by tooling with no residual risk

Low-confidence concerns belong in Open Questions, not findings. Each finding needs a real file and line, a reachable impact, and no duplicate from another track.

Step 5: Reconcile and Score

Merge duplicates by root cause. When tracks disagree, re-read the evidence; do not average confidence or keep contradictory findings.

Assign each non-empty track a deterministic grade:

GradeRule
DA deployment-unsafe P0: exploitable security, plausible data loss/corruption, or systemic architecture/safety failure
CAny other P0
BThree or more P1s, or one cross-cutting P1 affecting multiple modules
B+One or two localized P1s
ANo P0/P1, complete coverage, and required validation passed

If required validation was not run, the highest possible track grade is B+. If coverage is incomplete, use INCOMPLETE instead of a grade. The overall score is the worst non-N/A track grade (risk-first), not a subjective or file-count weighted average. Any explicit auto-fail rule in .claude/review-config.md overrides this table.

Step 6: Produce the Report

Use this exact structure:

# Code Review Report - <project>

## Verdict: <A | B+ | B | C | D | INCOMPLETE>
<one sentence tied to the highest-risk evidence>

## Scope and Coverage
- Mode: <full | range | path>
- Scope: `<expression>`
- Repository state: <HEAD/working tree and dirty status>
- Reviewed: <count>/<count> files
- Excluded: <count with reasons>
- Unreviewed: <none or exact paths>

## Validation
| Command | Result | Evidence |
|---------|--------|----------|
| `<command>` | PASS / FAIL / NOT RUN | <short excerpt or reason> |

## Track Grades
| Track | Grade | Files | Reason |
|-------|-------|-------|--------|
| Core | <grade/N/A> | <count> | <evidence-based sentence> |
| Interface | <grade/N/A> | <count> | <evidence-based sentence> |
| Tests | <grade/N/A> | <count> | <evidence-based sentence> |

## P0 - Must Fix
<findings or "None">

## P1 - Should Fix
<findings or "None">

## Test Gaps
<risk-linked gaps or "None">

## Systemic Issues
<cross-cutting root causes or "None">

## Open Questions
<unverified concerns or "None">

Do not show an A verdict when checks were skipped or coverage is incomplete. Positive observations are optional and must cite evidence; they never cancel a finding.

Step 7: Draft or Create GitHub Issues

Skip this step unless --create-issues was supplied. The flag authorizes drafting, not immediate creation.

  1. Exclude low-confidence questions and deduplicate against open issues.
  2. Create one draft per P0. Group P1s only when they share a root cause, module, and acceptance boundary.
  3. Keep each issue to one independently verifiable PR.
  4. Check repository and existing labels before proposing them:

    gh auth status
    gh repo view --json nameWithOwner,url
    gh label list --limit 200
    gh issue list --state open --limit 200
  5. Present a confirmation table with title, severity, evidence, scope, and labels.
  6. Explicit confirmation required. STOP and create nothing until the user explicitly approves that table.
  7. After approval, run gh issue create for approved rows only and report each returned URL.

Never create missing labels, modify code, or broaden issue scope as part of this skill unless the user separately asks.


Recovery Rules

FailureRequired response
invalid range or outside-repo pathstop and show the failing input
zero reviewable filesreturn NO REVIEWABLE FILES; no score
relevant dirty worktreeask which repository state to review
validation command failsinvestigate and include evidence; continue the review
one track failsretry once; if still unavailable, mark coverage INCOMPLETE
GitHub CLI/auth failurekeep issue drafts in the report and create nothing

Anti-Patterns

  1. Hardcoded layout or language - never assume src/, TypeScript, or Rust without manifest evidence.
  2. Silent sampling - never review the first N files and imply full coverage.
  3. Exclusive test classification - inline tests may share files with production code.
  4. Review without reading - searches identify candidates; they do not prove findings.
  5. Vague findings - every P0/P1 needs file:line, reachable impact, and confidence.
  6. Severity inflation - missing polish or speculative risk is not P0.
  7. Style review - leave formatting and lint-only concerns to configured tooling.
  8. Range leakage - supporting context is not permission to report unrelated legacy issues.
  9. Score inflation - skipped checks or incomplete coverage cannot receive A.
  10. Unconfirmed writes - reviews are read-only; issue creation requires explicit approval.

Related Skills

SkillUse when
pr-reviewReview an open PR before merge
code-reviewReview merged code, a commit range, or a bounded codebase path
issue-scanDiscover and prioritize new work across the codebase
plan-validateValidate a proposed plan against actual code

Project References

  • AGENTS.md
  • CLAUDE.md
  • .claude/review-config.md

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.