Shared patterns and best practices for Google Stitch MCP integration. Referenced by all design pipeline commands (design-system, design-spec, mockups, design-critique, design-to-code, design-verify).
From product-playbook-for-agentic-codingnpx claudepluginhub daviswhitehead/product-playbook-for-agentic-coding-plugin --plugin product-playbook-for-agentic-codingThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
This skill encodes the conventions for working with Google Stitch MCP across the design pipeline. Every command that generates or evaluates visual designs references these patterns.
Use ToolSearch to locate Stitch tools before invoking them:
ToolSearch query: "+stitch"
Stitch tools are exposed through MCP and may carry a namespace prefix (e.g., mcp__stitch__create_project). The prefix depends on the user's MCP server configuration. Always discover the exact names at runtime rather than hard-coding them.
If ToolSearch returns no Stitch tools:
Every prompt sent to generate_screen_from_text or edit_screens must follow the 5-element structure:
A single sentence describing what the screen does and who it serves.
"A restaurant menu browsing screen for hungry customers deciding what to order."
Inject the relevant DESIGN.md sections directly into the prompt. At minimum include:
Enumerate the specific UI components that appear on the screen, with their states:
Describe the spatial arrangement:
Descriptive language about the visual feel. Use physical metaphors:
| Rule | Rationale |
|---|---|
| One change per prompt when editing | Stitch handles single edits more reliably than compound changes. Chain multiple edit_screens calls for multiple changes. |
| One screen per generation | Multi-screen prompts produce inconsistent results. Generate screens individually and use the consistency pattern below. |
| Descriptive color names + hex | Write Warm Terracotta (#C75B3F) not just #C75B3F. Descriptive names improve Stitch's color interpretation. |
| Realistic content | Use plausible names, prices, and copy. "Grilled Salmon — $24" not "Item 1 — $X". Realistic content produces better layouts. |
| Specify viewport | Always include target dimensions: Mobile viewport: 390×844 (iPhone 14) or Desktop viewport: 1440×900. |
| No implementation details | Describe what the user sees, not how to build it. "A card with rounded corners" not "A div with border-radius: 12px". |
Every project should have a DESIGN.md at its docs root. This is the single source of truth for visual decisions, and its sections get injected into Stitch prompts.
# DESIGN.md
## Visual Theme & Atmosphere
Physical/sensory description of the overall feel.
Use language like "daylight on stone", "warm oak shelf",
"linen tablecloth texture". Avoid abstract jargon.
## Color Palette & Roles
| Role | Name | Hex | Usage |
|------|------|-----|-------|
| Primary Background | Warm Linen | #FAF6F1 | Page and screen backgrounds |
| Surface | Light Oak | #F0E8DC | Cards, elevated panels |
| Primary Action | Terracotta | #C75B3F | CTAs, active states |
| ... | ... | ... | ... |
Every color must have a Role (what job it does), a Name
(physical/descriptive), a Hex (exact value), and a Usage
(where it appears).
## Typography Rules
Font families, size scale, weight rules, line-height ratios.
## Spacing & Radius
Base unit, spacing scale, border-radius tokens.
## Component Patterns
Reusable patterns: buttons, cards, inputs, navigation,
modals, toasts, empty states.
## Shadow & Depth
Elevation levels and their shadow definitions.
Which elements are elevated vs flat.
## Accessibility Constraints
Contrast requirements, focus indicators, touch target
minimums, reduced motion policy.
When generating multiple screens, use this sequence to maintain visual consistency:
Generate anchor screen — Pick the most visually complex or representative screen first. Generate it with generate_screen_from_text and iterate until it meets the design system.
Extract design context — Use get_screen on the anchor screen to retrieve its design details. This captures the specific visual decisions Stitch made (exact spacing, shadows, component rendering).
Prepend to subsequent prompts — For every following screen, include the extracted design context at the top of the prompt:
REFERENCE DESIGN (match this visual style exactly):
[extracted design context from anchor screen]
NEW SCREEN:
[5-element prompt for the new screen]
Verify at end — After generating all screens, visually compare them. If drift occurred, use edit_screens to bring outliers back in line with the anchor.
The Color Palette, Typography, Spacing, and Component Patterns sections from DESIGN.md must be included in every generation prompt. This is non-negotiable — Stitch has no memory between calls, so the design system must be restated each time.
Injection format:
DESIGN SYSTEM:
[paste relevant DESIGN.md sections here]
SCREEN:
[5-element prompt]
After generating a batch of screens:
list_screensget_screenedit_screens to fix any driftStitch provides two generation modes with monthly limits:
| Mode | Monthly Limit | Use For |
|---|---|---|
| Standard | 350 generations | Iteration, exploration, layout testing, rapid prototyping |
| Experimental | 50 generations | High-fidelity output, final mockups, presentation-quality screens |
edit_screens for targeted changes. Each edit is cheaper than a full regeneration.Skip Stitch generation when:
Understanding Stitch's limitations prevents wasted generations and misset expectations.
| Limitation | Impact | Workaround |
|---|---|---|
| Visual hierarchy may be flat | Headlines, body text, and labels can render at similar visual weight | Explicitly call out size and weight differences in prompts: "Page title at 32px bold, section headers at 20px semibold, body at 16px regular" |
| Cannot apply brand automatically | Stitch has no persistent design system memory | Inject DESIGN.md into every prompt (see Consistency Patterns) |
| Placeholder icons | Icons may not match your icon set | Accept placeholders; specify icon names in prompt for documentation |
| No animation | Output is static; transitions and motion cannot be previewed | Document animations in the design spec; Stitch shows resting states only |
| Static HTML/CSS output | Generated screens are visual references, not production code | Use as a spec for engineering, not a code source |
| Multi-screen drift | Colors, spacing, and typography can drift between separate generations | Use feed-forward pattern with anchor screen and design context extraction |
| Complex interactions | Hover states, modals, and multi-step flows render poorly in single screens | Generate each state as a separate screen; annotate transitions in the design spec |
| Responsive behavior | Stitch generates for one viewport at a time | Generate separate screens for mobile (390px) and desktop (1440px) viewports |
These are the core Stitch MCP tools. Actual names may carry a namespace prefix (e.g., mcp__stitch__). Always discover via ToolSearch before use.
| Tool | Purpose | When to Use |
|---|---|---|
list_projects | List all Stitch projects | Start of session — find existing project or confirm need for new one |
create_project | Create a new Stitch project | Once per design pipeline run; name should match the feature/product |
get_project | Retrieve project details | After creation to confirm settings, or to resume a previous session |
list_screens | List all screens in a project | Before generating to see what exists; after generating to verify batch |
get_screen | Retrieve a single screen's details | Extract design context for feed-forward; review a specific generation |
generate_screen_from_text | Generate a new screen from a text prompt | Primary generation tool — follow the 5-element prompt structure |
edit_screens | Modify an existing screen | Targeted changes to fix drift, adjust layout, or iterate on details |
generate_variants | Generate alternative versions of a screen | Explore options for a specific screen; compare approaches before committing |
Namespace note: The tool names above are base names. In practice, they may appear as mcp__stitch__generate_screen_from_text or similar depending on the MCP server configuration. Use ToolSearch query: "+stitch" to discover the exact names in the current environment.
This skill is a shared dependency. Changes here affect all design pipeline commands. Update with care.