compose-multiplatform-patterns

Standardize Compose Multiplatform UI architecture with ViewModel-driven state and type-safe navigation.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/emiled16/close-to-me --skill compose-multiplatform-patterns-emiled16
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compose-multiplatform-patterns
Source: https://github.com/emiled16/close-to-me/tree/main/.codex/skills/compose-multiplatform-patterns
Command: npx skills add https://github.com/emiled16/close-to-me --skill compose-multiplatform-patterns-emiled16

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you design and implement consistent Compose user interfaces across Android, iOS, Desktop, and Web without falling into common state, navigation, and recomposition pitfalls. It gives you practical patterns for building shared UI that is easier to test, maintain, and scale.

Core Features & Use Cases

  • State Management: Organize screen state with ViewModel-backed flows and predictable event handling.
  • Navigation: Build type-safe navigation flows for shared and platform-specific Compose applications.
  • Composable Design: Create reusable, slot-based UI APIs that are flexible and easy to preview.
  • Platform-Specific UI: Apply expect and actual patterns when a shared screen needs platform-specific behavior.
  • Performance and Theming: Reduce unnecessary recomposition, stabilize models, and implement Material-style theming.
  • Use Case: A team building a cross-platform product can use this Skill to structure screens, connect state to UI, and keep design patterns consistent across apps.

Quick Start

Ask for a Compose Multiplatform pattern for your screen, including state management, navigation, theming, and performance guidance.

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 with ViewModel and StateFlow in Compose Multiplatform?

Manage state in Compose Multiplatform by applying ViewModel-driven StateFlow patterns to organize screen state and ensure predictable event handling across shared UI. This approach standardizes state management for Android, iOS, Desktop, and Web.

How do I set up type-safe navigation for shared Compose screens?

Set up type-safe navigation by applying standardized architecture patterns for shared and platform-specific Compose Multiplatform screens. This provides structured navigation flows that scale consistently across Android and iOS applications.

When do I need expect and actual patterns for platform-specific Compose UI?

Use expect and actual platform hooks when a shared Compose Multiplatform screen requires platform-specific behavior. This pattern allows shared UI architecture to integrate native functionality while maintaining a unified codebase across Android, iOS, Desktop, and Web.

Why does my Compose Multiplatform UI recompose excessively and how do I fix it?

Excessive recomposition in Compose Multiplatform occurs when models are unstable. Fix it by applying recomposition performance tuning and stable model guidance to reduce unnecessary recompositions and stabilize your UI state.

Can I use Jetpack Compose patterns for iOS and Desktop applications?

Yes, you can apply Jetpack Compose patterns to iOS and Desktop by using Compose Multiplatform architecture. Standardized patterns for state, navigation, and theming ensure shared UIs are consistent and scalable across all platforms.

What is the best way to structure reusable Compose Multiplatform composables?

The best way to structure reusable composables is by creating slot-based UI APIs that are flexible and easy to preview. This design pattern ensures components remain modular and maintainable across shared Compose Multiplatform projects.