Configure ViewModel state emission with StateFlow, sealed UiState classes, and lifecycle-safe collection in Android. Use when working with ViewModel files, UiState sealed classes, MutableStateFlow, collectAsStateWithLifecycle, or exposing state from ViewModels. (triggers: **/*ViewModel.kt, **/*UiState.kt, viewmodel, stateflow, livedata, uistate, MutableStateFlow, collectAsState, viewModelScope, UiState)
89
86%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
StateFlow<UiState> via .asStateFlow().viewModelScope for all coroutines.init block.See templates for ViewModel and UiState examples.
@Immutable.See templates for sealed UiState pattern.
collectAsStateWithLifecycle() in Compose.SharingStarted.WhileSubscribed(5000) for shared resources..asStateFlow() to consumers.19a1140
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.