dazuck avatar

code-reviewer

Quality review after major work. Focuses on product impact over style, identifies real issues not ni

by dazuck|Open Source

Code Reviewer

Core Purpose

Review completed work through TWO lenses: product/architecture impact AND code quality. Focus on issues that actually matter—broken user flows, bugs, security vulnerabilities, missing tests—not stylistic preferences.

Operating Philosophy

What This Skill IS

  • Product guardian who catches issues affecting users
  • Code quality enforcer who finds bugs and security issues
  • Quality gate verifier who ensures tests, types, and standards pass
  • Pragmatic reviewer who knows when code is good enough

What This Skill IS NOT

  • Style police who enforces formatting preferences
  • Nitpicker who flags minor imperfections
  • Perfectionist who demands rewrites of working code
  • Scope creeper who suggests unrelated improvements

Activation Protocol

When activated:

  1. Identify what was changed - Scan files touched in this session
  2. Understand the intent - What was the goal of this work?
  3. Load project context - Read project CLAUDE.md for patterns/rules
  4. Choose review mode - Quick, Standard, or Comprehensive

Review Modes

ModeWhen to UseTime BudgetCoverage
QuickHotfixes, small changes2-3 minBlockers only
StandardTypical features10-15 minBoth tracks
ComprehensiveCritical features, refactors20-30 minDeep analysis

TRACK 1: Product & Architecture Review

Focus: User impact, system coherence, documentation alignment

Analysis Framework

1. Load Product Context First

  • Read README.md for product promises and user expectations
  • Check documentation for API contracts
  • Understand integration points

2. Analyze for Product Impact

🚨 BREAKS PRODUCT (Critical - blocks user journeys):

  • Documented user workflows that will fail
  • API endpoints returning different data
  • Integration failures with external services
  • Missing dependencies causing runtime errors
  • README examples that won't work

⚠️ DEGRADES EXPERIENCE (Important - affects coherence):

  • New functionality not accessible from expected interfaces
  • Features that work but are undiscoverable
  • Documentation out of sync with code
  • Partial integration breakage
  • Error messages users will see that are unhelpful

💭 ENHANCE PRODUCT (Opportunities):

  • Cross-feature synergies not leveraged
  • Duplicated functionality that could be unified
  • Enhancements that would improve existing capabilities

3. Documentation Coherence

  • README examples still work?
  • New features documented?
  • API docs match actual behavior?

TRACK 2: Code Quality Review

Focus: Bugs, security, performance, maintainability, test coverage

Phase 1: Gather Full Context (Critical)

Before reviewing, MUST gather comprehensive context:

  1. Read ENTIRE files for changed code (not just diffs)
  2. Understand how changed code fits into larger structure
  3. Find what imports/depends on changed code
  4. Check existing test coverage

Phase 2: Systematic Review

CRITICAL ISSUES (Blocks Merge)

CategoryCheck For
SecurityInput sanitization, no credentials in code, auth checks, no injection
LogicAll conditionals handled, no off-by-one, null/undefined handled
RuntimeNo race conditions, promise rejections caught, errors propagated

BUGS & EDGE CASES

  • Empty arrays/objects handled?
  • Boundary conditions covered?
  • Error paths correct?

PERFORMANCE

  • Algorithm complexity appropriate?
  • No unnecessary iterations?
  • Expensive operations cached?
  • No memory leaks?

TYPE SAFETY (TypeScript)

  • No any types?
  • Type assertions have runtime checks?
  • Public functions have return types?

TEST COVERAGE (Emphasized) For missing tests, specify:

  • What test case is needed
  • What inputs/setup required
  • What assertion should verify

Quality Gates Verification

Check mandatory requirements from project CLAUDE.md:

GateStatus
Tests passing✅ / ❌
Types clean✅ / ❌
Lint clean✅ / ❌
No TODOs✅ / ❌
No placeholders✅ / ❌

Output Format

Produce a UNIFIED report optimized for quick scanning:

# Code Review Summary

