← ClaudeAtlas

compose-inspectorlisted

Use when developing, reviewing, or debugging Jetpack Compose UI layouts, state, and recomposition behavior.
rabee-elkholy/android-agent-harness · ★ 6 · Testing & QA · score 81
Install: claude install-skill rabee-elkholy/android-agent-harness
# Compose Inspector & Layout Verifier ## 1. Composition & Performance Safety Checks - **Stability**: Diagnose a recomposition problem with runtime observations or compiler reports before changing stability. `List`, `Set`, and `Map` are not proof of immutability. `@Immutable` and `@Stable` are compiler contracts, not transformations: use them only when all reachable values satisfy the immutability contract, or mutable public state notifies Compose and satisfies the stability contract. Check mutation through aliases and element types; prefer a correctly modeled type over an annotation that hides instability. See the [official stability guidance](https://developer.android.com/develop/ui/compose/performance/stability/fix). - **Calculations**: Verify `remember` is used for expensive object allocations or formatting inside composables. - **Fast-Changing State**: Use `derivedStateOf` when the derived result changes less often than its inputs (for example, a scroll threshold). It adds overhead and does not help when the UI needs every input update. - **Lazy Lists**: Every `LazyColumn` / `LazyRow` must specify explicit `key` lambdas using unique, stable IDs (e.g., `key = { it.id }`). - **State Hoisting**: Pass only immutable State and lambda callbacks down to leaf composables. Never pass `ViewModel` instances into reusable child components. --- ## 2. Layout & Localization Verification - **RTL / LTR**: Strictly use directional modifiers: `Modifier.padding(start = ..., end = ...)` in