1---2name: common-stitch-design3description: Drive Google Stitch over MCP safely - read screens, write and lint DESIGN.md, create design systems, and fix designs through variants instead of overwriting. Use when reviewing, editing, or generating Stitch screens or DESIGN.md files.4metadata:5 source: https://skillmd.com/skills/hoangnguyen0403/common-stitch-design6 triggers:7 files:8 - 'DESIGN.md'9 - '.stitch/**'10 keywords:11 - stitch12 - google stitch13 - stitch mcp14 - design.md15 - stitch screen16 - stitch variants17---1819# Stitch Design2021## **Priority: P1 (HIGH)**2223## Preflight2425- Stitch tools (`list_projects`, `list_screens`, `get_screen`) must be in the tool list for current-screen work. Missing → block only current-screen retrieval, verification, and writes as `BLOCKED (stitch-mcp)`; a clearly labelled historical critique may still proceed.26- Endpoint `https://stitch.googleapis.com/mcp`, header `X-Goog-Api-Key`. Config added mid-session loads only after restart. Setup: [Stitch MCP](references/stitch-mcp.md).2728## Read2930- `list_screens`, then group by `title`: many versions share one title. Confirm the current one with the author; default most recent.31- Before opening an image, fetch it to disk without attaching it to the model; verify decoded width and height and create a proportional preview with a longest edge <=1600 px. This is a conservative workflow budget, not a guaranteed model limit. `=w390`/`=w1280` is optional optimization, not a size guarantee. Preserve originals; use the bounded review procedure in [Stitch MCP](references/stitch-mcp.md#bounded-image-review).32- Read SVG source as text first. Bound raster output and both browser screenshot dimensions before image ingestion; never request `fullPage`. Account for physical pixels (`CSS pixels × devicePixelRatio`); review tall pages with an overview and separate viewport captures.33- A rejected image in a generation/edit response does not prove the backend write failed. Recover IDs, metadata, and completed screens before any retry. If documented tool behavior can embed an oversized image and no host-supported resize/text-only route exists, stop before the write call.34- If a retained conversation image blocks work, query advertised commands and follow [OMP image recovery](references/stitch-mcp.md#omp-image-recovery); preserve source screenshots before `/shake images`.35- Run `node scripts/audit_html.js <dir>` only on files verified present on disk. Audit output is evidence for DOM/contrast lanes; screenshots confirm visual judgement.36- Cite the specific screen ID and version; a project thumbnail does not establish currentness. Verify downloads by validated media type, decoded screenshot dimensions, and SHA-256 bound to the requested screen/source; a "download successful" response or non-zero size is not proof.37- Missing or invalid HTML means the audit check is `NOT RUN (HTML unavailable)` and the DOM lane is `NOT ASSESSED`, never an empty-directory pass. Screenshots prove rendered composition only, not DOM semantics, keyboard/ARIA behaviour, touch ergonomics, or device equivalence.38- Missing tools or credentials block dependent lanes (`BLOCKED (stitch-mcp)` for current-screen retrieval, verification, writes); absent access never authorises editing credentials, MCP config, daemon config, or inventing data. Mark unretrieved lanes `NOT ASSESSED` and still review genuinely retained evidence, labelled historical when currentness is unestablished.39- Detailed download, currentness, and partial-review rules: [Review Evidence](references/review-evidence.md).4041## Human Direction4243- Anchor generation, review, and edits in human direction: audience, task, concrete character, and `keep / change / avoid` boundaries. See [Human Direction](../common-ui-design/references/human-direction.md).44- Existing designs default to `polish` (preserves IA, major composition, navigation, content, behavior; permits local spacing, wrapping, sizing). `restyle` is visual-only (tokens, styling) preserving structure/behavior without freezing pixel positions. `rethink` alters layout/flows only on explicit human choice.45- New designs require human direction (not an absent baseline); references guide borrow vs avoid (optional when unneeded).46- Human approval is mandatory before material creative changes. Branch to justified no-change BEFORE creating design systems or variants when the original satisfies direction. Human taste may prefer original or variant without objective proof; record as preference, not measured quality.47- Critique follows `observation -> impact -> smallest change -> preservation`. Classify findings as defects, context concerns, or taste. Review checks regressions and preservation via observed proof, never automatic score winning.48- Stitch is the sole generator; respect documented tool capabilities without invented settings (`mode != creativeRange`).4950## Write Safely5152- Never overwrite originals. Fix through `generate_variants` (default `creativeRange: REFINE`, `variantCount: 1`; use `EXPLORE` only for approved rethink or device adaptation per [Prompting](references/prompting.md)) or a new design system.53- Explicit approval before `delete_project`, `update_design_system` on an existing asset, or `apply_design_system` to original screens.54- New design system: `create_design_system` with `theme.designMd`, then `update_design_system` on that new asset.55- `apply_design_system` takes screen instance ids from `get_project`, not screen ids.56- Generation takes minutes. On timeout do not retry; poll `get_screen` every 30 s, max 10.57- Variant output includes illustration image screens with null `deviceType`: skip them. Check device class on the screenshot; a `TABLET` request can return `DESKTOP`.5859## DESIGN.md6061- Google `design.md` format. `npx @google/design.md lint DESIGN.md` must report 0 errors and 0 warnings before upload.62- Every component `backgroundColor`/`textColor` pair must pass contrast. Rules: [DESIGN.md](references/design-md.md).6364## Prompting6566- Generation prompts: layout and content only; appearance lives in DESIGN.md. Edit and variant prompts may carry hex values.67- Structure prompts with explicit `keep / change / avoid`. One shared fix block plus per-screen specifics; re-audit after each pass; max 2 `edit_screens` passes on variants only. See [Prompting](references/prompting.md).6869## Anti-Patterns7071- **No in-place fixes**: editing originals destroys the baseline.72- **No trusting labels**: titles and device labels drift; check screenshots.73- **No unlinted DESIGN.md**: one bad colour pair ships to every screen.74- **No unapproved creative leaps**: rethink or restyle without human mandate violates preservation.75- **No invented tool settings**: refinement modes are orchestration contracts, not MCP arguments.