kotlin-project-state-management

Define Kotlin Multiplatform state-management contracts for UiState, effects, and actions.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use when choosing, implementing, or reviewing UI state ownership and production-grade state-management patterns in Kotlin Multiplatform projects, including ViewModel, shared presenter, MVI, and StateFlow-based approaches.

Core Features & Use Cases

  • Clear guidance on invariant UiState contracts and separate one-time effects
  • Guidance on platform-specific lifecycle handling and scope management across Android, iOS, and desktop
  • Comparison of pattern families (ViewModel, shared presenter, MVI) with guidance on when to use each
  • Practical strategies for UiState modeling, effect handling, and testability

Quick Start

Apply the guidance to model UiState, actions, and effects in your KMP project to establish consistent state management.

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 without AndroidX dependencies?

To manage UI state in Kotlin Multiplatform without AndroidX, define invariant UiState contracts using StateFlow in common code. This approach ensures clean separation of state holders, effects, and actions across Android, iOS, and desktop targets.

What is the best way to handle lifecycle and scope management for shared state in KMP?

Handling lifecycle and scope management in KMP requires platform-specific strategies for shared presenters. You must define clear contract rules for state holders to ensure scopes are correctly managed across Android, iOS, and desktop environments.

How do I separate one-time effects from UiState in Kotlin Multiplatform MVI patterns?

To separate one-time effects from UiState in MVI patterns, model your state as an invariant contract and emit effects independently. This clean separation prevents effect duplication and ensures testability of state production logic.

When should I choose a shared presenter over ViewModel for KMP state management?

Choose a shared presenter or ViewModel based on your specific KMP state-management needs. Comparing these pattern families involves evaluating lifecycle handling, testability requirements, and zero AndroidX dependency constraints in common code.

Does Kotlin Multiplatform state management require specific testability setups for StateFlow?

Kotlin Multiplatform state management requires specific testability setups for StateFlow. You must define practical testing strategies for UiState modeling and effect handling to validate state holder contracts and actions effectively.