compose-component-design — Claude Code skill: Compose component APIs
A skill for designing and reviewing reusable Jetpack Compose component APIs: slots, modifier parameters, root layout placement.
npx skills add chrisbanes/skills --skill compose-component-design -a claude-codeWhat compose-component-design does
The skill walks through a component's public API and helps you decide what stays hard-coded and what the caller should control. The core idea: the component owns its invariant structure, while callers keep placement, content and policy choices that vary by use.
Inside there is a seven-step procedure and a topic router. For modifier parameters, modifier ordering or conditional layout wrappers it points to references/modifier-layout.md. For caller-controlled variable visual regions, optional content, primitive content parameters or Boolean shape flags it points to references/slot-apis.md. Animations, state ownership and UI test coverage go to sibling skills: compose-animations, compose-state-and-effects, compose-ui-testing-patterns.
It runs in Claude, Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode. Installing needs Node.js and npx, since the command pulls the skill files from the chrisbanes/skills repository. During a review the skill asks you to decide, for every variable visual region, whether it stays a semantic primitive or becomes a caller slot. If the current API already covers the request, no edit is made.
What it helps with
- turn a variable visual region into a slot instead of piling on Boolean shape flags
- accept a caller modifier at the component root and keep it in every conditional branch
- separate a component's fixed semantic content from what changes per call site
- review a public component API without drifting into unrelated naming or cleanup edits
- decide whether optional content stays a primitive parameter or becomes a slot
Example prompts for the agent
- Review the
UserCardAPI: what should be a slot and what should stay a primitive parameter? - Check modifier placement at the root of
ProfileHeaderand in its conditional branches - Review the public component signatures in
ui/componentsfor slots and modifiers
How to install compose-component-design
1Skills CLI (Vercel)
npx skills add chrisbanes/skills --skill compose-component-design -a claude-code2Manually: put the files in place
~/.claude/skills/compose-component-design/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/compose-component-design/
1Skills CLI (Vercel)
npx skills add chrisbanes/skills --skill compose-component-design -a codex2Manually: put the files in place
.agents/skills/compose-component-design/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add chrisbanes/skills --skill compose-component-design -a cursor2Manually: put the files in place
.cursor/skills/compose-component-design/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install chrisbanes/skills compose-component-design2Manually: put the files in place
.github/skills/compose-component-design/SKILL.md1Skills CLI (Vercel)
npx skills add chrisbanes/skills --skill compose-component-design -a gemini-cli2Platform CLI
gemini skills install https://github.com/chrisbanes/skills --path skills/compose-component-designManually: put the files in place
.devin/skills/compose-component-design/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add chrisbanes/skills --skill compose-component-design -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about compose-component-design
How do I install compose-component-design in Claude?
Run npx skills add chrisbanes/skills --skill compose-component-design -a claude-code. The skill file lands at ~/.claude/skills/compose-component-design/SKILL.md.
What does compose-component-design do?
It helps you design and review reusable Jetpack Compose component APIs: modifier placement, slots, primitive content parameters, Boolean shape flags.
Which other skills does it work with?
Its router points to compose-animations, compose-state-and-effects and compose-ui-testing-patterns when animations, state ownership or UI test coverage become part of the component contract.
Source text
SKILL.md · Apache-2.0
--- name: compose-component-design description: 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. --- # 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 1. State the requested API concern and keep the edit within it. A focused slot review does not authorize unrelated modifier, naming, or cleanup changes. 2. 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. 3. 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. With conditional roots, apply it to every branch root rather than merging branches into one wrapper. 4. 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. 5. Keep simple conditional structure inline; extract only a coherent reusable contract. 6. Read the relevant focused reference below before editing public signatures. 7. 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](references/modifier-layout.md) | | Caller-controlled variable visual regions, optional content, primitive content parameters, or Boolean shape flags | [Slot APIs](references/slot-apis.md) | | Animation belongs to the public component contract | [Compose animations](../compose-animations/SKILL.md) | | State ownership changes while designing the component | [Compose state and effects](../compose-state-and-effects/SKILL.md) | | Semantics or screenshot coverage is needed | [Compose UI testing patterns](../compose-ui-testing-patterns/SKILL.md) |
© chrisbanes · Apache-2.0 · chrisbanes/skills