kmp-presentation

Implement Kotlin Multiplatform ViewModel patterns with UiStateHolder and SavedStateHandle.

1|Updated Nov 26, 2025
One-click install
npx skills add https://github.com/niltsiar/kotlin_multiplatform_pokedex --skill kmp-presentation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kmp-presentation
Source: https://github.com/niltsiar/kotlin_multiplatform_pokedex/tree/main/.agents/kmp-presentation
Command: npx skills add https://github.com/niltsiar/kotlin_multiplatform_pokedex --skill kmp-presentation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Kotlin Multiplatform presentation patterns help teams build lifecycle-aware ViewModels and robust UI state management across Android, iOS, Desktop, and Server.

Core Features & Use Cases

  • Standardized ViewModel lifecycle handling with onStart and DefaultLifecycleObserver.
  • UiStateHolder pattern for clean UI state and event separation.
  • SavedStateHandle persistence to survive configuration changes and process death.
  • One-time events via EventChannel for navigation and transient UI actions.

Quick Start

Create a new ViewModel using the onStart lifecycle hook and wire it to a SavedStateHandle.

Frequently Asked Questions about kmp-presentation

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

FAQPage Schema
How do I manage UI state in Kotlin Multiplatform ViewModels across platforms?

Kotlin Multiplatform UI state management uses an UiStateHolder pattern to cleanly separate UI state from events, ensuring lifecycle-aware ViewModels work consistently across Android, iOS, Desktop, and Server.

How does SavedStateHandle persistence work in a KMP presentation layer?

SavedStateHandle persistence in KMP presentation layers stores UI state data to survive configuration changes and process death, maintaining ViewModel state across platform targets.

What is the best way to handle one-time events in Kotlin Multiplatform ViewModels?

One-time events in Kotlin Multiplatform ViewModels are handled via an EventChannel, routing transient UI actions and navigation events without replaying them on configuration changes.

How do I initialize ViewModels in Kotlin Multiplatform using lifecycle hooks?

Kotlin Multiplatform ViewModels initialize using an onStart lifecycle hook with a DefaultLifecycleObserver, triggering setup logic when the UI starts while respecting non-blocking scopes.

Can I use non-blocking coroutine scopes with KMP ViewModels for presentation logic?

KMP ViewModels use viewModelScope to run presentation logic in non-blocking coroutine scopes, ensuring asynchronous operations integrate correctly with lifecycle-aware components.

Does this KMP presentation pattern support dependency injection for ViewModels?

KMP presentation patterns wire ViewModels through dependency injection, ensuring UiStateHolder and lifecycle observers receive required dependencies across Android, iOS, Desktop, and Server platforms.