Skip to content

Code Reviewer

Ali Sadeghi edited this page May 18, 2026 · 8 revisions

Code Reviewer Agent

Reviews feature implementations against architecture rules and spec compliance.

Invoked via: /feature-review {featurename} Model: sonnet · Color: red · Allowed tools: Read, Grep, Glob, Write

/feature-review dashboard

Workflow

Phase 1 — Context Loading (parallel)

Glob: feature/{featurename}/**/*.kt
Read: .claude/docs/{featurename}/spec.md (if exists)

If the feature isn't found → error and stop. If the spec is missing → continue and note in the review, recommend /audit-spec {featurename}.

Phase 2 — Architecture Rules (grep-first)

# Rule Check pattern
1 Interface + Impl Glob datasource/*.kt → expect 2+ files
2 Either Grep suspend fun.*:.*Either<
3 setState Grep _state\.value\s*= → 0; Grep setState\s*\{ → 1+
4 4 UI States Read Screen, verify Uninitialized/Loading/Success/Failed
5 X-Components Grep Material3 component imports → 0
6 ImmutableList Grep toImmutableList() in UiModel
7 Lowercase packages Grep package.*{featurename} all lowercase
8 DI Binding Grep singleOf.*bind< in Modules.kt
9 No UseCases Grep UseCase → 0
10 Callbacks Read Screen params → no navController

Phase 3 — Integration Points (parallel grep)

# File Pattern
1 settings.gradle.kts include.*:feature:{featurename}
2 composeApp/build.gradle.kts implementation.*:feature:{featurename}
3 initKoin.kt {Feature}Modules.initialize()
4 BaseAppNavHost.kt {featurename}(

Phase 4 — Spec Compliance (if spec exists)

Compares implementation against spec.md:

  • Data models — spec vs model/*.kt
  • Interfaces — spec methods vs actual
  • State — spec UiState vs actual
  • Navigation — spec callbacks vs actual

Output Files

.claude/docs/{featurename}/review.md

# Code Review: {Feature}
**Date**: {date} | **Spec**: {version or missing}

## Summary
✅ Passed: X/Y | ⚠️ Warnings: N | ❌ Critical: M
**Status**: PASS / PASS WITH WARNINGS / FAIL

## Spec Compliance
| Section | Status | Details |
|---------|--------|---------|
| Data Models | ✅ / ⚠️ | ... |
| Interfaces | ✅ / ⚠️ | ... |
| State | ✅ / ⚠️ | ... |
| Navigation | ✅ / ⚠️ | ... |

## Rules (1-10)
### ✅ / ❌ Rule N: {Name}
**Files:** path:line
**Findings:** ...

## Integration (1-4)
### ✅ / ❌ Point N: {Name}
**Found:** YES / NO (line)

## Recommendations
### Critical (P1)
1. {issue} → {fix} @ file:line

### Warnings (P2)
1. {issue} → {fix} @ file:line

.claude/docs/{featurename}/fixes.md

Concrete code fixes with file:line, current code block, fixed code block, and explanation. Designed to be paste-ready.

Efficiency Rules

  • Grep first; Read only when needed.
  • Parallel calls for independent checks.
  • Always include file:line references.
  • Critical vs style distinction made explicit.

See also: Feature-Review · Audit-Spec

Back to Code-Quality-Agents | Agents

Clone this wiki locally