npx skills add ...
npx skills add affaan-m/ecc --skill compose-multiplatform-patterns
Compose Multiplatform and Jetpack Compose patterns for KMP projects — state management, navigation, theming, performance, and platform-specific UI. Use when building Compose or Jetpack Compose UI, state, navigation, or theming in a KMP project.
npx skills add affaan-m/ecc --skill compose-multiplatform-patterns
Patterns for building shared UI across Android, iOS, Desktop, and Web using Compose Multiplatform and Jetpack Compose. Covers state management, navigation, theming, and performance.
Use a single data class for screen state. Expose it as StateFlow and collect in Compose:
For complex screens, use a sealed interface for events instead of multiple callback lambdas:
Define routes as @Serializable objects:
Use dialog() and overlay patterns instead of imperative show/hide:
Design composables with slot parameters for flexibility:
Modifier order matters — apply in this sequence:
Mark classes as @Stable or @Immutable when all properties are stable:
key() and Lazy Lists CorrectlyderivedStateOfmutableStateOf in ViewModels when MutableStateFlow with collectAsStateWithLifecycle is safer for lifecycleNavController deep into composables — pass lambda callbacks instead@Composable functions — move to ViewModel or remember {}LaunchedEffect(Unit) as a substitute for ViewModel init — it re-runs on configuration change in some setupsSee skill: android-clean-architecture for module structure and layering.
See skill: kotlin-coroutines-flows for coroutine and Flow patterns.