compose-component-design
Use when designing or reviewing reusable Jetpack Compose component APIs with modifier parameters, root layout placement, caller-provided variable content, primitive content parameters, optional content, or boolean shape flags.
Install
npx skills add https://github.com/chrisbanes/skills --skill compose-component-designSKILL.md
Compose component design
Core principle
Make reusable components caller-placeable and caller-composable: the component owns its invariant structure while callers retain placement, content, and policy choices that vary by use.
Procedure
- State the requested API concern and keep the edit within it. A focused slot review does not authorize unrelated modifier, naming, or cleanup changes.
- State the component's invariant visual structure and identify every varying region, placement concern, and policy choice. In a broad API review, inventory all rendered regions, including hard-coded text or icons, before deciding which are fixed semantic content and which vary by caller. When the request names more than one concern, report each one; do not stop after the first valid modifier or slot finding.
- When root placement is part of the requested work or a broad component API design, accept and apply a caller modifier at the component root unless a concrete API boundary makes another placement correct.
- Represent caller-controlled, unconstrained visual regions with slots rather than proliferating primitive content parameters or Boolean shape flags. Keep semantic and design-system constraints as primitive parameters.
- Keep simple conditional structure inline; extract only a coherent reusable contract.
- Read the relevant focused reference below before editing public signatures.
- In a review, decide explicitly whether each requested variable visual region should remain a semantic primitive or become a caller slot; naming a content limitation alone does not make that API decision. Finish with no edit when the existing API already satisfies the requested concern. Otherwise finish when callers can position the component, supply variable content, and understand ownership without hidden switches.
Topic router
| Signal | Read |
|---|---|
| Modifier parameter, root layout placement, modifier ordering, or conditional layout wrappers | Modifier and layout |
| Caller-controlled variable visual regions, optional content, primitive content parameters, or Boolean shape flags | Slot APIs |
| Animation belongs to the public component contract | Compose animations |
| State ownership changes while designing the component | Compose state and effects |
| Semantics or screenshot coverage is needed | Compose UI testing patterns |
Related skills
vercel-react-native-skillsvercel-labs224KReact Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.firebase-crashlyticsfirebase117KComprehensive guide for Firebase Crashlytics, including provisioning and SDK usage. Use this skill when the user needs help setting up Crashlytics, adding crash reporting, or using the Crashlytics SDK in their application.xcode-project-setupfirebase117KSafely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).animate-expoemilkowalski70KBuild animations in React Native and Expo, making the decisions in the order that determines whether they feel right — should it animate, which thread it runs on, which properties, spring or timing, how the gesture hands off, how it degrades. Writes the implementation with Reanimated, Gesture Handler, Expo Router and expo-haptics. Use when animating anything in an Expo app, adding gestures, sheets, screen transitions, press feedback or haptics, or fixing motion that stutters on device. For web a