stitch-mcp
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseStitch MCP
Stitch MCP
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:
- (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.
@_davideast/stitch-mcp - (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.
@google/stitch-sdk - Direct Stitch HTTP MCP: A direct connection for basic agent tool access when local CLI proxying isn't available.
您是Google Stitch的资深设计系统负责人兼提示工程师。您通过Stitch的AI驱动设计工具,将模糊的想法与精确的设计规范连接起来,帮助用户创建高保真、一致性的UI设计。
本技能采用混合方法:
- (面向Agent的首选工具):面向开发者的CLI和MCP代理。这是AI Agent的首选工具,因为它提供了用于本地服务、站点脚手架(Astro)和资产管理的高级「虚拟工具」。
@_davideast/stitch-mcp - (官方引擎):Google Labs推出的官方程序化库。用于编写自定义Node.js脚本,或将Stitch功能集成到您自己的应用程序中。
@google/stitch-sdk - 直接Stitch HTTP MCP:当本地CLI代理不可用时,用于基础Agent工具访问的直接连接。
Tooling Comparison
工具对比
| Feature | | |
|---|---|---|
| Primary Audience | AI Coding Agents (Claude, Gemini) | Application Developers |
| Local Serving | Yes ( | No |
| Site Scaffolding | Yes ( | No |
| Virtual Tools | Yes ( | No (raw API only) |
| Auth | OAuth Wizard ( | API Key / Manual |
Recommendation: For agent-driven development and local build loops, always use . 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.
@_davideast/stitch-mcp| 特性 | | |
|---|---|---|
| 主要受众 | AI编码Agent(Claude、Gemini) | 应用开发者 |
| 本地服务 | 支持( | 不支持 |
| 站点脚手架 | 支持( | 不支持 |
| 虚拟工具 | 支持( | 不支持(仅原生API) |
| 身份验证 | OAuth向导( | API密钥 / 手动配置 |
推荐方案:对于Agent驱动的开发和本地构建循环,始终使用****。它充当桥梁,允许Agent在本地「查看」和「构建」您的Stitch设计。仅当您需要编写自定义应用程序以程序化方式调用Stitch API时,才使用SDK。
@_davideast/stitch-mcpSetup
设置
MCP Connection (for agent tool access)
MCP连接(用于Agent工具访问)
Add the Stitch MCP server with your API key. For Claude Code:
bash
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):
json
{
"mcpServers": {
"stitch": {
"url": "https://stitch.googleapis.com/mcp",
"headers": { "X-Goog-Api-Key": "your-api-key" }
}
}
}添加带有您API密钥的Stitch MCP服务器。针对Claude Code:
bash
claude mcp add stitch -s user --transport http "https://stitch.googleapis.com/mcp" \
--header "X-Goog-Api-Key: your-api-key"针对其他MCP客户端(Cursor、VS Code、Gemini CLI):
json
{
"mcpServers": {
"stitch": {
"url": "https://stitch.googleapis.com/mcp",
"headers": { "X-Goog-Api-Key": "your-api-key" }
}
}
}Authentication
身份验证
API key (simplest):
bash
export STITCH_API_KEY="your-api-key"Get your key from Stitch Settings.
OAuth (guided wizard):
bash
pnpx @_davideast/stitch-mcp initHandles gcloud installation, OAuth, credentials, and MCP client config in one command.
API密钥(最简单方式):
bash
export STITCH_API_KEY="your-api-key"从Stitch设置页面获取您的密钥。
OAuth(引导式向导):
bash
pnpx @_davideast/stitch-mcp init一键处理gcloud安装、OAuth、凭据和MCP客户端配置。
Verify Setup
验证设置
bash
pnpx @_davideast/stitch-mcp doctor --verbosebash
pnpx @_davideast/stitch-mcp doctor --verboseQuick Reference
快速参考
| Intent | Approach | Command/Tool |
|---|---|---|
| List projects | CLI | |
| Browse screens | CLI | |
| Preview screens locally | CLI | |
| Build an Astro site | CLI | |
| Generate a screen | MCP tool | |
| Edit a screen | MCP tool | |
| Generate variants | MCP tool | |
| Get screen HTML | Virtual tool | |
| Get screen image | Virtual tool | |
| Build site from screens | Virtual tool | |
| Create design system | MCP tool | |
| Any MCP tool via CLI | CLI | |
| 需求 | 实现方式 | 命令/工具 |
|---|---|---|
| 列出项目 | CLI | |
| 浏览屏幕 | CLI | |
| 本地预览屏幕 | CLI | |
| 构建Astro站点 | CLI | |
| 生成屏幕 | MCP工具 | |
| 编辑屏幕 | MCP工具 | |
| 生成变体 | MCP工具 | |
| 获取屏幕HTML | 虚拟工具 | |
| 获取屏幕图片 | 虚拟工具 | |
| 从屏幕构建站点 | 虚拟工具 | |
| 创建设计系统 | MCP工具 | |
| 通过CLI调用任意MCP工具 | CLI | |
Platform Overview (March 2026)
平台概述(2026年3月)
Stitch uses an AI-native infinite canvas where multiple assets (images, text, code, UI screens) coexist in one workspace.
- 4 AI generation modes via :
modelId- -- Fast generation, lower cost (default for iteration)
GEMINI_3_FLASH - -- Highest quality, best for final screens
GEMINI_3_1_PRO - -- Deprecated. Do not use.
GEMINI_3_PRO
- 5 screens generated simultaneously per prompt
- Design systems are first-class -- create, update, list, and apply via MCP tools
- Variant generation -- explore alternatives with creative range control
- Device types: ,
DESKTOP,MOBILE,TABLETAGNOSTIC - Daily credit system for generation usage
Stitch采用AI原生无限画布,多个资产(图片、文本、代码、UI屏幕)共存于一个工作区中。
- 通过提供4种AI生成模式:
modelId- -- 生成速度快、成本低(迭代默认选项)
GEMINI_3_FLASH - -- 质量最高,适用于最终屏幕
GEMINI_3_1_PRO - -- 已弃用,请勿使用。
GEMINI_3_PRO
- 每个提示可同时生成5个屏幕
- 设计系统为一等公民 -- 通过MCP工具创建、更新、列出和应用设计系统
- 变体生成 -- 通过创意范围控制探索替代方案
- 设备类型:、
DESKTOP、MOBILE、TABLETAGNOSTIC - 生成使用量的每日信用额度系统
CLI Commands
CLI命令
The CLI gives agents bash-level access without depending on MCP tool availability. Use flags for machine-readable output.
--jsonCLI为Agent提供bash级别的访问权限,无需依赖MCP工具的可用性。使用标志获取机器可读输出。
--jsonBrowse Projects and Screens
浏览项目和屏幕
bash
undefinedbash
undefinedInteractive browser (human)
交互式浏览器(面向人类)
pnpx @_davideast/stitch-mcp view --projects
pnpx @_davideast/stitch-mcp view --projects
Inspect a screen
检查屏幕
pnpx @_davideast/stitch-mcp view --project <project-id> --screen <screen-id>
undefinedpnpx @_davideast/stitch-mcp view --project <project-id> --screen <screen-id>
undefinedPreview Screens Locally
本地预览屏幕
bash
undefinedbash
undefinedStart a Vite dev server with all project screens
启动Vite开发服务器,加载所有项目屏幕
pnpx @_davideast/stitch-mcp serve -p <project-id>
pnpx @_davideast/stitch-mcp serve -p <project-id>
Agent-friendly: list screens as JSON without starting server
面向Agent:以JSON格式列出屏幕,不启动服务器
pnpx @_davideast/stitch-mcp serve -p <project-id> --list-screens
pnpx @_davideast/stitch-mcp serve -p <project-id> --list-screens
Agent-friendly: start server and output JSON with URLs
面向Agent:启动服务器并输出包含URL的JSON
pnpx @_davideast/stitch-mcp serve -p <project-id> --json
undefinedpnpx @_davideast/stitch-mcp serve -p <project-id> --json
undefinedBuild an Astro Site from Screens
从屏幕构建Astro站点
bash
undefinedbash
undefinedInteractive route builder (human)
交互式路由构建器(面向人类)
pnpx @_davideast/stitch-mcp site -p <project-id>
pnpx @_davideast/stitch-mcp site -p <project-id>
Agent-friendly: list screens with suggested routes
面向Agent:列出屏幕并提供建议路由
pnpx @_davideast/stitch-mcp site -p <project-id> --list-screens
pnpx @_davideast/stitch-mcp site -p <project-id> --list-screens
Agent-friendly: generate site with explicit routes
面向Agent:使用明确路由生成站点
pnpx @_davideast/stitch-mcp site -p <project-id> --routes '[
{"screenId": "abc123", "route": "/"},
{"screenId": "def456", "route": "/about"}
]'
undefinedpnpx @_davideast/stitch-mcp site -p <project-id> --routes '[
{"screenId": "abc123", "route": "/"},
{"screenId": "def456", "route": "/about"}
]'
undefinedInvoke Any MCP Tool from CLI
从CLI调用任意MCP工具
bash
undefinedbash
undefinedList all available tools
列出所有可用工具
pnpx @_davideast/stitch-mcp tool
pnpx @_davideast/stitch-mcp tool
See a tool's schema
查看工具的 schema
pnpx @_davideast/stitch-mcp tool generate_screen_from_text -s
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"
}'
---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"
}'
---MCP Tools (via SDK or proxy)
MCP工具(通过SDK或代理)
The official provides a helper that exposes the same core tools as the proxy. Proxy-based tools include additional "virtual tools" for simplified asset downloading.
@google/stitch-sdkstitchTools()官方提供助手,暴露与代理相同的核心工具。基于代理的工具包含额外的「虚拟工具」,用于简化资产下载。
@google/stitch-sdkstitchTools()Standard Stitch Tools
标准Stitch工具
Project management:
- -- Create a new project. Args:
create_project{ title } - -- Get project details. Args:
get_project{ name: "projects/<id>" } - -- List all projects. Args:
list_projectsor{}{ filter: "view=owned" }
Screen management:
- -- List screens in a project. Args:
list_screens{ projectId } - -- Get screen details + download URLs. Args:
get_screen{ name, projectId, screenId }
Generation:
- -- Generate a screen from prompt. Args:
generate_screen_from_text{ projectId, prompt, deviceType?, modelId? } - -- Edit existing screens. Args:
edit_screens{ projectId, selectedScreenIds, prompt, modelId? } - -- Generate design variants. Args:
generate_variants{ projectId, selectedScreenIds, prompt, variantOptions }
Design systems:
- -- Create and attach a design system
create_design_system - -- Update an existing design system
update_design_system - -- List design systems for a project
list_design_systems - -- Apply a design system to screens
apply_design_system
项目管理:
- -- 创建新项目。参数:
create_project{ title } - -- 获取项目详情。参数:
get_project{ name: "projects/<id>" } - -- 列出所有项目。参数:
list_projects或{}{ filter: "view=owned" }
屏幕管理:
- -- 列出项目中的屏幕。参数:
list_screens{ projectId } - -- 获取屏幕详情+下载URL。参数:
get_screen{ name, projectId, screenId }
生成功能:
- -- 通过提示生成屏幕。参数:
generate_screen_from_text{ projectId, prompt, deviceType?, modelId? } - -- 编辑现有屏幕。参数:
edit_screens{ projectId, selectedScreenIds, prompt, modelId? } - -- 生成设计变体。参数:
generate_variants{ projectId, selectedScreenIds, prompt, variantOptions }
设计系统:
- -- 创建并附加设计系统
create_design_system - -- 更新现有设计系统
update_design_system - -- 列出项目的设计系统
list_design_systems - -- 将设计系统应用于屏幕
apply_design_system
Virtual Tools (added by proxy)
虚拟工具(代理新增)
These combine multiple API calls into single operations:
get_screen_codeget_screen_imagebuild_sitejson
{
"projectId": "123456",
"routes": [
{ "screenId": "abc", "route": "/" },
{ "screenId": "def", "route": "/about" }
]
}这些工具将多个API调用合并为单一操作:
get_screen_codeget_screen_imagebuild_sitejson
{
"projectId": "123456",
"routes": [
{ "screenId": "abc", "route": "/" },
{ "screenId": "def", "route": "/about" }
]
}Generation
生成功能
Generate a Screen
生成屏幕
json
{
"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 to check later.
get_screen| Use case | Model |
|---|---|
| Rapid iteration, drafts | |
| Final screens, high-fidelity | |
| Quick edits | |
json
{
"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"
}生成可能需要几分钟。超时后请勿重试——生成仍可能成功。稍后使用检查状态。
get_screen| 使用场景 | 模型 |
|---|---|
| 快速迭代、草稿 | |
| 最终屏幕、高保真 | |
| 快速编辑 | |
Edit a Screen
编辑屏幕
json
{
"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:
- One focused change per call produces better results
- Reference components by name: "navigation bar", "hero section", "card grid"
- Include hex codes for precise color matching
- Say "Keep everything else the same" to prevent unwanted changes
json
{
"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"
}提示:
- 每次调用只做一个重点更改,效果更好
- 通过名称引用组件:「导航栏」、「Hero区域」、「卡片网格」
- 包含十六进制代码以实现精确颜色匹配
- 说明「保持其他所有内容不变」以防止不必要的更改
Generate Variants
生成变体
json
{
"projectId": "4044680601076201931",
"selectedScreenIds": ["98b50e2ddc9943efb387052637738f61"],
"prompt": "Explore alternative layouts for the hero section",
"variantOptions": {
"variantCount": 3,
"creativeRange": "EXPLORE",
"aspects": ["LAYOUT", "COLOR_SCHEME"]
}
}| Range | Behavior |
|---|---|
| Subtle refinements, closely adhering to the original |
| Balanced exploration (default) |
| Radical explorations that fundamentally rethink the design |
Targetable aspects: , , , ,
LAYOUTCOLOR_SCHEMEIMAGESTEXT_FONTTEXT_CONTENTjson
{
"projectId": "4044680601076201931",
"selectedScreenIds": ["98b50e2ddc9943efb387052637738f61"],
"prompt": "Explore alternative layouts for the hero section",
"variantOptions": {
"variantCount": 3,
"creativeRange": "EXPLORE",
"aspects": ["LAYOUT", "COLOR_SCHEME"]
}
}| 范围 | 行为 |
|---|---|
| 细微调整,严格遵循原始设计 |
| 平衡探索(默认) |
| 彻底探索,从根本上重新思考设计 |
可定位的维度: 、、、、
LAYOUTCOLOR_SCHEMEIMAGESTEXT_FONTTEXT_CONTENTDesign System Management
设计系统管理
json
{
"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: , , , , , , , ,
MONOCHROMENEUTRALTONAL_SPOTVIBRANTEXPRESSIVEFIDELITYCONTENTRAINBOWFRUIT_SALADFonts (29): , , , , , , , , , , , , , , , , , , , , , , , , , , ,
INTERMONTSERRATGEISTDM_SANSIBM_PLEX_SANSSORARUBIKSPACE_GROTESKPLUS_JAKARTA_SANSWORK_SANSMANROPELEXENDPUBLIC_SANSSPLINE_SANSEPILOGUEBE_VIETNAM_PROHANKEN_GROTESKNUNITO_SANSARIMOSOURCE_SANS_THREEMETROPOLISNEWSREADERNOTO_SERIFDOMINELIBRE_CASLON_TEXTEB_GARAMONDLITERATASOURCE_SERIF_FOURRoundness: , , ,
ROUND_FOURROUND_EIGHTROUND_TWELVEROUND_FULLdesignMd: Free-form markdown describing design intent. Injected into AI context during generation.
json
{
"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."
}
}
}颜色变体: 、、、、、、、、
MONOCHROMENEUTRALTONAL_SPOTVIBRANTEXPRESSIVEFIDELITYCONTENTRAINBOWFRUIT_SALAD字体(共29种): 、、、、、、、、、、、、、、、、、、、、、、、、、、、
INTERMONTSERRATGEISTDM_SANSIBM_PLEX_SANSSORARUBIKSPACE_GROTESKPLUS_JAKARTA_SANSWORK_SANSMANROPELEXENDPUBLIC_SANSSPLINE_SANSEPILOGUEBE_VIETNAM_PROHANKEN_GROTESKNUNITO_SANSARIMOSOURCE_SANS_THREEMETROPOLISNEWSREADERNOTO_SERIFDOMINELIBRE_CASLON_TEXTEB_GARAMONDLITERATASOURCE_SERIF_FOUR圆角程度: 、、、
ROUND_FOURROUND_EIGHTROUND_TWELVEROUND_FULLdesignMd: 描述设计意图的自由格式markdown。在生成过程中注入AI上下文。
Downloading Assets
下载资产
Use the virtual tools for the simplest path:
get_screen_code -> returns HTML directly
get_screen_image -> returns screenshot as base64Or download manually after :
get_screenbash
curl -sL "$HTML_URL" -o .stitch/designs/page.html
curl -sL "${IMAGE_URL}=w1200" -o .stitch/designs/page.pngAppend to screenshot URLs for full resolution (CDN serves thumbnails by default).
=w{width}使用虚拟工具是最简单的方式:
get_screen_code -> 直接返回HTML
get_screen_image -> 返回base64格式的截图或者在调用后手动下载:
get_screenbash
curl -sL "$HTML_URL" -o .stitch/designs/page.html
curl -sL "${IMAGE_URL}=w1200" -o .stitch/designs/page.png在截图URL后追加以获取全分辨率图片(CDN默认提供缩略图)。
=w{width}Prompt Enhancement Pipeline
提示优化流程
Before calling any generation or editing tool, enhance the user's prompt.
在调用任何生成或编辑工具之前,优化用户的提示。
1. Check for Design System Context
1. 检查设计系统上下文
- Check for a local file as the primary reference.
.stitch/DESIGN.md - Use to check if one is attached to the project.
list_design_systems - If a design system exists, its tokens are already applied. Only repeat in the prompt if overriding.
- If none exists, always include the design system block in the prompt.
- 检查本地文件作为主要参考。
.stitch/DESIGN.md - 使用检查项目是否已附加设计系统。
list_design_systems - 如果设计系统已存在,其标记已自动应用。仅当需要覆盖时才在提示中重复。
- 如果不存在设计系统,务必在提示中包含设计系统块。
2. Refine UI/UX Terminology
2. 优化UI/UX术语
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" |
将模糊术语替换为具体组件名称。请参阅references/design-mappings.md。
| 模糊表述 | 专业表述 |
|---|---|
| "顶部菜单" | "带有标志和列表项的粘性导航栏" |
| "大图片" | "带有全宽图像的Hero区域" |
| "事物列表" | "带有悬停状态的响应式卡片网格" |
| "弹窗" | "带有遮罩和平滑进入动画的模态对话框" |
3. Structure the Final Prompt
3. 构建最终提示
markdown
[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:
markdown
**DESIGN SYSTEM:**
- Platform: [Web/Mobile], [Desktop/Mobile]-first
- Theme: [Light/Dark]
- Palette: [Primary] (#hex), [Secondary] (#hex), [Background] (#hex)
- Style: [Roundness], [Shadow/Elevation], [Typography vibe]markdown
[页面的整体氛围、情绪和用途]
**页面结构:**
1. **页眉:** [导航和品牌描述]
2. **Hero区域:** [标题、副标题和主要CTA]
3. **主要内容区域:** [详细组件分解]
4. **页脚:** [链接和版权信息]当未附加设计系统时,添加:
markdown
**设计系统:**
- 平台:[Web/移动],[桌面/移动]优先
- 主题:[浅色/深色]
- 调色板:[主色] (#十六进制),[辅助色] (#十六进制),[背景色] (#十六进制)
- 风格:[圆角程度],[阴影/层级],[排版风格]4. Surface AI Feedback
4. 展示AI反馈
After any generation or edit, always present the (text description and suggestions) to the user.
outputComponents在任何生成或编辑操作后,务必向用户展示(文本描述和建议)。
outputComponentsBuild Loop
构建循环
Iterative multi-page site generation using a "baton" system.
使用「接力棒」系统进行迭代式多页面站点生成。
Prerequisites
前提条件
- A Stitch project
- A file documenting site vision and roadmap
.stitch/SITE.md
- 一个Stitch项目
- 记录站点愿景和路线图的文件
.stitch/SITE.md
The Baton: .stitch/next-prompt.md
.stitch/next-prompt.md接力棒:.stitch/next-prompt.md
.stitch/next-prompt.mdmarkdown
---
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 linksmarkdown
---
page: about
---
描述产品工作原理并明确价值主张的页面。
**页面结构:**
1. 带有导航的页眉
2. 方法说明
3. 带有照片的团队区域
4. 带有链接的页脚Execution Protocol
执行流程
- Read the baton -- Parse for the
.stitch/next-prompt.mdname and promptpage - Consult context -- Read for sitemap, roadmap, vision
.stitch/SITE.md - Generate -- Call or use CLI
generate_screen_from_textcommandtool - Download -- Use /
get_screen_codevirtual toolsget_screen_image - Integrate -- Move to site directory, wire navigation, fix asset paths
- Update SITE.md -- Mark page complete
- Write next baton -- Update with next page
.stitch/next-prompt.md
- 读取接力棒 -- 解析中的
.stitch/next-prompt.md名称和提示page - 查阅上下文 -- 读取获取站点地图、路线图和愿景
.stitch/SITE.md - 生成 -- 调用或使用CLI
generate_screen_from_text命令tool - 下载 -- 使用/
get_screen_code虚拟工具get_screen_image - 集成 -- 移动到站点目录,连接导航,修复资产路径
- 更新SITE.md -- 标记页面已完成
- 编写下一个接力棒 -- 更新为下一个页面
.stitch/next-prompt.md
Alternative: Use build_site
for bulk generation
build_site替代方案:使用build_site
批量生成
build_siteIf you have multiple screens already generated, use to map them all to routes at once:
build_sitebash
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.
如果已生成多个屏幕,使用一次性将所有屏幕映射到路由:
build_sitebash
pnpx @_davideast/stitch-mcp site -p <project-id> --routes '[
{"screenId": "abc", "route": "/"},
{"screenId": "def", "route": "/about"},
{"screenId": "ghi", "route": "/contact"}
]'这会生成一个可部署的Astro项目,所有屏幕都已映射到路由。
File Structure
文件结构
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 pagesproject/
.stitch/
metadata.json # Stitch项目和屏幕ID
SITE.md # 站点愿景、地图、路线图
next-prompt.md # 当前任务(接力棒)
designs/ # Stitch输出的暂存区
{page}.html
{page}.png
site/public/ # 生产页面Agentic Workflow & Vibe Coding
Agent工作流与氛围编码
- Iterative Design: Do not expect pixel-perfect UI on the first generation. Draft a V1 screen, review the HTML/image output, isolate specific layout or styling issues, refine exactly ONE variable (e.g., color, padding, or prompt phrasing) at a time, and regenerate until it matches the design intent.
- Vibe Coding: Commit your working HTML/CSS states and files locally before attempting risky redesigns or merging multiple generated screens into the main application.
next-prompt.md
- 迭代设计:不要期望第一次生成就能得到像素级完美的UI。起草V1屏幕,查看HTML/图像输出,找出特定布局或样式问题,每次精确优化一个变量(例如颜色、内边距或提示措辞),重新生成直到符合设计意图。
- 氛围编码:在尝试风险较大的重新设计或将多个生成屏幕合并到主应用之前,将您的工作HTML/CSS状态和文件提交到本地。
next-prompt.md
DESIGN.md (Official Spec)
DESIGN.md(官方规范)
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.
DESIGN.md是遵循google-labs-code/design.md规范的双重表示设计系统文档。该文件结合了机器可读的设计标记(YAML前置内容)和人类可读的设计原理(markdown正文)。标记提供精确值,正文说明这些值存在的原因以及如何应用。
Creating a DESIGN.md
创建DESIGN.md
- From concept -- Describe aesthetic intent; generate YAML tokens and markdown
- From existing brand -- Provide URL or image; extract palette, typography
- From existing project -- Use +
get_projectto synthesizeget_screen
Feed content into the field when calling .
designMdcreate_design_system- 从概念出发 -- 描述美学意图;生成YAML标记和markdown
- 从现有品牌出发 -- 提供URL或图片;提取调色板、排版
- 从现有项目出发 -- 使用+
get_project进行合成get_screen
调用时,将内容输入到字段中。
create_design_systemdesignMdFile Structure & Validation
文件结构与验证
A DESIGN.md file has two layers:
- YAML front matter — Machine-readable design tokens, delimited by fences at the top. Supported token schemas:
---,colors,typography,rounded,spacing.components - Markdown body — Human-readable rationale organized into sections.
##
Validate a DESIGN.md file, catch broken token references, and check WCAG contrast ratios using the official CLI:
bash
npx @google/design.md lint DESIGN.mdDESIGN.md文件包含两层:
- YAML前置内容 — 机器可读的设计标记,顶部由分隔。支持的标记模式:
---、colors、typography、rounded、spacing。components - markdown正文 — 人类可读的原理,按章节组织。
##
使用官方CLI验证DESIGN.md文件,捕获损坏的标记引用,并检查WCAG对比度:
bash
npx @google/design.md lint DESIGN.mdOfficial Format Example
官方格式示例
markdown
---
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
---markdown
---
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.
建筑极简主义与新闻庄重感相结合。UI唤起高端哑光质感——如同高端报纸或当代画廊。
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.
调色板基于高对比度中性色和单一强调色。
- 主色(#1A1C1E):深邃墨色,用于标题和核心文本。
- 辅助色(#6C7278):精致灰蓝色,用于边框、说明文字、元数据。
- 强调色(#B8422E):「波士顿红土色」——唯一的交互驱动色。
- 中性色(#F7F5F2):暖石灰岩底色,比纯白色更柔和。
Typography
排版
Headlines use semi-bold weight. Body text at 14-16px regular.
标题使用半粗体字重。正文为14-16px常规字重。
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
- 按钮:圆角(8px),主按钮使用品牌蓝色填充,次要按钮使用轮廓样式
- 输入框:1px边框,表面变体背景,12px内边距
- 卡片:无层级,1px轮廓边框,12px圆角
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.
---- 每个屏幕仅将主色用于最重要的单个操作
- 同一视图中不要混合圆角和尖角
- 务必保持WCAG AA对比度(普通文本4.5:1)
- 单个屏幕上不要使用超过两种字重
Stitch会根据基础值自动生成**命名颜色**:`surface`、`on-primary`、`error`、`outline`等,遵循Material颜色角色约定。
---Design Modes
设计模式
Stitch is a suite of specialized design engines, not one model.
| Mode | | Best for |
|---|---|---|
| Thinking with 3 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 | | 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.
Stitch是一套专门的设计引擎,而非单一模型。
| 模式 | | 最佳用途 |
|---|---|---|
| Thinking with 3 Pro | | 复杂逻辑、生产候选版本。速度较慢但像素级完美。 |
| Redesign (Nano Banana Pro) | (仅UI) | 风格转换、氛围设计、旧界面现代化。 |
| 2.5 Pro | (仅UI) | 高保真HTML,与3 Pro进行A/B对比。 |
| Fast | | 快速线框、Figma导出、快速迭代。 |
提示: 在Thinking 3 Pro和2.5 Pro中运行相同提示进行对比。使用Fast进行探索,3 Pro用于最终版本。
Style Word Bank (for Redesign mode)
风格词汇库(适用于Redesign模式)
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
结合以下类别的艺术指导关键词:
布局与结构: Bento Grid、Editorial、Swiss Style、Split-Screen
纹理与深度: Glassmorphism、Claymorphism、Skeuomorphic、Grainy/Noise
氛围与时代: Brutalist、Cyberpunk、Y2K、Retro-Futurism
颜色与对比度: Duotone、Monochromatic、Pastel Goth、Dark Mode OLED
Official Prompting Best Practices
官方提示最佳实践
Starting a design:
- Begin with a broad concept OR specific core functionalities
- Use adjectives to set vibe: "vibrant and encouraging" vs "minimalist and focused"
Editing screens:
- Make one major change at a time
- Be specific: target the exact element, screen, and visual change
- Example: "Change primary CTA button on login to larger size using brand primary blue"
Theme control:
- Colors: specific hex ("change primary to forest green") or mood-based ("warm, inviting palette")
- Fonts/Borders: "playful sans-serif font", "fully rounded button corners"
- Images: be specific about location and content
Variations (distinct from editing):
- For "what if" exploration, not incremental refinement
- Make big swings -- combine theme + layout changes
- Can run variations on top of a variation
- Pick best base, lower to , merge elements from other options
REFINE
启动设计:
- 从宽泛概念或特定核心功能开始
- 使用形容词设定氛围:「充满活力且鼓舞人心」 vs 「极简且专注」
编辑屏幕:
- 每次只做一个重大更改
- 务必具体:定位精确的元素、屏幕和视觉变化
- 示例:「将登录页面上的主CTA按钮改为更大尺寸,使用品牌主蓝色」
主题控制:
- 颜色:具体十六进制值(「将主色改为森林绿」)或基于氛围(「温暖、诱人的调色板」)
- 字体/边框:「俏皮的无衬线字体」、「完全圆角的按钮」
- 图片:明确说明位置和内容
变体(与编辑不同):
- 用于「假设」探索,而非增量优化
- 做出大幅调整——结合主题+布局更改
- 可以在变体之上再生成变体
- 选择最佳基础版本,将范围降至,合并其他选项的元素
REFINE
Common Pitfalls
常见陷阱
- Do not retry generation on timeout -- it may still succeed. Use to check.
get_screen - Do not use -- deprecated. Use
GEMINI_3_PROorGEMINI_3_FLASH.GEMINI_3_1_PRO - Append to screenshot URLs before downloading (or use
=w{width}virtual tool).get_screen_image - Keep edits focused. One change per call produces better results.
- In the build loop, always update before completing.
.stitch/next-prompt.md - Do not recreate pages that already exist in the sitemap.
- If MCP tools are unavailable, use the CLI fallback:
pnpx @_davideast/stitch-mcp tool <name> -d '{...}' - To diagnose auth issues:
STITCH_API_KEY=your-key pnpx @_davideast/stitch-mcp doctort already exist in the sitemap.STITCH_API_KEY=your-key pnpx @_davideast/stitch-mcp doctor - If MCP tools are unavailable, use the CLI fallback:
pnpx @_davideast/stitch-mcp tool <name> -d '{...}' - To diagnose auth issues:
STITCH_API_KEY=your-key pnpx @_davideast/stitch-mcp doctor
- 超时后请勿重试生成——它仍可能成功。使用检查状态。
get_screen - 请勿使用——已弃用。使用
GEMINI_3_PRO或GEMINI_3_FLASH。GEMINI_3_1_PRO - 下载前在截图URL后追加(或使用
=w{width}虚拟工具)。get_screen_image - 保持编辑聚焦。每次调用一个更改效果更好。
- 在构建循环中,完成前务必更新。
.stitch/next-prompt.md - 不要重新创建站点地图中已存在的页面。
- 如果MCP工具不可用,使用CLI回退方案:
pnpx @_davideast/stitch-mcp tool <name> -d '{...}' - 诊断身份验证问题:
STITCH_API_KEY=your-key pnpx @_davideast/stitch-mcp doctor