agentleFS
mhyllemhylle/claude-skills-collection/skills/code-review/SKILL.md

code-review

Skill19 starsChanged 10 months agoMITView on GitHub

Systematic code review for implementation phases verifying architectural principles, framework standards, ADR compliance, and code quality. This skill is invoked by implement-phase as part of its quality gate pipeline, or manually when reviewing code changes. Triggers on "review code", "code review", "/code-review", or automatically as Step 3 of implement-phase.

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

22 rules. 0 are common, 21 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 174 edited versions we read keep these.

  • 21

    Distinctive

    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:

    After each phase completes its functional verification

    line 19
  2. Distinctive:

    Before marking a phase as complete

    line 20
  3. Distinctive:

    Before proceeding to the next phase

    line 21
  4. Distinctive:

    Verify that implementation follows proper separation of concerns:

    line 32
  5. Distinctive:

    Verify code follows the project's established patterns:

    line 44
  6. Distinctive:

    Verify architectural decisions are followed and documented:

    line 57
  7. Distinctive:

    Verify the plan document reflects current state:

    line 68
  8. Distinctive:

    Verify implementation follows project coding standards:

    line 94
  9. Distinctive:

    When invoked by implement-phase (Step 3 of the phase pipeline), this skill:

    line 217
  10. Distinctive:

    Executes review: All five dimensions

    line 220
  11. Distinctive:

    If errors existed before, the previous phase wouldn't have completed

    line 331
  12. Very specific:

    All build/lint/type errors are blocking: - No exceptions

    line 350
  13. Distinctive:

    All test failures are blocking: - No exceptions

    line 351
  14. Distinctive:

    No need to check git blame: - If it's broken, fix it

    line 352
  15. Distinctive:

    When implementing on an existing codebase with pre-existing errors:

    line 357
  16. Distinctive:

    Fixing them becomes part of our work: - Add to the phase tasks if needed

    line 360
  17. Distinctive:

    Test coverage below project threshold (but not missing)

    line 380
  18. Distinctive:

    Check ADRs: - Don't flag violations of decisions that don't exist

    line 394
  19. Distinctive:

    Address blocking issues first: - Don't optimize while broken

    line 401
  20. Distinctive:

    Ask for clarification: - If a review finding is unclear, ask

    line 402
  21. Distinctive:

    Don't argue with patterns: - Follow established conventions, propose changes via ADR

    line 403
  22. Distinctive:

    Track warnings: - Create follow-up tasks for non-blocking issues

    line 404

“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

Code Review

Systematic code review skill that validates implementation quality across six dimensions: service delegation, framework standards, ADR compliance, plan synchronization, coding standards, and general code quality.

Design Philosophy

This skill acts as a quality gate between implementation phases. It ensures code meets established standards before proceeding, catching issues early when they're cheapest to fix.

When to Use This Skill

Automatically invoked by implement-plan:

  • After each phase completes its functional verification
  • Before marking a phase as complete
  • Before proceeding to the next phase

Manually invoked when:

  • Reviewing a PR or set of changes
  • Validating code before committing
  • Checking implementation against architectural decisions

Review Dimensions

1. Service Delegation & Single Responsibility

Verify that implementation follows proper separation of concerns:

CheckWhat to Look For
Controller thinControllers only handle HTTP concerns, delegate to services
Service focusedEach service has one clear responsibility
No god objectsNo classes/modules doing too many things
Dependency directionDependencies flow inward (controllers → services → repositories)
No business logic in wrong layerControllers don't contain business rules, repositories don't transform data

2. Framework Standards Compliance

Verify code follows the project's established patterns:

CheckWhat to Verify
Naming conventionsFiles, classes, methods follow project conventions
Module structureNew code follows existing module organization
Error handlingUses project's error handling patterns
LoggingFollows established logging conventions
ConfigurationUses project's config management approach
Testing patternsTests follow existing test structure and naming

3. ADR Compliance

Verify architectural decisions are followed and documented:

CheckWhat to Do
Read relevant ADRsCheck INDEX.md, identify ADRs related to this change
Verify complianceImplementation follows documented decisions
New decisions documentedAny new architectural choices have corresponding ADRs
No contradictionsChanges don't violate existing accepted ADRs

4. Plan Synchronization

Verify the plan document reflects current state:

CheckWhat to Verify
Checkboxes updatedCompleted tasks marked with [x]
Exit conditions recordedAll exit condition statuses updated
Deviations notedAny plan deviations documented with rationale
ADR references addedNew ADRs linked in plan where relevant
Phase status accurateCurrent phase progress matches reality

5. General Code Quality

Standard code review concerns:

CheckWhat to Look For
No security issuesNo injection vulnerabilities, proper auth checks
No hardcoded secretsNo API keys, passwords, or tokens in code
Error handlingErrors handled gracefully, not swallowed
Resource cleanupConnections, streams, handlers properly closed
No dead codeNo commented-out code, unused imports/variables
Test coverageNew code has appropriate test coverage
DocumentationComplex logic has explanatory comments

