This walks you through the standard Android ViewModel pattern with a focus on proper state management using Kotlin flows. You get clear guidance on using StateFlow for persistent UI state like loading and error conditions, and SharedFlow with replay=0 for one-off events like navigation or showing toasts. The replay distinction is the key bit here since it prevents events from re-triggering after configuration changes. It covers the basics like exposing read-only flows, using viewModelScope, and collecting in both Compose and XML views. If you're tired of fighting lifecycle issues or accidentally showing the same snackbar twice after rotation, this nails down the patterns that actually work.
npx skills add https://github.com/new-silvermoon/awesome-android-agent-skills --skill android-viewmodel