stitch::generate-design
它能做什么
这项技能根据文字描述或图片,在 Google Stitch 中生成和编辑应用或网站页面。适合需要快速制作界面样稿的设计师和产品团队。
适用场景
- ✓当你想根据描述生成一个新的应用或网站页面的时候。
- ✓当你想用清晰的指令修改现有的 Stitch 页面时。
- ✓当你想要几种设计变体进行比较的时候。
技能链接
https://github.com/google-labs-code/stitch-skills/blob/main/plugins/stitch-design/skills/generate-design/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请为一个移动端健身追踪器的首页创建 Stitch 页面,布局要简洁现代。”
每周 5 个新技能,1 分钟读完。
工作原理
它把你的请求改写为精确的设计术语,检查项目的设计系统,然后请求 Stitch 生成或编辑页面。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Generate Design
Create new design screens from text descriptions, images, or mockups, edit existing screens with prompts and design system tokens, and generate design variants using Stitch MCP.
[!NOTE] Refer to your system prompt for instruction on handling MCP tool prefixes for all tools mentioned in this skill (e.g.,
list_projects,generate_screen_from_text,edit_screens).
🎨 Prompt Enhancement Pipeline
Before calling any Stitch generation or editing tool, you MUST enhance the user's prompt.
1. Analyze Context
- Project: Use
list_projectsto find the correctprojectId. If no suitable project exists, create one usingcreate_project. - Design System: Check if a design system exists for the project via
list_design_systems. If one exists, design tokens (colors, fonts, roundness) are already applied at the project level — do NOT include any color, font, or theme instructions in the generation prompt. If none exists, delegate to the manage-design-system skill first before generating screens.
2. Refine UI/UX Terminology
Consult Design Mappings to replace vague terms.
- Vague: "Make a nice header"
- Professional: "Sticky navigation bar with glassmorphism effect and centered logo"
Use Prompting Keywords for component names, adjective palettes, color roles, and shape descriptions.
3. Structure the Final Prompt
Format the enhanced prompt for Stitch. Focus exclusively on layout, content, and structure — never include colors, fonts, or theme instructions (these are handled by the manage-design-system skill at the project level).
For new screens, use this template:
[Overall purpose and user intent of the page]
**PLATFORM:** [Web/Mobile], [Desktop/Mobile]-first
**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]
For edits, be specific about what to change:
- Location: "Change the [primary button] in the [hero section]..."
- Visuals: "...to a darker blue (#004080) and add a subtle shadow."
- Structure: "Add a secondary button next to the primary one with the text 'Learn More'."
[!CAUTION] Do NOT include hex codes, font names, color palettes, roundness values, or any design system tokens in a generation prompt. These are applied at the project level by the manage-design-system skill and will conflict if duplicated. (For edit prompts, hex codes are acceptable for precise color adjustments.)
4. Present AI Insights
After any tool call, always surface the outputComponents (Text Description and
Suggestions) to the user.
See examples/enhanced-prompt.md for a full before/after prompt enhancement example.
Steps
Determine the Mode
Decide which flow to use based on the user's request:
- User wants to create from a text description → Generate from Text flow
- User provides an image, screenshot, or mockup → Generate from Image flow
- User wants to modify an existing screen → Edit flow
- User wants layout/color/content variations → Generate Variants flow
Generate from Text Flow (New Screen)
1. Enhance the User Prompt
Apply the Prompt Enhancement Pipeline above.
2. Identify the Project
Use list_projects to find the correct projectId if it is not already known.
3. Generate the Screen
Call the generate_screen_from_text tool with the enhanced prompt and the
designSystem ID (if found in Step 1).
{
"projectId": "...",
"prompt": "[Your Enhanced Prompt]",
"designSystem": "assets/...", // Optional: Pass if found in Step 1
"deviceType": "DESKTOP" // Options: MOBILE, DESKTOP, TABLET
}
4. Present AI Feedback
Always show the text description and suggestions from outputComponents to the
user.
5. Download Design Assets
After generation, download the HTML and screenshot urls from outputComponents
to the .stitch/designs directory.
- Naming: Use the screen ID or a descriptive slug for the filename.
- Tools: Use
curl -oviarun_commandor similar. - Directory: Ensure
.stitch/designsexists.
6. Review and Refine
- If th
常见问题
它会替我选择颜色吗?
如果项目有设计系统,颜色和字体会取自设计系统,因此提示中不再重复这些内容。
如果没有设计系统怎么办?
这项技能会引导你先使用设计系统技能创建一个,然后再生成页面。
它可以从图片开始吗?
可以。这项技能可以根据文字或图片生成新页面。
详情
作者的原始描述
Generate new screens from text prompts or images, edit existing screens with prompts and design system tokens, and generate design variants using Stitch MCP. Includes prompt enhancement pipeline, design mappings, professional UI/UX terminology, design tokens and theme system capabilities.
热度
- GitHub 星标
- 8.7k
- 排名
- #12344
- 许可证
- Apache-2.0
- 更新时间
- 2026/8/17
评论
- …
同一仓库的更多技能
stitch::react-components
8.7k帮你的智能体把 Stitch 设计转换为 React 和 Vite 组件,或更新现有组件以匹配最新设计,并进行检查。
stitch::react-native
8.7k帮你的智能体把 Stitch 网页设计转换为手机应用用的 React Native 组件,或更新现有的移动端界面以匹配较新的设计。
react-vite-dashboard
8.7k帮你的智能体根据 Stitch 设计构建数据密集型的 React 和 Vite 仪表盘,使用 TanStack Query,并从 DESIGN.md 文件中读取设计令牌。
shadcn-ui
8.7k帮你的智能体查找、安装并自定义 shadcn/ui 组件,这是一组使用 Radix 或 Base UI 以及 Tailwind CSS 构建、可直接复制到项目中的界面组件。