compose-skill
Jetpack Compose & Compose Multiplatform
This skill covers the full Compose app development lifecycle — from architecture and state management through UI, networking, persistence, performance, accessibility, cross-platform sharing, build configuration, and distribution. Jetpack Compose and Compose Multiplatform share the same core APIs and mental model. Not all Jetpack libraries work in commonMain — many remain Android-only. A subset of AndroidX libraries now publish multiplatform artifacts (e.g., lifecycle-viewmodel, lifecycle-runtime-compose, datastore-preferences), but availability and API surface vary by version. Before adding any Jetpack/AndroidX dependency to commonMain, verify the artifact is published for all required targets by checking Maven Central or the library's official documentation. CMP uses expect/actual or interfaces for platform-specific code. MVI (Model-View-Intent) is the recommended architecture, but the skill adapts to existing project conventions.
Existing Project Policy
Do not force migration. If a project already follows MVI with its own conventions (different base class, different naming, different file layout), respect that. Adapt to the project's existing patterns. The architecture pattern — unidirectional data flow with Event, State, and Effect — is what matters, not a specific base class or framework. Only suggest structural changes when the user asks for them or when the existing code has clear architectural violations (business logic in composables, scattered state mutations, etc.).
Workflow
When helping with Jetpack Compose or Compose Multiplatform code, follow this process:
- Read the existing code first for context — check conventions, base classes, and layout. For small UI or logic asks, restrict your reading to the immediately relevant files to save time. Do not map out the entire project architecture unless a structural refactor is requested.
- Identify the concern — is this architecture, state modeling, performance, navigation, DI, animation, cross-platform, or testing?
- Apply the core rules below — the decision heuristics and defaults in this file cover most cases.
- Consult the right reference — load the relevant file from
references/only when deeper guidance is needed. Use the Quick Routing in the Detailed References section to pick the right file. - Verify dependencies before recommending — before adding or upgrading any dependency, verify coordinates, target support, and API shape via a documentation MCP tool or official docs (see Dependency Verification Rule).
- Flag anti-patterns contextually — if the user's code violates best practices, call it out for production code. For quick prototypes or minor UI tweaks, prioritize answering their specific question over lecturing them on strict rules.
- Write the minimal correct solution — do not over-engineer. Prefer feature-specific code over generic frameworks.