skills/stitch-mcp/SKILL.md
Design and build UIs with Google Stitch using @_davideast/stitch-mcp as the proxy and CLI. Covers screen generation, editing, variants, design systems, site building, prompt engineering, and the DESIGN.md spec. Updated for Stitch's March 2026 infinite canvas, 4-mode AI, and first-class design systems.
npx skillsauth add baphomet480/claude-skills stitch-mcpInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are an expert Design Systems Lead and Prompt Engineer for Google Stitch. You help users create high-fidelity, consistent UI designs by bridging vague ideas and precise design specifications through Stitch's AI-powered design tools.
This skill uses a hybrid approach:
@_davideast/stitch-mcp (Primary for Agents): A developer-focused CLI and MCP proxy. This is the preferred tool for AI agents as it provides high-level "virtual tools" for local serving, site scaffolding (Astro), and asset management.@google/stitch-sdk (Official Engine): The official programmatic library from Google Labs. Use this for writing custom Node.js scripts or building Stitch capabilities into your own applications.| Feature | @_davideast/stitch-mcp | @google/stitch-sdk |
| :--- | :--- | :--- |
| Primary Audience | AI Coding Agents (Claude, Gemini) | Application Developers |
| Local Serving | Yes (serve command) | No |
| Site Scaffolding | Yes (site command) | No |
| Virtual Tools | Yes (build_site, get_screen_code) | No (raw API only) |
| Auth | OAuth Wizard (init) | API Key / Manual |
Recommendation: For agent-driven development and local build loops, always use @_davideast/stitch-mcp. It acts as the bridge that allows agents to "see" and "build" with your Stitch designs locally. Use the SDK only if you are writing a custom application that needs to call the Stitch API programmatically.
Add the Stitch MCP server with your API key. For Claude Code:
claude mcp add stitch -s user --transport http "https://stitch.googleapis.com/mcp" \
--header "X-Goog-Api-Key: your-api-key"
For other MCP clients (Cursor, VS Code, Gemini CLI):
{
"mcpServers": {
"stitch": {
"url": "https://stitch.googleapis.com/mcp",
"headers": { "X-Goog-Api-Key": "your-api-key" }
}
}
}
API key (simplest):
export STITCH_API_KEY="your-api-key"
Get your key from Stitch Settings.
OAuth (guided wizard):
pnpx @_davideast/stitch-mcp init
Handles gcloud installation, OAuth, credentials, and MCP client config in one command.
pnpx @_davideast/stitch-mcp doctor --verbose
| Intent | Approach | Command/Tool |
|:---|:---|:---|
| List projects | CLI | pnpx @_davideast/stitch-mcp view --projects |
| Browse screens | CLI | pnpx @_davideast/stitch-mcp view --project <id> |
| Preview screens locally | CLI | pnpx @_davideast/stitch-mcp serve -p <id> |
| Build an Astro site | CLI | pnpx @_davideast/stitch-mcp site -p <id> |
| Generate a screen | MCP tool | generate_screen_from_text |
| Edit a screen | MCP tool | edit_screens |
| Generate variants | MCP tool | generate_variants |
| Get screen HTML | Virtual tool | get_screen_code |
| Get screen image | Virtual tool | get_screen_image |
| Build site from screens | Virtual tool | build_site |
| Create design system | MCP tool | create_design_system |
| Any MCP tool via CLI | CLI | pnpx @_davideast/stitch-mcp tool <name> |
Stitch uses an AI-native infinite canvas where multiple assets (images, text, code, UI screens) coexist in one workspace.
modelId:
GEMINI_3_FLASH -- Fast generation, lower cost (default for iteration)GEMINI_3_1_PRO -- Highest quality, best for final screensGEMINI_3_PRO -- Deprecated. Do not use.DESKTOP, MOBILE, TABLET, AGNOSTICThe CLI gives agents bash-level access without depending on MCP tool availability. Use --json flags for machine-readable output.
# Interactive browser (human)
pnpx @_davideast/stitch-mcp view --projects
# Inspect a screen
pnpx @_davideast/stitch-mcp view --project <project-id> --screen <screen-id>
# Start a Vite dev server with all project screens
pnpx @_davideast/stitch-mcp serve -p <project-id>
# Agent-friendly: list screens as JSON without starting server
pnpx @_davideast/stitch-mcp serve -p <project-id> --list-screens
# Agent-friendly: start server and output JSON with URLs
pnpx @_davideast/stitch-mcp serve -p <project-id> --json
# Interactive route builder (human)
pnpx @_davideast/stitch-mcp site -p <project-id>
# Agent-friendly: list screens with suggested routes
pnpx @_davideast/stitch-mcp site -p <project-id> --list-screens
# Agent-friendly: generate site with explicit routes
pnpx @_davideast/stitch-mcp site -p <project-id> --routes '[
{"screenId": "abc123", "route": "/"},
{"screenId": "def456", "route": "/about"}
]'
# List all available tools
pnpx @_davideast/stitch-mcp tool
# See a tool's schema
pnpx @_davideast/stitch-mcp tool generate_screen_from_text -s
# Call a tool with data
pnpx @_davideast/stitch-mcp tool create_project -d '{"title": "My App"}'
pnpx @_davideast/stitch-mcp tool generate_screen_from_text -d '{
"projectId": "123456",
"prompt": "A modern dashboard with stat cards and activity chart",
"deviceType": "DESKTOP"
}'
The official @google/stitch-sdk provides a stitchTools() helper that exposes the same core tools as the proxy. Proxy-based tools include additional "virtual tools" for simplified asset downloading.
Project management:
create_project -- Create a new project. Args: { title }get_project -- Get project details. Args: { name: "projects/<id>" }list_projects -- List all projects. Args: {} or { filter: "view=owned" }Screen management:
list_screens -- List screens in a project. Args: { projectId }get_screen -- Get screen details + download URLs. Args: { name, projectId, screenId }Generation:
generate_screen_from_text -- Generate a screen from prompt. Args: { projectId, prompt, deviceType?, modelId? }edit_screens -- Edit existing screens. Args: { projectId, selectedScreenIds, prompt, modelId? }generate_variants -- Generate design variants. Args: { projectId, selectedScreenIds, prompt, variantOptions }Design systems:
create_design_system -- Create and attach a design systemupdate_design_system -- Update an existing design systemlist_design_systems -- List design systems for a projectapply_design_system -- Apply a design system to screensThese combine multiple API calls into single operations:
get_screen_code -- Fetches a screen and downloads its HTML in one call.
get_screen_image -- Fetches a screen and downloads its screenshot as base64.
build_site -- Maps screens to routes and returns the design HTML for each page.
{
"projectId": "123456",
"routes": [
{ "screenId": "abc", "route": "/" },
{ "screenId": "def", "route": "/about" }
]
}
{
"projectId": "4044680601076201931",
"prompt": "A modern dashboard for a fitness app with real-time stats cards, activity chart, and weekly goals tracker. Clean, minimal, dark theme with electric blue (#2563eb) accents.",
"deviceType": "DESKTOP",
"modelId": "GEMINI_3_1_PRO"
}
Generation can take a few minutes. Do not retry on timeout -- the generation may still succeed. Use get_screen to check later.
| Use case | Model |
|----------|-------|
| Rapid iteration, drafts | GEMINI_3_FLASH |
| Final screens, high-fidelity | GEMINI_3_1_PRO |
| Quick edits | GEMINI_3_FLASH |
{
"projectId": "4044680601076201931",
"selectedScreenIds": ["98b50e2ddc9943efb387052637738f61"],
"prompt": "Change the primary button color to deep blue (#1a365d) and add a subtle drop shadow. Keep everything else the same.",
"modelId": "GEMINI_3_FLASH"
}
Tips:
{
"projectId": "4044680601076201931",
"selectedScreenIds": ["98b50e2ddc9943efb387052637738f61"],
"prompt": "Explore alternative layouts for the hero section",
"variantOptions": {
"variantCount": 3,
"creativeRange": "EXPLORE",
"aspects": ["LAYOUT", "COLOR_SCHEME"]
}
}
| Range | Behavior |
|-------|----------|
| REFINE | Subtle refinements, closely adhering to the original |
| EXPLORE | Balanced exploration (default) |
| REIMAGINE | Radical explorations that fundamentally rethink the design |
Targetable aspects: LAYOUT, COLOR_SCHEME, IMAGES, TEXT_FONT, TEXT_CONTENT
{
"projectId": "4044680601076201931",
"designSystem": {
"displayName": "Pulse Fitness",
"theme": {
"colorMode": "DARK",
"customColor": "#e11d48",
"headlineFont": "MONTSERRAT",
"bodyFont": "INTER",
"labelFont": "SPACE_GROTESK",
"roundness": "ROUND_EIGHT",
"colorVariant": "VIBRANT",
"designMd": "High-energy fitness brand. Bold headlines, dark backgrounds, racing red accents."
}
}
}
Color variants: MONOCHROME, NEUTRAL, TONAL_SPOT, VIBRANT, EXPRESSIVE, FIDELITY, CONTENT, RAINBOW, FRUIT_SALAD
Fonts (29): INTER, MONTSERRAT, GEIST, DM_SANS, IBM_PLEX_SANS, SORA, RUBIK, SPACE_GROTESK, PLUS_JAKARTA_SANS, WORK_SANS, MANROPE, LEXEND, PUBLIC_SANS, SPLINE_SANS, EPILOGUE, BE_VIETNAM_PRO, HANKEN_GROTESK, NUNITO_SANS, ARIMO, SOURCE_SANS_THREE, METROPOLIS, NEWSREADER, NOTO_SERIF, DOMINE, LIBRE_CASLON_TEXT, EB_GARAMOND, LITERATA, SOURCE_SERIF_FOUR
Roundness: ROUND_FOUR, ROUND_EIGHT, ROUND_TWELVE, ROUND_FULL
designMd: Free-form markdown describing design intent. Injected into AI context during generation.
Use the virtual tools for the simplest path:
get_screen_code -> returns HTML directly
get_screen_image -> returns screenshot as base64
Or download manually after get_screen:
curl -sL "$HTML_URL" -o .stitch/designs/page.html
curl -sL "${IMAGE_URL}=w1200" -o .stitch/designs/page.png
Append =w{width} to screenshot URLs for full resolution (CDN serves thumbnails by default).
Before calling any generation or editing tool, enhance the user's prompt.
.stitch/DESIGN.md file as the primary reference.list_design_systems to check if one is attached to the project.Replace vague terms with specific component names. See references/design-mappings.md.
| Vague | Professional | |:---|:---| | "menu at the top" | "sticky navigation bar with logo and list items" | | "big photo" | "hero section with full-width imagery" | | "list of things" | "responsive card grid with hover states" | | "popup" | "modal dialog with overlay and smooth entry animation" |
[Overall vibe, mood, and purpose of the page]
**PAGE STRUCTURE:**
1. **Header:** [Description of navigation and branding]
2. **Hero Section:** [Headline, subtext, and primary CTA]
3. **Primary Content Area:** [Detailed component breakdown]
4. **Footer:** [Links and copyright information]
When no design system is attached, add:
**DESIGN SYSTEM:**
- Platform: [Web/Mobile], [Desktop/Mobile]-first
- Theme: [Light/Dark]
- Palette: [Primary] (#hex), [Secondary] (#hex), [Background] (#hex)
- Style: [Roundness], [Shadow/Elevation], [Typography vibe]
After any generation or edit, always present the outputComponents (text description and suggestions) to the user.
Iterative multi-page site generation using a "baton" system.
.stitch/SITE.md file documenting site vision and roadmap.stitch/next-prompt.md---
page: about
---
A page describing how the product works with a clear value proposition.
**Page Structure:**
1. Header with navigation
2. Explanation of methodology
3. Team section with photos
4. Footer with links
.stitch/next-prompt.md for the page name and prompt.stitch/SITE.md for sitemap, roadmap, visiongenerate_screen_from_text or use CLI tool commandget_screen_code / get_screen_image virtual tools.stitch/next-prompt.md with next pagebuild_site for bulk generationIf you have multiple screens already generated, use build_site to map them all to routes at once:
pnpx @_davideast/stitch-mcp site -p <project-id> --routes '[
{"screenId": "abc", "route": "/"},
{"screenId": "def", "route": "/about"},
{"screenId": "ghi", "route": "/contact"}
]'
This generates a deployable Astro project with all screens mapped to routes.
project/
.stitch/
metadata.json # Stitch project & screen IDs
SITE.md # Site vision, sitemap, roadmap
next-prompt.md # Current task (the baton)
designs/ # Staging area for Stitch output
{page}.html
{page}.png
site/public/ # Production pages
next-prompt.md files locally before attempting risky redesigns or merging multiple generated screens into the main application.DESIGN.md is a dual-representation design system document following the google-labs-code/design.md specification. The file combines machine-readable design tokens (YAML front matter) with human-readable design rationale (markdown prose). Tokens give exact values. Prose tells why those values exist and how to apply them.
get_project + get_screen to synthesizeFeed content into the designMd field when calling create_design_system.
A DESIGN.md file has two layers:
--- fences at the top. Supported token schemas: colors, typography, rounded, spacing, components.## sections.Validate a DESIGN.md file, catch broken token references, and check WCAG contrast ratios using the official CLI:
npx @google/design.md lint DESIGN.md
---
name: Heritage
colors:
primary: "#1A1C1E"
secondary: "#6C7278"
tertiary: "#B8422E"
neutral: "#F7F5F2"
typography:
h1:
fontFamily: Public Sans
fontSize: 3rem
body-md:
fontFamily: Public Sans
fontSize: 1rem
label-caps:
fontFamily: Space Grotesk
fontSize: 0.75rem
rounded:
sm: 4px
md: 8px
spacing:
sm: 8px
md: 16px
---
## Overview
Architectural Minimalism meets Journalistic Gravitas. The UI evokes a premium matte finish — a high-end broadsheet or contemporary gallery.
## Colors
The palette is rooted in high-contrast neutrals and a single accent color.
- **Primary (#1A1C1E):** Deep ink for headlines and core text.
- **Secondary (#6C7278):** Sophisticated slate for borders, captions, metadata.
- **Tertiary (#B8422E):** "Boston Clay" — the sole driver for interaction.
- **Neutral (#F7F5F2):** Warm limestone foundation, softer than pure white.
## Typography
Headlines use semi-bold weight. Body text at 14-16px regular.
## Elevation
No shadows. Depth via border contrast and surface color variation.
## Components
- **Buttons**: Rounded (8px), primary uses brand blue fill, secondary uses outline
- **Inputs**: 1px border, surface-variant background, 12px padding
- **Cards**: No elevation, 1px outline border, 12px corner radius
## Do's and Don'ts
- Do use primary color only for the single most important action per screen
- Don't mix rounded and sharp corners in the same view
- Do maintain WCAG AA contrast ratios (4.5:1 for normal text)
- Don't use more than two font weights on a single screen
Stitch auto-generates named colors from base values: surface, on-primary, error, outline, etc., following Material color role conventions.
Stitch is a suite of specialized design engines, not one model.
| Mode | modelId | Best for |
|------|-----------|----------|
| Thinking with 3 Pro | GEMINI_3_1_PRO | Complex logic, production candidates. Slower but pixel-perfect. |
| Redesign (Nano Banana Pro) | (UI only) | Stylistic transforms, vibe design, modernizing old interfaces. |
| 2.5 Pro | (UI only) | High-fidelity HTML, A/B comparisons alongside 3 Pro. |
| Fast | GEMINI_3_FLASH | Rapid wireframing, Figma exports, quick iteration. |
Tip: Run the same prompt in Thinking 3 Pro and 2.5 Pro to compare. Use Fast for exploration, 3 Pro for finals.
Combine art-direction keywords from these categories:
Layout & Structure: Bento Grid, Editorial, Swiss Style, Split-Screen
Texture & Depth: Glassmorphism, Claymorphism, Skeuomorphic, Grainy/Noise
Atmosphere & Era: Brutalist, Cyberpunk, Y2K, Retro-Futurism
Color & Contrast: Duotone, Monochromatic, Pastel Goth, Dark Mode OLED
Starting a design:
Editing screens:
Theme control:
Variations (distinct from editing):
REFINE, merge elements from other optionsget_screen to check.GEMINI_3_PRO -- deprecated. Use GEMINI_3_FLASH or GEMINI_3_1_PRO.=w{width} to screenshot URLs before downloading (or use get_screen_image virtual tool)..stitch/next-prompt.md before completing.pnpx @_davideast/stitch-mcp tool <name> -d '{...}'STITCH_API_KEY=your-key pnpx @_davideast/stitch-mcp doctor
STITCH_API_KEY=your-key pnpx @_davideast/stitch-mcp doctor
t already exist in the sitemap.pnpx @_davideast/stitch-mcp tool <name> -d '{...}'STITCH_API_KEY=your-key pnpx @_davideast/stitch-mcp doctordevelopment
Sets up, configures, and optimizes Google Analytics 4 (GA4) properties. Evaluates websites for proper GA4 implementation, tracking codes, and configuration improvements. Uses the Google Analytics Admin API for programmatic setup or provides manual integration paths via gtag.js or Next.js Third Parties.
development
Open-source intelligence on people, companies, domains, and B2B accounts. Use when the user wants to investigate, vet, research, or build a dossier on a target — phrases like "OSINT", "due diligence", "background check", "research this person", "look into [company/domain]", "vet this prospect/vendor", "what does X do", "is this account worth pursuing", "find me a contact at", "who's the buyer for", or any open-source investigation task. Disambiguates identities before reporting and grades every claim by independent source count.
development
Generate, edit, describe, restyle, restore, thumbnail, and batch-process images using xAI (Grok) or OpenAI image APIs and GPT-4o vision. Default provider is xAI ($0.02/image flat rate). Use this skill whenever the user asks to generate, create, make, draw, or design an image or picture using AI, or wants to edit, modify, transform, restyle, composite, or inpaint an existing image. Also handles image description and alt-text generation, background removal, style transfer, photo restoration, thumbnail creation, and batch generation from JSON manifests. Trigger when the user mentions DALL-E, gpt-image, Grok image, xAI image, OpenAI image generation, or wants AI-generated visuals for any purpose (logos, mockups, illustrations, thumbnails, icons, concept art, memes). Also trigger for batch image generation, generating a set or series of images, processing multiple images from a manifest, or creating consistent image collections. If the user says "make me an image of...", "generate a picture", "edit this photo to...", "describe this image", "remove the background", "make this look like watercolor", "restore this old photo", "create a thumbnail", "generate a batch of images", or "process this image manifest", this is the skill to use.
testing
Agentic OS Orchestrator. Process and execute tasks from the shared .agent/state/tasks.json queue. Use when the user asks to 'check the queue', 'process tasks', or run the heartbeat.