senoldogann/codex-switcher/compose-multiplatform-patterns
Claude Code and agent skill by senoldogann/codex-switcher
- community
Checking that the SKILL.md file is still in the repository.
Compose Multiplatform and Jetpack Compose patterns for KMP projects — state management, navigation, theming, performance, and platform-specific UI.
Install
npx vskill@latest install senoldogann/codex-switcher/compose-multiplatform-patternsSKILL.md
Compose Multiplatform Patterns
Patterns for building shared UI across Android, iOS, Desktop, and Web using Compose Multiplatform and Jetpack Compose. Covers state management, navigation, theming, and performance.
When to Activate
- Building Compose UI (Jetpack Compose or Compose Multiplatform)
- Managing UI state with ViewModels and Compose state
- Implementing navigation in KMP or Android projects
- Designing reusable composables and design systems
- Optimizing recomposition and rendering performance
State Management
ViewModel + Single State Object
Use a single data class for screen state. Expose it as StateFlow and collect in Compose:
Collecting State in Compose
Event Sink Pattern
For complex screens, use a sealed interface for events instead of multiple callback lambdas:
Navigation
Type-Safe Navigation (Compose Navigation 2.8+)
Define routes as @Serializable objects:
Dialog and Bottom Sheet Navigation
Use dialog() and overlay patterns instead of imperative show/hide:
Composable Design
Slot-Based APIs
Design composables with slot parameters for flexibility:
Modifier Ordering
Modifier order matters — apply in this sequence:
KMP Platform-Specific UI
expect/actual for Platform Composables
Performance
Stable Types for Skippable Recomposition
Mark classes as @Stable or @Immutable when all properties are stable:
Use key() and Lazy Lists Correctly
Defer Reads with derivedStateOf
Avoid Allocations in Recomposition
Theming
Material 3 Dynamic Theming
Anti-Patterns to Avoid
- Using
mutableStateOfin ViewModels whenMutableStateFlowwithcollectAsStateWithLifecycleis safer for lifecycle - Passing
NavControllerdeep into composables — pass lambda callbacks instead - Heavy computation inside
@Composablefunctions — move to ViewModel orremember {} - Using
LaunchedEffect(Unit)as a substitute for ViewModel init — it re-runs on configuration change in some setups - Creating new object instances in composable parameters — causes unnecessary recomposition
References
See skill: android-clean-architecture for module structure and layering. See skill: kotlin-coroutines-flows for coroutine and Flow patterns.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/compose-multiplatform-patterns/SKILL.md
Popularity
- Repository stars
- 14
- Repository forks
- 2
- 7-day trend score
- 14
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/senoldogann/codex-switcher/compose-multiplatform-patterns)