android-mvi

Standardize Android/KMP screen logic with an MVI loop of State, Action, and Event.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/soygabimoreno/Los-ANDROIDES --skill android-mvi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-mvi
Source: https://github.com/soygabimoreno/Los-ANDROIDES/tree/main/.agents/skills/android-mvi
Command: npx skills add https://github.com/soygabimoreno/Los-ANDROIDES --skill android-mvi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the confusion and bugs caused by inconsistent UI state handling by standardizing how Android/KMP screens manage State, Actions (Intents), and one-time Events.

Core Features & Use Cases

  • Predictable MVI structure: defines State (single source of UI data), Action (user/trigger inputs), Event (one-time side effects like navigation/snackbar), and a ViewModel that processes actions into state/events.
  • Lifecycle-safe event observing: uses ObserveAsEvents to consume one-time events exactly once in a lifecycle-aware way.
  • Production-friendly details: includes guidance for mapping domain errors to UiText, building UI models for presentation formatting, handling process death via SavedStateHandle, and enforcing naming conventions and screen composable separation (Root vs Screen).

Quick Start

Use the android-mvi skill to design a new screen by defining its <Screen>State, <Screen>Action, <Screen>Event, implementing a <Screen>ViewModel with Channel.BUFFERED events, and splitting UI into <Screen>Root and <Screen>Screen composables.

Frequently Asked Questions about android-mvi

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle one-time UI events in Android Jetpack Compose without duplicating them on configuration change?

To handle one-time UI events safely, emit them through a Channel.BUFFERED and collect them lifecycle-aware via ObserveAsEvents, ensuring each event is consumed exactly once. This prevents duplicate side effects like repeated navigation or snackbar messages on configuration changes.

What is the best way to structure Android ViewModel state and actions using MVI?

The best way to structure MVI is by defining State as the single source of UI data, Action as user inputs, and Event for side effects, processed by a ViewModel exposing flow-based state. This creates a predictable loop for reliable UI updates.

How do I recover Android UI state after process death using SavedStateHandle with MVI?

To recover UI state after process death, integrate SavedStateHandle within your MVI ViewModel to serialize and restore the State. This ensures the single source of UI data survives system-initiated process termination reliably.

Does this MVI approach work with Kotlin Multiplatform (KMP) screen logic?

Yes, this MVI approach standardizes Android/KMP screen logic by enforcing flow-based State, Action, and Event handling. It relies on Kotlin Flow state exposure via StateFlow, making it compatible with KMP architectures.

Why do my Android snackbar navigation side effects trigger multiple times in Jetpack Compose?

Navigation and snackbar side effects trigger multiple times when state is observed without lifecycle-aware collection. Using Channel.BUFFERED for event emission and ObserveAsEvents for consumption ensures one-time events are delivered exactly once.

How do I map domain errors to UI text in an Android MVI ViewModel?

To map domain errors to UI text, transform them into UiText objects within your MVI ViewModel before updating the State. This production-friendly approach separates presentation formatting from domain logic for reliable UI rendering.