android-compose-architecture-review

Analyze Jetpack Compose UI hierarchies and suggest MVVM/MVI or other architectural improvements. Use when **reviewing existing Compose code**, creating new Compose components, analyzing composable structure, or when the user asks about Compose architecture patterns. Best for code review and refactoring guidance.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "android-compose-architecture-review" with this command: npx skills add desquared/agents-rules-skills/desquared-agents-rules-skills-android-compose-architecture-review

Compose Architecture Review

When to Use This Skill:

  • Reviewing EXISTING Compose screens/ViewModels
  • Code review for architectural violations
  • Refactoring guidance for specific files
  • Validating state management patterns

When to Use project-architecture-analyst-android Agent Instead:

  • Planning NEW features (uncertain file placement)
  • Understanding project-wide architecture
  • Major changes affecting multiple modules
  • Need to discover existing patterns before implementing

Review Checklist

Separation of Concerns

  • Composables: presentation only (no business logic, network, DB)
  • ViewModels: state + business logic (StateFlow, events)
  • Repository/UseCase: data access separated from UI

State Management

  • remember - composable-local state only
  • rememberSaveable - survive config changes
  • ViewModel with StateFlow/MutableStateFlow - screen state
  • collectAsStateWithLifecycle() - lifecycle-aware collection
  • derivedStateOf - computed state from other state
  • CompositionLocal - shared read-only state

State Lifecycle Issues

  • No leaked ViewModels (use viewModel() or hiltViewModel())
  • Proper cleanup in ViewModel.onCleared()
  • StateFlow collected with lifecycle awareness
  • No unnecessary state hoisting

Dependency Injection

  • Dependencies injected (check project: Koin, Hilt, Dagger, or manual)
  • No hardcoded singletons in composables
  • ViewModels receive dependencies via constructor

Composable Design

  • Composables are small (single responsibility)
  • Complex screens broken into components
  • Reusable components extracted
  • Stateless composables preferred (state hoisting)

Common Issues

IssueFix
Business logic in composableExtract to ViewModel
Network call in composableMove to ViewModel with LaunchedEffect
Singleton in composableInject via DI or CompositionLocal
200+ line composableBreak into smaller components
State not hoistedHoist to parent or ViewModel

State Hoisting Pattern

Composable receives: value: T, onValueChange: (T) -> Unit ViewModel holds: MutableStateFlow<T>

Severity

  • 🔴 Critical: Architecture violation
  • 🟡 Improvement: Better pattern available
  • 🟢 Enhancement: Optional optimization

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

shared-bug-investigation

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

ios-accessibility-validator

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

android-accessibility-validator

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

ios-performance-profiler

No summary provided by upstream source.

Repository SourceNeeds Review
android-compose-architecture-review | V50.AI