Skip to content

Feature Review

Ali Sadeghi edited this page Jan 27, 2026 · 3 revisions

Feature Review

Reviews a KMP feature module against Clean Architecture guidelines, 10 critical rules, 4 integration points, and spec compliance.

Usage:

/feature-review login
/feature-review profile
/feature-review productcatalog

What Gets Checked

Architecture Rules (10 Checks)

Rule Check
1. Interface + Impl DataSource and Repository have both interface and Impl
2. Either All fallible operations return Either
3. setState ViewModel uses setState { } extension, not direct assignment
4. 4 UI States Screen handles Uninitialized, Loading, Success, Failed
5. X-Components Uses X-components from designsystem, not Material3 components
6. ImmutableList Collections use .toImmutableList()
7. Lowercase packages Package names are lowercase (no hyphens/camelCase)
8. DI Binding Uses singleOf(::Impl).bind<Interface>() pattern
9. No UseCases ViewModels invoke repositories directly
10. Callback params Screens take callbacks, not navController

Integration Points (4 Checks)

Point File Pattern
1 settings.gradle.kts include(":feature:{name}")
2 composeApp/build.gradle.kts implementation(project(":feature:{name}"))
3 initKoin.kt {Feature}Modules.initialize()
4 BaseAppNavHost.kt Navigation route + callback wiring

Spec Compliance (If spec.md exists)

Section Validation
Data Models Compare spec vs actual models
Interfaces Verify method signatures match
State Management Validate UiState structure
Navigation Check routes and callbacks

How It Works

  1. Validates feature exists in feature/{name}/
  2. Invokes the code-reviewer agent
  3. Loads context - Globs all feature files, reads spec.md if exists
  4. Checks spec compliance - Compares implementation against spec
  5. Checks architecture rules - Grep-based pattern matching
  6. Checks integration points - Verifies all 4 points are wired
  7. Generates reports - review.md and fixes.md

Output Files

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

  • Summary with pass/warning/fail counts
  • Spec compliance table (if spec exists)
  • Detailed findings per rule and integration point
  • Recommendations (Critical, Warnings, Suggestions)

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

  • Specific code fixes with file:line references
  • Current code vs fixed code blocks
  • Explanations for each fix

Outcome Statuses

Status Meaning
PASS All rules and integrations pass
PASS WITH WARNINGS Minor issues, non-blocking
FAIL Critical violations found

After Review

If issues are found:

# View detailed review
cat .claude/docs/{featurename}/review.md

# View specific fixes
cat .claude/docs/{featurename}/fixes.md

# Apply fixes and re-review
/feature-review {featurename}

If spec drift is detected:

# Compare spec with implementation
/audit-spec {featurename} --compare

Back to Commands

Clone this wiki locally