android-compose
Installation
SKILL.md
Android Jetpack Compose Guide
Applies to: Android SDK 24+, Jetpack Compose 1.5+, Kotlin 1.9+, Material Design 3
Core Principles
- Declarative UI: Describe what the UI should look like, not how to build it step-by-step
- Unidirectional Data Flow: State flows down, events flow up -- always
- Composable Functions Are Cheap: The framework handles when to recompose; keep composables pure
- State Hoisting: Lift state to the nearest common ancestor that needs it
- Lifecycle Awareness: Collect flows with
collectAsStateWithLifecycle(), never rawcollectAsState()
Guardrails
Composable Conventions
- Every composable accepts
modifier: Modifier = Modifieras its first optional parameter - Keep composables small and focused (one responsibility per function)
- Use
@Previewon every reusable component with representative data
Related skills