--- name: platform-ui-generation description: Guide for converting the design files (design-tokens.json + ui-blueprint.json) into application code for Web, Flutter, or WinUI 3. Use when executing the App Shell milestone (milestone 01) or implementing UI against the design spec. --- # Platform UI Generation Skill This skill explains how to convert the design files under `docs/design/` into application code. It is used by the **App Shell milestone** (milestone 01 — planned by `/plan-milestones`, executed by `/execute-milestones` or `/add-feature`) and by `/add-feature` when implementing UI. ## Core Principles 1. **Source of truth**: `docs/design/ui-blueprint.json` defines structure; `docs/design/design-tokens.json` defines values. 2. **No hard-coded values**: every color, size, spacing, radius, and duration in generated code must come from a token. 3. **Reusable components first**: extract reusable components; do not inline the entire tree into screens. 4. **No feature logic during scaffolding**: the App Shell milestone creates the shell, theme, routes, screens, and shared components only. Features come from the later milestones. 5. **Respect the platform mapping**: `docs/design/platform-mapping.md` documents how each artifact maps to each platform. ## Inputs - `docs/design/design-brief.md` — direction - `docs/design/design-tokens.json` — values - `docs/design/ui-blueprint.json` — structure (source of truth) - `docs/design/platform-mapping.md` — per-platform conversion rules - `docs/architecture.md` — technology choices (framework, language) ## General Conversion Rules - One screen in the blueprint → one screen/page in the target platform. - One route in the blueprint → one route entry in the navigation config. - A reusable component referenced in multiple screens → a shared component file/widget/control. - Component `variant` → a variant/style modifier on the shared component. - Component `state` → visual states the component must support (default, hover, pressed, disabled, etc.). - `action: navigate:` → navigation to the corresponding route. - Other `action:` values → wire to a handler/placeholder; do not implement feature logic. ## Web Mapping - **design tokens →** CSS variables, a Tailwind config, or a theme object. - `color.*` → CSS custom properties (`--color-background-primary`) or Tailwind theme colors. - `spacing.*`, `radius.*`, `typography.*` → CSS variables / Tailwind theme keys. - `breakpoint.*` → responsive breakpoints. - **ui-blueprint →** - `screens` → pages/routes. - `layout` → layout components (vertical/horizontal stack, grid). - `components` → React (or framework) components, one file per reusable component. - Use **semantic HTML** (`
`, `
`, `