Skip to content

Code Quality Agents

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

Code Quality Agents

Tools that validate implementations against the project's architectural rules and the feature's spec.

Agents

Reviews a feature against:

  • 10 critical architecture rules
  • 4 integration points
  • The feature's spec.md (if it exists)

Invocation:

/feature-review {featurename}

The command spawns the code-reviewer agent which globs feature files, greps for patterns, and writes .claude/docs/{featurename}/review.md plus fixes.md.

Related Commands

These commands perform code-quality tasks but don't spawn dedicated agents:

Command Purpose
Audit-Spec Audit or generate feature specifications, or detect drift
Coverage Generate Kover test-coverage reports
Features-Health Snapshot of spec / tests / review status across all features

What Code Review Validates

10 Critical Rules

  1. Interface + Impl — DataSource and Repository have interface + implementation pairs
  2. Either — All fallible operations return Either<T>
  3. setState_uiState.setState { copy() }, never _state.value =
  4. 4 UI States — Uninitialized / Loading / Success / Failed
  5. X-components:core:designsystem only, no Material3
  6. ImmutableList.toImmutableList() for state collections
  7. Lowercase packages{PKG_PREFIX}.featurename
  8. DI bindingsingleOf(::Impl).bind<Interface>() + object … : BaseFeature
  9. No UseCases — ViewModels invoke repositories directly
  10. Callback params — Screens take callbacks, not navController

4 Integration Points

  1. settings.gradle.kts — module included
  2. composeApp/build.gradle.kts — dependency added
  3. initKoin.kt{Feature}Modules.initialize()
  4. BaseAppNavHost.kt{featurename}(onBackClick = …)

Spec Compliance (if spec.md exists)

  • Data models match spec
  • Interface signatures match
  • UiState structure matches
  • Navigation callbacks match

Output Statuses

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

Sample Output

Reviewing feature: dashboard

✓ Data Layer
  ✓ DashboardRemoteDataSource: Interface + Impl found
  ✓ DashboardRepository: Interface + Impl found
  ✓ Either<T> used for all suspend functions

✓ UI Layer
  ✓ DashboardUiState: All 4 states present
  ✓ DashboardViewModel: Uses setState { }
  ✓ Screen + ScreenRoot pair present

✓ Integration
  ✓ settings.gradle.kts: Module included
  ✓ initKoin.kt: DashboardModules.initialize()
  ✓ BaseAppNavHost.kt: dashboard(...) wired

✅ Review Passed

Back to Agents

Clone this wiki locally