
Compose Expert
Share and optimize Jetpack Compose Multiplatform UI in commonMain across Android and Desktop without splitting components unnecessarily.
Overview
Compose Expert is an agent skill for the Build phase that applies advanced Compose Multiplatform UI patterns for shared composables, state, theming, and recomposition optimization.
Install
npx skills add https://github.com/vitorpamplona/amethyst --skill compose-expertWhat is this skill?
- Default share-in-commonMain philosophy with clear exceptions for platform-specific UI
- State in composables: remember, derivedStateOf, produceState plus @Stable/@Immutable recomposition guidance
- Material3 theming, lazy lists, and image-loading performance patterns
- Custom ImageVector icons including robohash-style assets
- Explicit delegation matrix to android-expert, desktop-expert, kotlin-expert, and gradle-expert
Adoption & trust: 650 installs on skills.sh; 1.5k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You are shipping Android and Desktop from one repo but keep duplicating UI or fighting unnecessary recompositions and unclear commonMain boundaries.
Who is it for?
Kotlin Multiplatform or Compose Multiplatform projects where most screens should live in commonMain with Material3 and performance-aware lists and images.
Skip if: Pure native-only Android or iOS apps with no shared UI module, or teams that only need navigation graphs or build scripts without composable work.
When should I use this skill?
Working with visual UI components, state management patterns, recomposition optimization, Material3 theming, custom ImageVector icons, or commonMain vs platform-specific UI decisions.
What do I get? / Deliverables
You get a clear share-by-default layout for composables, optimized state and stability usage, and delegated next steps for navigation, Kotlin, or Gradle when those layers need changes.
- Refactored shared composables in commonMain
- Documented exceptions for platform-specific UI
- Themed Material3 component patterns
Recommended Skills
Journey fit
Visual composables, theming, and recomposition tuning are core product-build work before ship. The skill centers on shared UI components, Material3, and performance patterns in the frontend layer.
How it compares
UI-focused Compose shelf skill, not a generic Kotlin language tutor or Gradle configuration pack.
Common Questions / FAQ
Who is compose-expert for?
Solo and indie builders using Compose Multiplatform who want shared composables across Android and Desktop without guessing what stays in commonMain.
When should I use compose-expert?
Use it during Build when creating or refactoring shared UI, choosing commonMain vs platform UI, tuning remember/derivedStateOf/produceState, applying Material3, or optimizing lazy lists and images.
Is compose-expert safe to install?
It is documentation-style procedural guidance with no bundled network calls; review the Security Audits panel on this Prism page before installing from any third-party skill source.
SKILL.md
READMESKILL.md - Compose Expert
# Compose Multiplatform Expert Visual UI patterns for sharing composables across Android and Desktop. ## When to Use This Skill - Creating or refactoring shared UI components - Deciding whether to share UI in `commonMain` or keep platform-specific - Building custom ImageVector icons (robohash pattern) - State management: remember, derivedStateOf, produceState - Recomposition optimization: visual usage of @Stable/@Immutable - Material3 theming and styling - Performance: lazy lists, image loading **Delegate to other skills:** - Navigation structure → `android-expert`, `desktop-expert` - Kotlin state patterns (StateFlow, sealed classes) → `kotlin-expert` - Build configuration → `gradle-expert` ## Philosophy: Share by Default **Default to `commons/commonMain`** unless platform experts indicate otherwise. ### Always Share - **UI components**: Buttons, cards, lists, dialogs, inputs - **State visualization**: Loading, empty, error states - **Custom icons**: ImageVector assets (robohash, custom paths) - **Theme utilities**: Color calculations, style helpers - **Material3 components**: Any UI using Material primitives ### Keep Platform-Specific - **Navigation structure**: Bottom nav (Android) vs Sidebar (Desktop) - **Screen layouts**: Platform-specific scaffolding - **System integrations**: File pickers, notifications, share sheets - **Platform UX**: Gestures, keyboard shortcuts, window management ### Decision Framework 1. **Uses only Material3 primitives?** → Share in `commonMain` 2. **Requires platform system APIs?** → Platform-specific 3. **Pure visual component without navigation?** → Share in `commonMain` 4. **Needs platform UX patterns?** → Ask `android-expert` or `desktop-expert` If uncertain, **default to sharing** - easier to split later than merge. ## Shared Composable Anatomy ### Structure ```kotlin @Composable fun SharedComponent( // State parameters (read-only) data: DataClass, isLoading: Boolean, // Event parameters (write-only) onAction: () -> Unit, // Visual parameters modifier: Modifier = Modifier, // Optional customization colors: ComponentColors = ComponentDefaults.colors() ) { // Implementation } ``` **Pattern**: State down, events up - Parameters above modifier = required state/events - `modifier` parameter = layout control - Parameters below modifier = optional customization ### Example: AddButton ```kotlin @Composable fun AddButton( onClick: () -> Unit, modifier: Modifier = Modifier, text: String = "Add", enabled: Boolean = true ) { OutlinedButton( modifier = modifier, enabled = enabled, onClick = onClick, shape = ActionButtonShape, contentPadding = ActionButtonPadding ) { Text(text = text, textAlign = TextAlign.Center) } } // Shared constants for consistency val ActionButtonShape = RoundedCornerShape(20.dp) val ActionButtonPadding = PaddingValues(vertical = 0.dp, horizontal = 16.dp) ``` **Why this works on all platforms:** - Material3 primitives (OutlinedButton, Text) - No platform APIs - Configurable through parameters - Consistent styling via shared constants ## State Management Patterns ### remember - Cache Across Recompositions ```kotlin @Composable fun ExpandableCard() { var isExpanded by remember { mutableStateOf(false) } Column { IconButton(onClick = { isExpanded = !isExpanded }) { Icon( if (