What problem does it solve?
This Skill prevents subtle Jetpack Compose bugs where UI state resets or fails to update because local variables are not correctly backed by Compose state.
Core Features & Use Cases
- Correct recomposition-safe local state: Ensure
var in a composable survives recomposition and triggers updates via remember { mutableStateOf(...) } or mutableStateListOf / mutableStateMapOf.
- Proper handling of state collection mutations: Avoid patterns like
remember { mutableStateOf(mutableListOf(...)) } followed by .add(...) that bypass snapshot observation; use mutableStateListOf / mutableStateMapOf or replace the value.
- Apply
@ReadOnlyComposable safely: Mark composables as read-only only when they truly only read composition state and never allocate UI/layout nodes, call remember, or call non-read-only composables.
Quick Start
Use the compose-state-authoring skill to review a Compose @Composable and verify every local var is backed by remember + mutableStateOf (or the correct mutableStateListOf / mutableStateMapOf) and that any @ReadOnlyComposable function only performs valid read-only operations.