Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add chrisbanes/skills --skill compose-component-design -a claude-code
Open on GitHub

What 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 UserCard API: what should be a slot and what should stay a primitive parameter?
  • Check modifier placement at the root of ProfileHeader and in its conditional branches
  • Review the public component signatures in ui/components for slots and modifiers

How to install compose-component-design

1Skills CLI (Vercel)

npx skills add chrisbanes/skills --skill compose-component-design -a claude-code

2Manually: put the files in place

~/.claude/skills/compose-component-design/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/compose-component-design/

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

Similar skills

Everything for Mobile →

From the same set17

compose-performance A skill for investigating Jetpack Compose recomposition cost: find the phase causing the work and fix it at the boundary where it starts. CX Codex +1 1,100installs compose-state-and-effects This skill guides state ownership and side-effect choices in Jetpack Compose. It keeps UI state at the lowest responsible layer and matches effect lifecycles to their owners. CX Codex +1 1,100installs using-chrisbanes-skills Reads a Kotlin or Jetpack Compose task and loads the right skill from the chrisbanes set. Useful when several concerns overlap in one change. CX Codex +1 1,100installs kotlin-control-flow A skill that steers your coding agent through Kotlin branching: when expressions, guard conditions, sealed-type exhaustiveness, smart casts. CX Codex +1 1,100installs kotlin-api-design Walks you through function ownership, value classes and expect/actual boundaries in Kotlin. Useful when shaping a public API or a KMP module. CX Codex +1 949installs gradle-run Runs Gradle builds through a compact-output wrapper and keeps a workflow ledger, so the agent never floods its context with a full build log. CX Codex +1 768installs run-github-project Runs a repository's GitHub Project workflow: triages Todo, claims work in Ready to implement, and carries it through to Done. CX Codex +1 643installs implement-with-subagents Orchestrates plan tasks across solo or worker subagents with task-scoped commits, integration checks, and mandatory independent review. CX Codex +1 582installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor