ronjunevaldoz/kmp-agent-skills/kmp-compose-design-system
Claude Code and agent skill by ronjunevaldoz/kmp-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Scaffolds a fully owned Compose Multiplatform design system in :core:designsystem using the experimental Compose Styles API. Produces semantic design tokens, AppTheme, style accessors, sealed component variants, and core App* primitives without Material. The App prefix is derived from the project's name and can be customized.
Install
npx vskill@latest install ronjunevaldoz/kmp-agent-skills/kmp-compose-design-systemSKILL.md
The same SKILL.md was published earlier as ronjunevaldoz/kmp-agent-skills/kmp-compose-design-system.
When to Use This Skill
Use this skill when the user asks to:
- Set up a custom design system, theme, or component library in a KMP project
- Avoid Material Design and build unstyled/custom components
- Use the new Compose Styles API (
@ExperimentalStylesApi) - Create reusable UI components with a variant system (like shadcn)
- Add dark mode support via custom tokens
- Wire AppTheme, tokens, or custom Composables into
:core:designsystem
If a project already calls `ShadcnTheme(...)` in real source, it's already on `kmp-shadcn-compose` — don't suggest `App*`/`AppTheme` for it. Same rule as that skill's own "never combine" note, stated here too since either skill can be the one consulted first. kmp-audit's _detect_mixed_design_system_usage flags a project calling both theme wrappers.
Trigger keywords: design system, custom theme, AppTheme, design tokens, ButtonVariant, Compose Styles, ExperimentalStylesApi, custom components, unstyled components, dark mode tokens, color scheme, no Material, typography system, spacing tokens, custom button style, Material3 alternative, app theme setup, brand colors, design token system, custom typography, redesign, visual consistency, UI consistency, design consistency, page design, screen design, UI look and feel, consistent styling, style guide, branding, component library, theming, color palette, visual identity, dark mode toggle, in-app theme override, user theme preference, theme settings, LocalAppDarkTheme, isSystemInDarkTheme, system dark mode, follow system theme, dynamic theme, runtime theme switch, light dark switch, theme preference setting, component prefix, custom prefix instead of App, rename App to project name, project-specific component names, COMPONENT_PREFIX, derive prefix from project name, golden ratio, type scale, typographic scale, text overflow, text truncation, text hell, line length, i18n text expansion, translated string overflow, PRODUCT.md, DESIGN.md, design context, product context, AppMotion, motion tokens.
Freshness rule: @ExperimentalStylesApi is experimental (Android Jetpack Compose 1.12.0-alpha03 at last check) and the Styles API changes between releases — Material Design support for Styles is planned but not yet available. Recheck the official docs before upgrading, and note these are Android Jetpack Compose docs; Compose Multiplatform (JetBrains) support may lag behind:
- https://developer.android.com/develop/ui/compose/styles (overview)
- https://developer.android.com/develop/ui/compose/styles/fundamentals
- https://developer.android.com/develop/ui/compose/styles/state-animations
- https://developer.android.com/develop/ui/compose/styles/styles-vs-modifiers
- https://developer.android.com/develop/ui/compose/styles/theming
- https://developer.android.com/develop/ui/compose/styles/performance
- https://developer.android.com/develop/ui/compose/styles/dos-donts
- https://developer.android.com/develop/ui/compose/styles/examples
- https://developer.android.com/develop/ui/compose/styles/limitations
A full extracted summary of these pages (API surface, do's/don'ts, benchmarks, limitations) lives in references/compose-styles-api-reference.md — use it to audit generated code against the official guidance without re-fetching every page.
Recommendation First
Default to custom tokens + `AppTheme` + `@ExperimentalStylesApi` sealed variant systems — no Material dependency.
Why:
- full ownership of the token layer means no Material opinion leaking into spacing, shape, or color
- sealed variant classes (e.g.,
ButtonVariant.Primary) make component APIs explicit and auditable @ExperimentalStylesApiis the sanctioned path for custom styling in CMP; Material3 is an overlay
on top of it, not a replacement
Use Material3 only when the product targets Material Design explicitly and design token ownership is not a concern.
Component API Placement
Use the smallest API that still preserves the product’s structure.
| Component type | Preferred pattern | Why | |
|---|---|---|---|
| App shell / page chrome | Slot API | The caller owns the region content, but the shell stays fixed | |
| Fixed visual region with a narrow contract | Restricted scope template | Keeps layout and ordering consistent while still allowing caller content | |
| Small leaf control | Data + variant params | Simpler than slots when the content is not meaningfully custom | |
| Deep theme / app-wide metadata | CompositionLocal | Shared context, not positional content |
Concrete KMP design-system mapping:
AppScaffold,AppTopAppBar,AppCard,AppDialog,AppBottomSheet-> slot APICardHeader,ToolbarRow,SectionHeader,ActionRow-> restricted scope template when the region needs guardrailsAppButton,AppBadge,AppTextField,AppText,AppChip-> data/variant APIs first; add slots only if callers truly need custom body content
Screen Layout Contract
Full content (the hard rule + template): references/screen-layout-contract.md.
Design Context — read before UI work
Before designing or changing a screen, read PRODUCT.md (users, purpose, operating context, principles, accessibility) and docs/design-system.md (prefix, tokens, deviations). Missing PRODUCT.md? Ask at most three questions and write it; mark inferred facts. A root DESIGN.md (Google's portable format) is an export generated from tokens/ — only when a DESIGN.md-aware tool needs it, never hand-maintained. Template and export rules: references/design-context.md.
Overview
Ownership Model
The design system follows the shadcn model — you own the generated code, not a dependency. This gives full brand control without forking a library.
| Layer | Ownership | Update path | |
|---|---|---|---|
tokens/ — AppColors, AppTypography, AppShapes, AppSpacing | Project-owned | Customize freely — never touched by /update-design-system | |
theme/ — AppTheme, StyleScopeExtensions | Project-owned | Customize freely | |
components/ — App*.kt | Skill-owned | Run /update-design-system to pull in bug fixes and new variants without touching tokens |
Why not a published library? The Compose Styles API (@ExperimentalStylesApi) changes between CMP releases. A published library would break every downstream project on CMP upgrades. The scaffold approach keeps each project on its own upgrade schedule.
Utility-class layer: `tailwind-compose` is a stable-API-only (no @ExperimentalStylesApi), Maven Central-published library providing Tailwind-style utility modifiers (spacing, layout, color, typography) for Compose Multiplatform. Because it depends on nothing experimental, it's safe to add as a real dependency alongside the generated tokens//components/ layers above — use it for one-off utility styling in screen code where writing a full token+style pair would be overkill, not as a replacement for components/. Component libraries that depend on the experimental Styles API (e.g. `shadcn-compose`, published to Maven Central as of 0.2.1) are still not recommended here — publication doesn't remove the risk this skill is scaffold-based specifically to avoid: a real dependency on @ExperimentalFoundationStyleApi still breaks on the next CMP release that changes that API. See the Changelog entry below.
Use /update-design-system to compare your project's components against the latest skill version and selectively apply fixes. The comparison is powered by scripts/update_design_system.py, which MD5-hashes each component block from this SKILL.md against the project file and reports CURRENT / MODIFIED / MISSING status.
Use /fix-design to scan an existing project for violations (hardcoded colors, hardcoded user-facing strings, dp literals, MaterialTheme.* usage, TextStyle() construction, nested containers, component reimplementations, direct token imports) and fix them file-by-file with per-file confirmation. Primary scanner: detekt-rules/ (PSI-based); fallback: scripts/scan_design_violations.py. The fallback scanner also flags missing preview stubs, missing multi-device preview coverage, missing Roborazzi screenshot tests, and missing commonTest UI interaction tests (runComposeUiTest) for feature *Content.kt files — all four required, no exceptions — so coverage gaps get caught with the rest of the design cleanup. scripts/scaffold_preview_coverage.py generates all four missing files at once.
Use /record-design-baselines after fixing to record new Roborazzi golden PNGs. Use /audit-design-visual to run a vision pass over the goldens and catch spacing, contrast, and cross-screen consistency issues that have no code-level signal.
Project documentation template
Copy references/design-system-template.md to docs/design-system.md in your project and fill it in. This living document records your token values, component inventory, detekt rule overrides, multi-device preview coverage, and audit log.
The skill reads docs/design-system.md when it exists and uses it to:
- Read your confirmed component prefix (e.g.
Acmeinstead ofApp) — highest precedence in Step 0 - Confirm your token names before generating code
- Detect deviations you've documented as intentional
Then replace PROJECT_NAME, GROUP_ID, and COMPONENT_PREFIX globally and fill in the token values for your brand.
Style Rules
- Use the Compose Styles API for visual styling, state styling, and animated transitions.
- Do not confuse Styles with the Slot API: slots are for structure/content customization, not theming.
- Keep text, borders, surfaces, and disabled states neutral-first.
- Use palette colors for brand, emphasis, status, and primary actions only.
- If the user does not specify a palette, suggest 2-3 options based on the project domain.
- If typography is unspecified, suggest a font pair and type scale before generating components.
- Use Atlassian and shadcn as references for neutral-first palettes, crisp hierarchy, and restrained component shapes.
Ring vs border — never animate borderWidth
Don't add a separate "ring" primitive to imitate CSS box-shadow-based focus rings — the actual problem a ring solves in CSS is that box-shadow never participates in the box model, so it can't jitter content. The Compose fix is a rule, not a new component:
Never animate `borderWidth` (or `borderBottomWidth`, etc.) in a state block. Reserve the final width at rest — borderColor(Color.Transparent) if the variant has no border at rest — and animate only borderColor on focused {}/selected {}. The border's footprint never changes size, so focusing/selecting a component never re-measures or shifts a sibling's position — the same bug class as an unrotated icon swap shifting an accordion trigger (see kmp-roborazzi's "Layout stability regression test").
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/kmp-compose-design-system/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ronjunevaldoz/kmp-agent-skills/kmp-compose-design-system)