-
Notifications
You must be signed in to change notification settings - Fork 0
UI Designer
Ali Sadeghi edited this page May 18, 2026
·
2 revisions
Design UI screens in Google Stitch and produce a Compose Implementation Blueprint plus persisted HTML + token inventories. ui-designer is a design-only skill — it never writes Compose code or invokes another skill.
Invocation:
/ui-designer # one-time project init
/ui-designer myfeature # design (or resume) a featureRequires: the Stitch MCP server. If it's not configured the skill stops and tells you to set it up.
| Artifact | Path |
|---|---|
| Shared project config | .claude/docs/_project/stitch-project.json |
| Per-state screenshots | .claude/docs/{featurename}/designs/{featurename}_{state}.png |
| Design spec | .claude/docs/{featurename}/designs/{featurename}.md |
| Compose Implementation Blueprint | .claude/docs/{featurename}/designs/{featurename}_blueprint.md |
| Raw HTML per state | .claude/docs/{featurename}/designs/extracted/stitch_{state}.html |
| Token inventories per state | .claude/docs/{featurename}/designs/extracted/tokens_{state}.md |
The blueprint references project-wide rules (patterns.md, m3-colors.md, X_COMPONENTS_CATALOG.md) rather than restating them.
[USER INVOKES]
│
├─ Project Init (only if stitch-project.json missing or incomplete)
│ └ Creates shared Stitch project, design system, and shared Loading/Failed screens
│
├─ Phase 0: Preflight
│ └ Verify MCP, resolve feature context, register or resume the feature in the shared project
│
├─ Phase 1: Design
│ └ Generate / iterate screens, export approved designs as screenshots,
│ extract HTML + tokens, write blueprint
│
└ [USER APPROVES DESIGN] → blueprint saved → DONE
Run /ui-designer without a feature name when .claude/docs/_project/stitch-project.json doesn't exist or initState.completedAt is null. It creates:
- The shared Stitch project
- The shared design system (Tailwind config) from the KMPilot color/typography rules
- The shared Loading and Failed state screens (every feature reuses these IDs)
- User confirmation required after Phase 1 (design approval).
- All design changes go through Stitch — never edit designs outside the Stitch MCP tools.
-
Screenshots live at
.claude/docs/{featurename}/designs/(committed, visible to user). -
Single config architecture — all Stitch state lives in
stitch-project.json. There are no per-featurestitch.jsonfiles. - Stitch MCP is mandatory — stop and ask the user to configure it if missing.
-
Blueprint is the handoff artifact — contains Pre-Implementation Contract + Post-Implementation Checklist. Consumed via
blueprintConsumedflag. -
blueprintConsumedlifecycle —ui-designersetsfalsewhen saving; implementation skills settrueafter consuming. -
M3 Color Roles Only — every color must map to an M3 role defined in
XTheme.kt'sXLightColors/XDarkColors. The Color Audit identifies missing roles and lists them in the blueprint's Pre-Implementation Contract. -
Project Init is a prerequisite — Phase 0 checks for
stitch-project.json; if absent, you must run Project Init first. - Cross-Screen Chrome Consistency — shared chrome (top app bar style, bottom nav, screen background) is captured from existing approved features and injected as a "Shared Conventions" block unless you explicitly ask for different chrome.
| Error | Action |
|---|---|
| Stitch MCP not available | Stop, ask to configure the MCP server |
| Stitch generation times out / connection reset |
Do NOT retry — the generation often succeeded server-side. Open https://stitch.withgoogle.com/projects/{projectId} in browser to trigger sync, then list_screens finds the new screen. |
| Generation fails with non-timeout error | Retry with refined prompt, max 3 attempts |
| Stitch project not found | Auto-create |
stitch-project.json not found |
Run Project Init first (no feature name argument) |
## UI Designer Complete: {FeatureName}
Stitch Project ID: {projectId} (shared)
Design System ID: {designSystemAssetId}
Loading: designs/{featurename}_loading.png (shared)
Failed: designs/{featurename}_failed.png (shared)
Project config: .claude/docs/_project/stitch-project.json
| State | Screenshot |
|---------|------------|
| Success | designs/{featurename}.png |
| Loading | designs/{featurename}_loading.png (shared) |
| Failed | designs/{featurename}_failed.png (shared) |
| Empty | designs/{featurename}_empty.png |
Design spec: designs/{featurename}.md
Blueprint: designs/{featurename}_blueprint.md
blueprintConsumed: false
## Next Steps
- Existing feature → /modifying-kmp-feature {featurename}
- New feature → /creating-kmp-feature {featurename}
To verify the implementation against the design:
- /verify-ui {featurename}
- Design-Pipeline — full design → implement → verify flow
- Verify-UI — what the audit checks
- Creating-KMP-Feature — design-aware Phase 0.5
- Modifying-KMP-Feature — design-aware step 2.5
Back to Skills