android-compose-architecture-review
Skill4 starsChanged 3 months agoMITView on GitHub
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.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accessibility-annotationsSkill
- android-accessibility-validatorSkill
- android-kotlin-api-design-reviewerSkill
- android-performance-profilerSkill
- flutter-accessibility-validatorSkill
- flutter-bug-investigationSkill
- flutter-code-reviewSkill
- flutter-design-architectureSkill
- flutter-feature-analysisSkill
- flutter-feature-implementationSkill
- flutter-performance-optimizerSkill
- ios-accessibility-validatorSkill
- ios-performance-profilerSkill
- ios-swift-api-design-reviewerSkill
- ios-swiftui-architecture-reviewSkill
- shared-bug-investigationSkill
- shared-perf-comparison-videoSkill
- shared-product-motion-videoSkill
- shared-task-workflowSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
Use unidirectional data flow: state flows down, events flow up
- Distinctive: line 35
Prefer stateless composables (receive value + onChange callbacks)
- Distinctive: line 36
Use plain state-holder classes for complex state not tied to lifecycle
- Very specific: line 37
Prefer side effects via LaunchedEffect (async work), DisposableEffect (cleanup), SideEffect (framework integration), produceState, …
- Very specific: line 38
Use SavedStateHandle for persistent state across process death
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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-androidAgent 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 onlyrememberSaveable- survive config changesViewModelwithStateFlow/MutableStateFlow- screen statecollectAsStateWithLifecycle()- lifecycle-aware collectionderivedStateOf- computed state from other state- CompositionLocal - shared read-only state
- Use unidirectional data flow: state flows down, events flow up
- Prefer stateless composables (receive value + onChange callbacks)
- Use plain state-holder classes for complex state not tied to lifecycle
- Prefer side effects via
LaunchedEffect(async work),DisposableEffect(cleanup),SideEffect(framework integration),produceState,rememberCoroutineScope, orsnapshotFlowrather than arbitrary side effects in composable bodies - Use
SavedStateHandlefor persistent state across process death
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
| Issue | Fix |
| Business logic in composable | Extract to ViewModel |
| Network call in composable | Move to ViewModel with LaunchedEffect |
| Singleton in composable | Inject via DI or CompositionLocal |
| 200+ line composable | Break into smaller components |
| State not hoisted | Hoist to parent or ViewModel |
| Side effects or network calls directly in composable | Wrap in LaunchedEffect(key) { ... } or move to ViewModel |
| Stateful composable when stateless would suffice | Hoist state and pass value + lambda |
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
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