6. Coding Standards Compliance

Verify implementation follows project coding standards:

CheckWhat to Verify
File size limitsServices <500 lines, controllers <250 lines
Service delegationControllers thin, services focused
Interface usageDTOs and response types have interfaces
Error handlingDomain exceptions, no swallowed errors
LoggingProject logger used, no console.log
ConfigurationVia ConfigService, no hardcoded values
Forbidden patternsNo empty catch blocks, no unhandled promises

Reference: docs/standards/CODING_STANDARDS.md

Review Workflow

Step 1: Gather Context

1. READ the plan file to understand:
   - Current phase being reviewed
   - Expected deliverables
   - Exit conditions that should be met

2. READ docs/decisions/INDEX.md to identify:
   - ADRs relevant to this change
   - Recently added ADRs

3. IDENTIFY changed files using git:
   - git diff --name-only [base]...HEAD
   - Or use provided file list

Step 2: Framework Pattern Analysis

1. SPAWN codebase-pattern-finder to identify project conventions:
   - Service patterns
   - Controller patterns
   - Test patterns
   - Error handling patterns

2. COMPARE changed code against identified patterns

Step 3: Review Each Dimension

Execute reviews in parallel where possible:

Task (parallel): "Review service delegation in [files]"
Task (parallel): "Compare code against framework patterns found"
Task (parallel): "Check ADR compliance for [relevant ADRs]"
Task (parallel): "Verify plan file [path] is synchronized"
Task (parallel): "General code quality review of [files]"
Task (parallel): "Coding standards compliance check against docs/standards/CODING_STANDARDS.md"

Step 4: Generate Review Report

Output a structured review report:

# Code Review: [Phase/Feature Name]

**Date:** YYYY-MM-DD
**Files Reviewed:** [count]
**Verdict:** PASS | PASS_WITH_NOTES | NEEDS_CHANGES

## Summary

[1-2 sentence overall assessment]

## Review Results

### Service Delegation & Single Responsibility
Status: PASS | NEEDS_CHANGES

[Findings or "All checks passed"]

### Framework Standards Compliance
Status: PASS | NEEDS_CHANGES

[Findings or "All checks passed"]

### ADR Compliance
Status: PASS | NEEDS_CHANGES

[Findings or "All checks passed"]

### Plan Synchronization
Status: PASS | NEEDS_CHANGES

[Findings or "All checks passed"]

### General Code Quality
Status: PASS | NEEDS_CHANGES

[Findings or "All checks passed"]

### Coding Standards Compliance
Status: PASS | NEEDS_CHANGES

[Findings or "All checks passed"]

## Required Changes

[Numbered list of changes required before approval, or "None"]

## Recommendations

