compose-multiplatform-patterns

Standardize Compose Multiplatform architecture patterns for shared KMP UI development.

Updated May 4, 2026
One-click install
npx skills add https://github.com/gganbukim1/myskills --skill compose-multiplatform-patterns-gganbukim1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compose-multiplatform-patterns
Source: https://github.com/gganbukim1/myskills/tree/main/compose-multiplatform-patterns
Command: npx skills add https://github.com/gganbukim1/myskills --skill compose-multiplatform-patterns-gganbukim1

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you avoid inconsistent architecture and fragile UI code when building shared Compose UI across Android, iOS, Desktop, and Web by providing proven patterns for state, navigation, theming, and performance.

Core Features & Use Cases

  • State management patterns for Compose: Use a single immutable screen state with StateFlow, lifecycle-safe collection, and an event-sink approach for complex interactions.
  • Type-safe navigation & overlay flows: Implement route modeling with @Serializable and use dialog/bottom-sheet style navigation declaratively.
  • Performance and UI correctness guidance: Improve recomposition behavior with stable types, correct lazy list keys, derivedStateOf, and reduced allocations.
  • KMP platform-specific UI hooks: Use expect/actual to keep platform differences contained while preserving a common UI layer.
  • Theming approach: Select Material 3 dynamic theming and dark/light strategies based on platform capabilities.

Quick Start

Ask an AI to generate a KMP screen that uses a single StateFlow state object, an event-sealed interface, type-safe Compose navigation routes, and a Material 3 theme with dynamic colors where available.

Frequently Asked Questions about compose-multiplatform-patterns

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

FAQPage Schema
How do I manage state in Compose Multiplatform to prevent unnecessary recomposition?

To manage state in Compose Multiplatform, use a single immutable screen state object with StateFlow and an event-sink approach. Ensure correct recomposition behavior by using stable types, derivedStateOf, and reducing per-composition allocations.

What is the best way to implement type-safe navigation in KMP for dialogs and bottom sheets?

Type-safe navigation in KMP is implemented by modeling routes with @Serializable. You can then use dialog and bottom-sheet style navigation declaratively to handle complex overlay flows consistently across platforms.

How do I handle lifecycle-aware state collection in a shared Compose UI?

Handle lifecycle-aware state collection by pairing a single StateFlow with lifecycle-safe collection methods. This ensures your shared Compose UI only processes state updates when the screen is active, preventing crashes and unnecessary background work.

Does Compose Multiplatform support Material 3 dynamic theming across all platforms?

Compose Multiplatform supports Material 3 theming, but dynamic colors depend on platform capabilities. You should select dark and light theme strategies dynamically based on what the specific Android, iOS, Desktop, or Web target supports.

Why does my Compose Multiplatform app have poor performance with large lists?

Poor performance in Compose Multiplatform lists often stems from missing lazy list keys and unstable model classes. Improve recomposition behavior by applying correct keys, using immutable models, and leveraging derivedStateOf.