A specialized skill for AI coding assistants (Claude, Copilot, Antigravity) to help implement high-performance, maintainable, and bug-free Jetpack Compose and Compose Multiplatform (KMP) code.
The skill provides comprehensive guidance on the following areas:
- Function Separation: Guidelines on keeping composables small and managing recomposition scopes.
- Argument Best Practices: Proper use of default values and exposed
Modifierparameters. - Component Reuse: Strategies for extracting and organizing shared UI elements (App-wide, Feature-wide, Screen-level).
- Design System Integration: Usage of centralized dimensions and naming conventions for UI constants.
- State Hoisting: Rules for choosing the correct level for state ownership.
- Property Drilling Prevention: Passing only necessary data to child composables.
- derivedStateOf: Proper usage for caching and performance optimization.
- State Styles: Guidance on MVI (default) vs MVVM architectural patterns.
- State Transfer: Efficiently moving data from ViewModel to UI using
StateFlowandstateIn. - Event Handling: Robust patterns for one-off events (e.g., navigation, snackbars) using
LaunchedEffectand state clearing. - ViewModel Parameters: Correct patterns for injecting startup data into ViewModels.
- Collections Stability: Detailed strategies for handling unstable collections (Stability config, Immutable collections, Stable wrappers).
- Skippability: Ensuring composables can skip unnecessary recompositions.
- Text Inputs: Handling modern
TextFieldStateand legacy value-based inputs. - Dialogs: Patterns for UI-driven and VM-driven confirmation and interaction dialogs.
- Lists: Best practices for
LazyColumn,LazyRow, keys, and content types.
Suggestions for new features, pattern updates, or bug reports are welcome! Please open an issue in the repository to propose changes or discuss improvements.
Upcoming additions to further enhance the skill's capabilities:
- Animations: Comprehensive guide on
AnimatedVisibility,AnimatedContent,animate*AsState, and transition management. - Side Effects Deep-Dive: Exhaustive patterns for
LaunchedEffect,DisposableEffect,SideEffect, and coroutine scope management. - Modifier Ordering: Detailed analysis of the "Chain of Responsibility" pattern and how order impacts layout, visuals, and interaction.
- Accessibility (a11y): Semantic properties and testing for inclusive UI.
- Testing Patterns: Guidance on writing UI tests for Compose.