Configure ViewModel state emission with StateFlow, sealed UiState classes, and lifecycle-safe collection in Android. Use when working with ViewModels, UiState patterns, or exposing state to Compose UI.
92
92%
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.StateFlow<UiState>.collectAsStateWithLifecycle()../gradlew test passes for ViewModel tests.4c72e76
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.