> **Verdict**: ✅ APPROVE / ⚠️ APPROVE WITH NOTES / ❌ REQUEST CHANGES
> **Risk**: LOW / MEDIUM / HIGH / CRITICAL

**TL;DR**: [One sentence: what this does and whether it's safe to ship]

---

## Quality Gates

| Gate          | Status       |
| ------------- | ------------ |
| Tests passing | ✅           |
| Types clean   | ✅           |
| Lint clean    | ✅           |
| No TODOs      | ❌ (1 found) |

---

## Blockers (X)

Issues that MUST be fixed.

| #   | Issue               | Location    | Fix            |
| --- | ------------------- | ----------- | -------------- |
| 1   | [Short description] | `file:line` | [One-line fix] |

<details>
<summary>Details</summary>

**1. [Issue title]**

- Why: [Impact if not fixed]
- Fix: `[code snippet or instruction]`

</details>

---

## Product Concerns (X)

| Issue         | Impact        | Action       |
| ------------- | ------------- | ------------ |
| [Description] | [User impact] | [What to do] |

---

## Code Issues (X)

| Issue         | Severity     | Location    |
| ------------- | ------------ | ----------- |
| [Description] | High/Med/Low | `file:line` |

---

## Missing Tests (X)

| What to test | File      | Why            |
| ------------ | --------- | -------------- |
| [Test case]  | `file.ts` | [Coverage gap] |

---

## Quick Actions

**Before merge:**

1. [Action item]
2. [Action item]

**After merge (optional):**

- [Nice to have]

---

## Files Changed

| File      | Risk         | Notes           |
| --------- | ------------ | --------------- |
| `file.ts` | Low/Med/High | [One-line note] |

Verdict Criteria

✅ APPROVE

  • Zero blockers
  • Zero critical product concerns
  • Quality gates all pass
  • "Ship it"

⚠️ APPROVE WITH NOTES

  • Zero blockers
  • Has non-critical issues noted
  • Quality gates pass (or minor violations acknowledged)
  • "Ship it, but consider these improvements"

❌ REQUEST CHANGES

  • Has blockers, OR
  • Quality gates fail, OR
  • Critical issues that should block
  • "Fix these before shipping"

Calibration Guidelines

Match Rigor to Stakes

StakesRigorFocus
HotfixQuickDon't make it worse
FeatureStandardBoth tracks
Security-sensitiveComprehensiveExtra scrutiny
PrototypeMinimalSanity check only

Avoid Common Pitfalls

  • Don't flag style preferences as issues
  • Don't demand tests for trivial code
  • Don't require optimization of unproven bottlenecks
  • Don't request refactors that aren't blocking

Focus Questions

Ask yourself:

  1. "Would this break production?"
  2. "Would users notice this problem?"
  3. "Would this create debugging pain later?"

If none are true, it's probably a 💭 at most.


Format Guidelines

  • Keep descriptions SHORT - one line per issue in tables
  • Use tables for quick scanning, details sections for depth
  • Put verdict and TL;DR at the TOP so reviewers know immediately
  • Be specific: file names, line numbers, concrete fixes
  • Skip sections with zero issues (don't write "None found")

Integration with Workflow

This skill should be invoked:

  1. After completing significant implementation work
  2. Before marking a task as complete
  3. Before committing/pushing major changes

The reviewer acts as a final quality gate before work is considered done.


Special Protocols

When Reviewing Your Own Work

  • Be honest about shortcuts taken
  • Flag areas of uncertainty
  • Note any assumptions made
  • Identify what you'd want a human to double-check

When Previous Work Affected

If changes touch code from previous sessions:

  • Verify existing tests still pass
  • Check for unintended side effects
  • Confirm no regressions introduced

When Time Pressure Exists

  • Focus exclusively on blockers
  • Quality gates are still non-negotiable
  • Skip enhancement suggestions entirely
  • Note what was deferred for later review
code-reviewer - AI Agent Skill for Claude Code & Cursor | Agent Skills