design-ui
Skill56 starsChanged 3 months agoMITView on GitHub
Design UI screens in Google Stitch and produce a Compose Implementation Blueprint with HTML + token inventories persisted for downstream skills.
- Installs packages
We split this skill into the rules it gives an agent
15 rules. 0 are common, 6 are distinctive, and 9 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
After design-ui completes, the user can invoke /create-feature (new feature, no Kotlin source yet) or /modify-feature (existing feature, …
- Very specific: line 25
(First-time only): Run /design-ui with no arguments to initialize the shared Stitch project + design system from XTheme.kt.
- Very specific: line 26
Run /design-ui {featurename} (e.g., /design-ui dashboard) — one feature per invocation (the primary screen + any tightly-related secondary …
- Very specific: line 27
Run /create-feature {featurename} (new) or /modify-feature {featurename} (existing) to implement — they auto-detect the blueprint.
- Very specific: line 28
Run /verify-ui {featurename} to audit code against the design.
- Very specific: line 32
Run this check before any other work, for every invocation (no-args init mode and {featurename} mode alike).
- Very specific: line 46
If the command fails (python3: command not found, non-zero exit), STOP and tell the user:
- Distinctive: line 62
Do not retry or work around the failure — wait for the user to install Python 3 and re-invoke the skill.
- Very specific: line 77
Run when .claude/docs/_project/stitch-project.json does not exist or initState.completedAt is null.
- Distinctive: line 81
Verify MCP availability, resolve feature context, load project-wide config, and register or resume the feature in the shared project.
- Distinctive: line 90
User Confirmation Required: after Phase 1 (design approval) - never proceed without explicit approval
- Distinctive: line 91
All design changes go through Stitch: - never modify designs outside of Stitch MCP tools
- Very specific: line 93
Single config architecture: All Stitch state lives in .claude/docs/_project/stitch-project.json.
- Distinctive: line 94
Stitch MCP is mandatory: - if not available, stop and ask user to configure it
- Distinctive: line 104
All shared and empty designs use the same single approve-or-edit loop pattern (max 10 iterations).
“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Design UI
Design UI screens in Google Stitch and produce a Compose Implementation Blueprint with HTML + token inventories persisted for downstream skills.
Architecture Reference: _shared/patterns.md — do not preload this file. Read only the specific section a step explicitly cites (e.g. "Typography" in Step 1.16, Rule 13 in Step 1.17), at the moment that step runs. Every rule this skill depends on is either restated inline in the phase files or cited with its exact section name.
Purpose
design-ui is a design-only skill. It handles all Stitch MCP design work and produces a Compose Implementation Blueprint plus persisted HTML + token inventories under .claude/docs/{featurename}/designs/extracted/. The blueprint references project-wide rules (patterns.md, m3-colors.md, X_COMPONENTS_CATALOG.md) rather than restating them. It does NOT implement code or invoke other skills.
After design-ui completes, the user can invoke /create-feature (new feature, no Kotlin source yet) or /modify-feature (existing feature, Kotlin source already exists) to implement the design. Those skills auto-detect the blueprint and enter design-aware mode.
Invocation modes:
/design-ui(no args) — explicitly run Project Init for the repo/design-ui {featurename}— design that feature (its primary screen plus any tightly-related secondary screens — an overlay surface like a bottom sheet/dialog, or a full sibling screen like an edit screen — designed together in the same pass; Project Init auto-runs if needed)
Quick Start (first feature)
- (First-time only) Run
/design-uiwith no arguments to initialize the shared Stitch project + design system fromXTheme.kt. If you skip this, any future/design-ui {featurename}call will auto-bootstrap. - Run
/design-ui {featurename}(e.g.,/design-ui dashboard) — one feature per invocation (the primary screen + any tightly-related secondary screens: an overlay surface like a bottom sheet/dialog, or a full sibling screen like an edit screen). Iterate via approve/edit. Produces a blueprint at.claude/docs/{featurename}/designs/{featurename}_blueprint.md. - Run
/create-feature {featurename}(new) or/modify-feature {featurename}(existing) to implement — they auto-detect the blueprint. - Run
/verify-ui {featurename}to audit code against the design.
Tooling Preflight
Run this check before any other work, for every invocation (no-args init mode and {featurename} mode alike). It is cheap and must pass before Phase 0 or Project Init begin.
Python 3 is required by two scripts invoked during Phase 1 Step 1.15:
.claude/skills/_shared/extract_tokens.py— Stitch HTML token extraction (sub-step 4; also used by the shared-state generation paths inphase-init.md)..claude/skills/_shared/download_assets.py— generates the icons manifest (--type icons, sub-step 5) AND the images manifest (--type images, sub-step 6)./design-uialways invokes it with--manifest-only(doc artifact only).
XML downloads, image downloads, DesignSystemResources.kt edits, and cross-feature Kotlin import rewrites all happen later in /create-feature or /modify-feature (which run the same script without --manifest-only).
MANDATORY —
download_assets.pyis the ONLY asset acquisition mechanism. Never download, fetch, or write any icon/image asset yourself (nocurl/wget/WebFetch to icon or image URLs, no hand-written SVG/XML/raster files). Material Symbols are font glyphs in the HTML, not files — never "source" an icon. The only sanctioned path is.claude/skills/_shared/download_assets.py(manifest-only in/design-ui; full materialization in the implementation skills). If that script cannot produce an asset, STOP and report — do not improvise a download. Improvised fetches grab SVGs, which crash on Android at runtime.
python3 --versionIf the command fails (python3: command not found, non-zero exit), STOP and tell the user:
Python 3 is not installed (or `python3` is not on PATH). /design-ui extracts
design tokens via .claude/skills/_shared/extract_tokens.py and generates the
icons + images manifests via .claude/skills/_shared/download_assets.py
(--type icons | --type images). Cannot proceed without it.
Install Python 3, then re-invoke /design-ui:
- macOS: brew install python3
- Linux: sudo apt-get install python3 (or your distro's package manager)
- Windows: https://www.python.org/downloads/ (or `winget install Python.Python.3`)
Verify with: python3 --versionDo not retry or work around the failure — wait for the user to install Python 3 and re-invoke the skill.
Workflow
[USER INVOKES] → Tooling Preflight (python3) → Phase 0 (Preflight) ──┐ ┌──→ Phase 1 (Design) → [USER APPROVES] → DONE
│ (if stitch-project.json absent │ Blueprint saved
│ or initState.completedAt null) │
└──→ Project Init (phase-init.md) ─┘
(auto-runs; one-time per repo)Token efficiency (every phase): issue independent tool calls (multiple
Reads, independentpython3runs, parallel file checks) batched in a single response — one round-trip, not one per call. Exceptions stay sequential where a step says so (e.g. Stitch HTML downloads in Step 1.15 sub-step 3 — single-use URLs race).
Project Init (One-Time Per Repo)
Run when .claude/docs/_project/stitch-project.json does not exist or initState.completedAt is null. Creates the shared Stitch project and design system. Shared Loading/Failed screens are NOT generated at init time — they are designed lazily by the first feature that opts in (Phase 1 Step 1.8).
See: Project Init
Phase 0: Preflight Checks
Verify MCP availability, resolve feature context, load project-wide config, and register or resume the feature in the shared project. See: Phase 0: Preflight
Phase 1: Design in Stitch
Generate screens, iterate with user, export approved designs as screenshots. Generate Implementation Blueprint. See: Phase 1: Design — staged: Step 1.14 continues in phase-1-states.md, Steps 1.15–1.19 in phase-1-finalize.md; read each stage file only when the workflow reaches it.
Critical Rules
- User Confirmation Required after Phase 1 (design approval) - never proceed without explicit approval
- All design changes go through Stitch - never modify designs outside of Stitch MCP tools
- Screenshots stored at
.claude/docs/{featurename}/designs/- visible to user - Single config architecture: All Stitch state lives in
.claude/docs/_project/stitch-project.json. It is the source of projectId, shared screen IDs, per-feature screen metadata, per-feature state selections (features[featurename].states), andblueprintConsumed. There are no per-featurestitch.jsonfiles. - Stitch MCP is mandatory - if not available, stop and ask user to configure it
- Blueprint is the handoff artifact — contains Pre-Implementation Contract + Post-Implementation Checklist. Implementation skills consume it via
blueprintConsumedflag institch-project.json.features[featurename] blueprintConsumedlifecycle — design-ui setsblueprintConsumed: falseinstitch-project.json.features[featurename]when saving a new blueprint. Implementation skills set it totrueafter consuming the blueprint- M3 Color Roles Only - All design colors must map to M3 roles defined in
XTheme.kt'sXLightColorsandXDarkColors. After design approval, a Color Audit identifies missing roles which are documented in the blueprint's Pre-Implementation Contract. Feature code usesMaterialTheme.colorScheme.*exclusively — never hardcodedColor(). CustomXTheme.Colors.*extensions are last resort for non-semantic colors (gradients, decorative effects). - Project Init auto-runs when needed — Phase 0 preflight checks for
.claude/docs/_project/stitch-project.jsonbefore proceeding. If absent orinitState.completedAtis null, Project Init runs automatically (followingphase-init.mdend-to-end), then Phase 0 resumes for the requested feature. Users may also invoke/design-uiwith no arguments to run Init explicitly. - Cross-Screen Chrome Consistency — When generating a screen for a project that already has approved features, the shared chrome (top app bar style, bottom navigation presence/style, screen background) must match the existing feature screens. The only exception is when the user explicitly asks for a different chrome ("no bottom nav", "centered title bar", "full-screen modal", etc.). The chrome snapshot is captured in Phase 1 Step 1.2 and injected as a "Shared Conventions" block into the Stitch generation prompt (Step 1.10).
- Optional States — User-Selected, Lazily Designed, Confirmable — Only success is mandatory per feature. Loading/Failed/Empty are gated in Phase 1 Step 1.7:
- Loading / Failed — user opt-in. Reuse the shared screens. Project Init does NOT auto-generate shared Loading/Failed; they're designed lazily by the first feature that opts in via Step 1.8 (which invokes phase-init.md's On-Demand Procedures, before the feature's success screen). Every subsequent feature that opts in inherits them for free.
- Empty — dual gate: user opt-in AND
isListBased == true(determined in Step 1.1). WhenisListBased == false, the Empty option is not even offered. When both gates pass, design per-feature via a single approve-or-edit loop. - Skipped states are omitted everywhere: no token inventory, no implementation reference. Loading/Failed sections in the blueprint show an explicit "Skipped" marker; Empty is omitted entirely.
- All shared and empty designs use the same single approve-or-edit loop pattern (max 10 iterations).
- One feature per invocation — primary + secondary screens —
/design-ui {featurename}designs a whole feature, not a single screen. A feature is its primary success screen plus zero or more tightly-related secondary screens, each either an overlay surface (kind: surface— bottom sheet, dialog, modal, drawer, panel) or a full sibling screen (kind: screen— e.g. profile + edit-profile: a child route reached from the primary, same data/domain). Detected screens are classified (keptsurface/screenvs separate feature) and the grouping is confirmed with the user before generating (Phase 1 Step 1.1). Genuinely separate features still split — one feature per invocation. Each secondary goes through the full pipeline (generate → approve → HTML/token extract → blueprint section) and is persisted under the samefeatures[{featurename}]object in asecondaryScreens[]array (each entry carries itskind; empty/absent when the feature has none — the common case, which behaves exactly as before).
Stitch MCP Reference
For Stitch tool usage patterns and prompt engineering tips: See: Stitch MCP Reference
Error Handling
| Error | Action |
| Stitch MCP not available | Run the Guided Setup in phase-init.md → Init-1. Full reference: stitch-setup.md. Stop after instructing the user — they must restart Claude Code before the skill can continue. |
| Stitch MCP shows Connected but tools return "No such tool available" | HTTP transport timed out mid-session — tools dropped from the session registry. claude mcp list may still show "✔ Connected" (cached state). Fix: open /mcp dialog → reconnect Stitch. If tools still absent after reconnect, restart Claude Code. MCP tools only reload at session start; mid-session reconnect via /mcp dialog is sufficient in most cases. |
| Stitch generation times out / connection reset | Do NOT retry the generation call (known Google Stitch bug — the generation often succeeded server-side and a retry creates a duplicate). Ask the user to open https://stitch.withgoogle.com/projects/{projectId} in their browser to trigger sync. Wait for confirmation, then call list_screens to locate the new screen. |
| Stitch generation fails with a non-timeout error | Retry with refined prompt. Max 3 attempts |
| Stitch project not found | Create new project automatically |
| stitch-project.json not found | Run Project Init first. Invoke /design-ui without a feature name argument. |
Completion Report
Emit one screenshot row per selected state only. Always show Success. Loading/Failed/Empty rows appear only when stitch-project.json.features[{featurename}].states.{state} == true. Append one additional row per secondary screen in secondaryScreens[] (label + role + kind + screenshot).
## UI Designer Complete: {FeatureName}
Stitch Project ID: {projectId} (shared project)
Design System ID: {designSystemAssetId}
Project config: .claude/docs/_project/stitch-project.json
| State | Screenshot |
|-------|------------|
| Success | designs/{featurename}.png |
{if states.loading} | Loading | .claude/docs/_shared/designs/loading.png (shared) |
{if states.failed} | Failed | .claude/docs/_shared/designs/failed.png (shared) |
{if states.empty} | Empty | designs/{featurename}_empty.png |
States selected: success{, loading if states.loading}{, failed if states.failed}{, empty if states.empty}
States skipped (no design reference): {comma-separated list, or "none"}
Design spec: designs/{featurename}.md
Blueprint: designs/{featurename}_blueprint.md
Project config: .claude/docs/_project/stitch-project.json
blueprintConsumed: false (set in stitch-project.json.features[{featurename}])
## What's next
- Implementation skill will auto-detect the blueprint and enter design-aware mode.
- For skipped states, implementation will use generic handling (Rule 4 in patterns.md still applies — feature code must handle all four UI states, just without a design reference for the skipped ones).
- After implementation, run `/verify-ui {featurename}` to audit code against the design.
---
> **Next step —** run `/clear` to free the context window (the blueprint + `stitch-project.json` are durable artifacts — the implementation skill auto-detects and re-reads them fresh, so clearing loses nothing and frees the large Stitch/HTML context), then pick the implementation skill based on **`Feature Exists`** from Phase 0:
> - **`Feature Exists: no`** → `/create-feature {featurename}` — no Kotlin source files exist; create the feature from scratch
> - **`Feature Exists: yes`** → `/modify-feature {featurename}` — Kotlin source files already exist; add the design to the existing feature
>
> **Do not use `StitchMode` (stitch-new / stitch-resume) to make this decision** — that tracks Stitch design session state, not Kotlin code existence.Other versions12 projects use a version of this.
Word for word · 1
- ThisIsSadeghi/Loupe★ 1100% same
Edited · 0
None found.
Wrote their own version · 11
- kdy1/kdy1-scripts★ 33same name
- mae616/ai-template★ 9same name
- melconcoast/code-idea★ 3same name
- shreyas-makes/agent-skills★ 2same name
- blauwtje/exo★ 1same name
- evgenii-studitskikh/Claude-Code-SaaS-Studio★ 1same name
- leolionart/claude-skills★ 1same name
- NachikethReddyY/skills★ 1same name
- vasu-devs/Forge★ 1same name
- cachewraith/cachewraith-skills★ 0same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- bridge-swiftSkill
- create-featureSkill
- modify-featureSkill
- using-design-systemSkill
- verify-uiSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

