Skip to content

Feature Review

Ali Sadeghi edited this page May 28, 2026 · 3 revisions

Feature Review

Reviews a feature module against Clean Architecture, the 11 critical rules, the 4 integration points, the UI file-organization allowlist, and spec compliance (if a spec exists).

Usage:

/feature-review login
/feature-review dashboard
/feature-review productcatalog

What Gets Checked

Architecture rules (11)

# Rule Check
1 Interface + Impl DataSource and Repository have both interface and Impl
2 Either All fallible operations return Either<T>
3 setState ViewModel uses _uiModel.setState { copy() }, never direct assignment
4 4 UI States Screen handles Uninitialized / Loading / Success / Failed (generic UiState<DTO>)
5 X-Components Uses X-components from :core:designsystem, not Material3
6 ImmutableList Collections use .toImmutableList()
7 Lowercase packages Package names lowercase, no hyphens / camelCase / underscores
8 DI Binding singleOf(::Impl).bind<Interface>() + object … : BaseFeature
9 No UseCases ViewModels invoke repositories directly
10 Callback params Screens take callbacks, not navController
11 Single UiModel + DTO-wrapped UiState No *UiState.kt; UiState<T> wraps DTOs from data/model/; data/ has no presentation imports

UI file organization

  • {Feature}Screen.kt allowlist: Screen, ScreenRoot, optional LoadingContent/FailedContent/EmptyContent — nothing else (any other top-level @Composable fun is a Warning, @Preview exempt)
  • {Feature}Content and all sub-components live one-per-file under presentation/ui/components/
  • Non-composable helpers go in presentation/ui/{Feature}Utils.kt, never under components/
  • Preview import must be androidx.compose.ui.tooling.preview.Preview (CMP 1.11.0+)

Integration points (4)

Point File Pattern
1 settings.gradle.kts include(":feature:{featurename}")
2 composeApp/build.gradle.kts implementation(project(":feature:{featurename}"))
3 initKoin.kt {Feature}Modules.initialize()
4 BaseAppNavHost.kt {featurename}(onBackClick = …)

Spec compliance (if spec.md exists)

Section Validation
Data Models Spec vs model/*.kt
Interfaces Spec method signatures vs actual
State Management Spec UiModel (fields + UiState<DTO> slots) vs actual
Navigation Spec callbacks vs actual

How It Works

  1. Validates feature/{name}/ exists.
  2. Spawns the Code-Reviewer agent.
  3. Agent globs feature files and reads spec.md if present.
  4. Greps for the 11 rules and 4 integration points in parallel (Rule 11 runs first as a cheap grep gate).
  5. Compares against the spec.
  6. Writes review.md and fixes.md.

Output Files

File Content
.claude/docs/{featurename}/review.md Pass/Warning/Fail summary, spec-compliance table, per-rule findings, ranked recommendations
.claude/docs/{featurename}/fixes.md Concrete file:line fixes — current vs fixed code blocks, paste-ready

Outcome Statuses

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

After Review

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

# Re-review after applying fixes
/feature-review {featurename}

# Detect spec drift
/audit-spec {featurename} --compare

Back to Commands

Clone this wiki locally