kotlin-project-state-management

Select and implement Kotlin Multiplatform state-management patterns for UI state.

1|Updated Apr 22, 2026
One-click install
npx skills add https://github.com/cedric-champeix/SpoonFeeder --skill kotlin-project-state-management
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-project-state-management
Source: https://github.com/cedric-champeix/SpoonFeeder/tree/main/.claude/skills/kotlin-project-state-management
Command: npx skills add https://github.com/cedric-champeix/SpoonFeeder --skill kotlin-project-state-management

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Kotlin Multiplatform UI state management is complex due to cross-platform lifecycles. This skill provides a structured approach to selecting patterns, shaping UiState, and handling one-time effects for predictable UI behavior across targets.

Core Features & Use Cases

  • Guidance on Android ViewModel with StateFlow, shared presenters, MVI patterns, and KMP ViewModel abstractions.
  • Clear principles for UiState design, effect handling, and testability across Android, iOS, and desktop targets.
  • Roadmap to align patterns with project needs, ensuring consistent architecture across screens and teams.

Quick Start

Analyze project targets, select a state-management pattern, and implement a shared UiState with per-platform lifecycle wiring.

Frequently Asked Questions about kotlin-project-state-management

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

FAQPage Schema
How do I manage UI state in a Kotlin Multiplatform project?

Kotlin Multiplatform UI state management requires a single source of truth for UiState with predictable lifecycle behavior. You select a pattern like MVI or shared presenters, shape UiState, separate one-time effects, and wire per-platform lifecycles for Android, iOS, desktop, and web targets.

What is the best way to handle one-time effects in KMP UI state?

Handling one-time effects in KMP requires separating them from the observable UiState. You enforce a contract where user actions are inputs, the state is a single observable stream, and effects are processed independently to ensure predictable UI behavior across Android and iOS targets.

Does this approach support Android ViewModel with StateFlow for KMP?

Yes, Android ViewModel with StateFlow is supported alongside shared presenters and MVI patterns. It provides guidance on KMP ViewModel abstractions to ensure consistent architecture and predictable state delivery across Android, iOS, desktop, and web platforms.

How do I structure a testable UI state architecture across iOS and Android?

A testable UI state architecture enforces a contract of one observable state, separated effects, and user actions as inputs. It defines UiState shaping and effect handling requirements to ensure consistent, testable behavior across Android, iOS, and desktop targets.

Why does cross-platform lifecycle behavior complicate state management?

Cross-platform lifecycle behavior complicates state management because differing platform lifecycles disrupt the single source of truth. This requires specific patterns and proper lifecycle handling to maintain predictable UiState delivery across Android, iOS, desktop, and web targets.

Can I use MVI patterns for Kotlin Multiplatform shared UI state?

Yes, MVI patterns are explicitly supported for shaping shared UI state. It provides a roadmap to align MVI with project needs, enforcing a contract of one observable state, separated effects, and user actions as inputs for consistent architecture across screens and teams.