compose-component-design — скилл для Claude Code: API компонентов
Скилл для проектирования и ревью переиспользуемых компонентов Jetpack Compose: слоты, модификаторы, размещение корневого layout.
npx skills add chrisbanes/skills --skill compose-component-design -a claude-codeЧто делает compose-component-design
Скилл разбирает публичный API компонента Jetpack Compose и подсказывает, что оставить жёстко зашитым, а что отдать вызывающему коду. Основной принцип: компонент владеет своей неизменной структурой, а вызывающий код распоряжается размещением, содержимым и политикой поведения.
Внутри — процедура из семи шагов и роутер по темам. Если речь о параметре-модификаторе, порядке модификаторов или условных обёртках layout, скилл отправляет в references/modifier-layout.md. Если о переменных визуальных областях, необязательном содержимом, примитивных параметрах контента или булевых флагах формы — в references/slot-apis.md. Анимации, состояние и UI-тесты уходят в соседние скиллы: compose-animations, compose-state-and-effects, compose-ui-testing-patterns.
Работает в Claude, Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode. Для установки нужен Node.js и npx — команда тянет файлы скилла из репозитория chrisbanes/skills. В ревью скилл требует явно решить по каждой переменной визуальной области, остаётся она семантическим примитивом или становится слотом вызывающего кода; если текущий API уже закрывает запрос, правок не будет.
Какие задачи решает
- вынести переменную визуальную область компонента в слот вместо набора булевых флагов
- принять модификатор вызывающего кода в корне компонента и не потерять его в условных ветках
- отличить неизменную семантическую структуру компонента от того, что меняется от вызова к вызову
- провести ревью публичного API компонента и не уехать в несвязанные правки нейминга
- решить, оставить ли необязательное содержимое примитивным параметром или сделать слотом
Примеры запросов агенту
- Проверь API компонента
UserCard: что тут должно быть слотом, а что примитивным параметром? - Разбери размещение модификатора в корне
ProfileHeaderи в его условных ветках - Сделай ревью публичных сигнатур компонентов в
ui/componentsна слоты и модификаторы
Как установить compose-component-design
1Через Skills CLI (Vercel)
npx skills add chrisbanes/skills --skill compose-component-design -a claude-code2Вручную: положить файлы
~/.claude/skills/compose-component-design/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/compose-component-design/
1Через Skills CLI (Vercel)
npx skills add chrisbanes/skills --skill compose-component-design -a codex2Вручную: положить файлы
.agents/skills/compose-component-design/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add chrisbanes/skills --skill compose-component-design -a cursor2Вручную: положить файлы
.cursor/skills/compose-component-design/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install chrisbanes/skills compose-component-design2Вручную: положить файлы
.github/skills/compose-component-design/SKILL.md1Через Skills CLI (Vercel)
npx skills add chrisbanes/skills --skill compose-component-design -a gemini-cli2Командой платформы
gemini skills install https://github.com/chrisbanes/skills --path skills/compose-component-designВручную: положить файлы
.devin/skills/compose-component-design/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add chrisbanes/skills --skill compose-component-design -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о compose-component-design
Как установить compose-component-design в Claude?
Выполните npx skills add chrisbanes/skills --skill compose-component-design -a claude-code. Файл скилла окажется в ~/.claude/skills/compose-component-design/SKILL.md.
Что делает compose-component-design?
Помогает проектировать и ревьюить API переиспользуемых компонентов Jetpack Compose: размещение модификатора, слоты, примитивные параметры контента, булевы флаги формы.
С какими ещё скиллами он работает вместе?
Роутер ссылается на compose-animations, compose-state-and-effects и compose-ui-testing-patterns — когда в контракт компонента попадают анимации, владение состоянием или покрытие UI-тестами.
Исходный текст
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