[Optional improvements that don't block approval]

## Files Reviewed

| File | Status | Notes |
|------|--------|-------|
| `path/to/file.ts` | OK | |
| `path/to/other.ts` | ISSUE | [Brief note] |

Integration with implement-phase

When invoked by implement-phase (Step 3 of the phase pipeline), this skill:

  1. Receives context: Phase number, changed files, plan path
  2. Executes review: All five dimensions
  3. Returns structured result:
STATUS: PASS | NEEDS_CHANGES
VERDICT: [Brief summary]
CHANGES_REQUIRED: [Count or "None"]
BLOCKING_ISSUES:
- [List of blocking issues, or "None"]
RECOMMENDATIONS:
- [List of non-blocking suggestions]
REPORT: [Path to full review report, if written to disk]

Implement-Phase Integration Point

This skill is Step 3 in the implement-phase pipeline:

Step 1: Implementation (subagents)
Step 2: Exit condition verification
Step 3: CODE-REVIEW (this skill) ←
Step 4: ADR compliance check
Step 5: Plan synchronization
Step 6: Completion report

The implement-phase skill handles retry logic:

1. INVOKE code-review skill for the phase
2. IF code-review returns NEEDS_CHANGES:
   a. PRESENT blocking issues
   b. SPAWN fix subagents for each issue
   c. Re-run code-review
   d. REPEAT until PASS (max 3 retries)
3. PROCEED to Step 4 (ADR compliance)

Invoking the Skill

From implement-phase (automatic)

Skill(skill="code-review"): Review Phase 2 implementation.

Context:
- Plan: docs/plans/auth-implementation.md
- Phase: 2 (Authentication Service)
- Changed files: src/auth/auth.service.ts, src/auth/auth.guard.ts, src/auth/jwt.strategy.ts

Return structured result for implement-phase orchestrator.

Manual invocation

/code-review

Review the authentication changes in src/auth/.
Focus on: service delegation, NestJS patterns, and ADR-0012 compliance.

Review Checklists

Detailed checklists are available in references:

  • service-delegation-checklist.md
  • framework-standards-checklist.md
  • adr-compliance-checklist.md
  • general-quality-checklist.md
  • coding-standards-checklist.md

Severity Levels

LevelMeaningAction
BLOCKINGMust fix before proceedingPhase cannot complete
WARNINGShould fix, but doesn't blockNote for follow-up
INFOSuggestion for improvementOptional enhancement

Critical Rule: All Errors Are New Errors

Every phase ends with a clean baseline (exit conditions pass). Therefore, ANY error present at code review time was introduced by this phase.

The Clean Baseline Principle

The implement-phase pipeline guarantees:

Previous Phase → Exit Conditions PASS → Clean State
                                            ↓
Current Phase Implementation
                                            ↓
Code Review ← ANY errors here are from THIS phase

Since each phase must pass exit conditions (build, lint, typecheck, tests) before completion:

  • The previous phase left the codebase in a clean state
  • Any errors now present were introduced by the current phase
  • This applies to ALL files, not just files we directly modified

Why This Works

StateImplication
Lint passed before this phaseAny lint errors now = we caused them
Build passed before this phaseAny build errors now = we caused them
Tests passed before this phaseAny test failures now = we caused them
No type errors before this phaseAny type errors now = we caused them

There is no "pre-existing error" exception because:

  • If errors existed before, the previous phase wouldn't have completed
  • Exit conditions are blocking gates - phases cannot complete with errors
  • The baseline is always clean

Errors in Unchanged Files

Even errors in files we didn't directly modify are our responsibility:

Example: We modify src/auth/types.ts
         This causes type errors in src/api/endpoints.ts (which imports our types)

         → The error in endpoints.ts is OUR error
         → We broke it by changing the types it depends on
         → This is BLOCKING

What This Means for Code Review

  1. All build/lint/type errors are blocking - No exceptions
  2. All test failures are blocking - No exceptions
  3. No need to check git blame - If it's broken, fix it
  4. No "tech debt" exceptions - We leave clean, we inherit clean responsibility

Inherited Codebases

When implementing on an existing codebase with pre-existing errors:

  • Pre-existing errors are still blocking - We cannot complete a phase with errors
  • Fixing them becomes part of our work - Add to the phase tasks if needed
  • We are responsible for leaving clean - The next phase deserves a clean baseline

The principle is simple: every phase must end clean. If we inherit a mess, cleaning it up is our job before we can complete the phase.

Blocking Issues (always fail review)

  • Security vulnerabilities (injection, auth bypass, etc.)
  • Hardcoded secrets or credentials
  • Violation of accepted ADR
  • Missing test coverage for new functionality
  • Build/lint/typecheck failures (in ANY file)
  • Broken single responsibility (god classes/modules)
  • Business logic in wrong layer

Warning Issues (review passes with notes)

  • Minor pattern deviations
  • Missing documentation on complex code
  • Suboptimal but functional implementation
  • Test coverage below project threshold (but not missing)

Info Issues (suggestions only)

  • Code style preferences not enforced by linter
  • Alternative implementation approaches
  • Performance optimization opportunities
  • Future refactoring candidates

Best Practices

For Effective Reviews

  1. Read the plan first - Understand intent before judging implementation
  2. Check ADRs - Don't flag violations of decisions that don't exist
  3. Be specific - "Line 45: missing null check" not "error handling is bad"
  4. Prioritize - Lead with blocking issues, don't bury them in warnings
  5. Verify fixes - Re-run review after changes, don't assume

For Review Consumers

  1. Address blocking issues first - Don't optimize while broken
  2. Ask for clarification - If a review finding is unclear, ask
  3. Don't argue with patterns - Follow established conventions, propose changes via ADR
  4. Track warnings - Create follow-up tasks for non-blocking issues

Example Review Session

implement-phase: Step 2 (exit conditions) passed. Running Step 3: code review.

code-review: Reviewing Phase 2: Authentication Service

Files: src/auth/auth.service.ts, auth.guard.ts, jwt.strategy.ts

● Checking service delegation...
  - ✅ Controllers thin, delegate to AuthService
  - ✅ AuthService focused on authentication only
  - ✅ No business logic in guards

● Checking framework standards...
  - ✅ Follows NestJS injectable patterns
  - ✅ Uses project's config service
  - ⚠️ Logger not using project's custom logger

● Checking ADR compliance...
  - ✅ ADR-0012 (JWT auth): Compliant
  - ✅ No contradictions with existing ADRs

● Checking plan synchronization...
  - ✅ All Phase 2 tasks marked complete
  - ✅ Exit conditions recorded
  - ⚠️ Missing link to ADR-0012 in plan

● Checking general quality...
  - ✅ No security issues
  - ✅ Test coverage adequate
  - ✅ No dead code

STATUS: PASS_WITH_NOTES
VERDICT: Code meets standards with minor improvements suggested
CHANGES_REQUIRED: 0
BLOCKING_ISSUES: None
RECOMMENDATIONS:
- Use project's CustomLogger instead of NestJS Logger
- Add ADR-0012 reference to plan's Phase 2 section

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.