compose-ui-builder

Build Jetpack Compose screens from specs, mockups, or Figma descriptions with state hoisting and previews.

Updated Jan 2, 2024
One-click install
npx skills add https://github.com/Mithrandir21/game-deals-app --skill compose-ui-builder-mithrandir21
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: compose-ui-builder
Source: https://github.com/Mithrandir21/game-deals-app/tree/main/.claude/skills/compose-ui-builder
Command: npx skills add https://github.com/Mithrandir21/game-deals-app --skill compose-ui-builder-mithrandir21

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Translating a design into production-quality Jetpack Compose code involves more than writing pixels — it requires correct state hoisting, theming, accessibility, previews, and responsive layout. This Skill provides a structured six-phase process so the resulting screen holds up in code review instead of becoming a hardcoded, untestable monolith. ## Core Features & Use Cases - Structured screen architecture: Splits every screen into a stateful wrapper, a stateless screen Composable, section composables, and leaf composables, keeping ViewModels out of previewable code. - State-driven design: Defines a UiState model covering loading, empty, error, and content states, with a @Preview for each state plus dark-theme and font-scale variants. - Theming, accessibility, and responsiveness: Enforces use of MaterialTheme tokens instead of hardcoded values, checks touch targets and semantics for TalkBack, and branches layouts on WindowSizeClass for tablets and foldables. - Use Case: A developer pastes a Figma link for a deals list screen and asks to implement it; the Skill produces the UiState definition, stateful/stateless Composables, per-state previews, and notes on which theme tokens were reused. ## Quick Start Ask the assistant to turn this mockup or Figma design into a Jetpack Compose screen with state hoisting, previews for every UI state, and accessibility support.

Frequently Asked Questions about compose-ui-builder

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert a Figma design into Jetpack Compose code?▼

Start by defining a UiState covering loading, empty, error, and content states, then build top-down: a stateful wrapper collecting state from the ViewModel, a stateless screen Composable, section composables, and leaf components. Use the project's MaterialTheme tokens rather than hardcoded values.

How to structure a Compose screen for testability and previews?▼

Split the screen into a stateful wrapper that hoists UiState via collectAsStateWithLifecycle and a stateless Composable taking state and an event callback. The stateless layer has no ViewModel reference, making it fully previewable and unit-testable.

Does Jetpack Compose support tablets and foldables?▼

Yes, Compose supports adaptive layouts through WindowSizeClass. Compact widths use a single column, while medium and expanded widths can switch to two-pane or wider list layouts depending on the design.

Why should ViewModels be kept out of stateless Composables?▼

Referencing a ViewModel inside a screen Composable breaks @Preview rendering and makes UI tests require a full dependency graph. Hoisting state into a plain UiState parameter keeps the Composable previewable and testable in isolation.

What accessibility checks does a Compose screen need?▼

Every clickable element needs a semantic role and contentDescription when visible text is insufficient, touch targets must be at least 48.dp, color cannot be the only state signal, and focus order must work correctly with TalkBack enabled.