In Claude (connector)install_skill("android-compose-screen")
CLIlendskill install android-compose-screen
SKILL.md
---
name: android-compose-screen
description: Build Android screens with Kotlin and Jetpack Compose from a mockup or description — Material 3 components, state hoisting with a ViewModel and StateFlow, loading/empty/error states, previews, accessibility and tests. Use for Android UI, Compose screens or converting a design to Compose.
license: Proprietary — Lendskill original
---
# Compose Screen
## Structure
- `XxxScreen(viewModel)` collects `uiState` (`collectAsStateWithLifecycle`) and passes plain data + callbacks to a stateless `XxxContent(state, onEvent)`.
- `XxxUiState` data class (or sealed interface for Loading/Content/Error).
- `XxxViewModel` exposes `StateFlow<XxxUiState>`; side effects in `viewModelScope`.
- Previews for each state with fake data (`@Preview` light and dark).
## UI rules
Material 3 (`MaterialTheme` colors/typography, no hard-coded colors), `Modifier` as the first optional parameter, `LazyColumn` with stable `key`s for lists, `Scaffold` for top bar/FAB/snackbar. Touch targets ≥ 48 dp. `contentDescription` on meaningful icons, null on decorative ones. Strings in `strings.xml`.
## Performance
Avoid allocating in composition; `remember`/`derivedStateOf` where needed; pass stable/immutable types.
## Check
Builds with the project's Compose BOM; previews render; a Compose UI test for the main interaction. Deliver full files, not fragments. Keep the user's existing package names and architecture.