跳到正文
cccskills
免费在 GitHub 公开

stitch::generate-design

Create and refine screen designs in Stitch from text descriptions or images. The skill clarifies layout requirements, edits existing screens, explores alternative designs, and saves HTML and screenshots for review.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

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.

查看安装方法

适用场景

  • Create a screen from a written brief
  • Turn a mockup image into a screen design
  • Refine specific parts of an existing screen
  • Compare alternative layouts and color schemes

包含的文件(4)

  • SKILL.md10.7 KB
  • examples/enhanced-prompt.md1.7 KB
  • references/design-mappings.md2.3 KB
  • references/prompt-keywords.md2.7 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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_projects to find the correct projectId. If no suitable project exists, create one using create_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 -o via run_command or similar.
  • Directory: Ensure .stitch/designs exists.

6. Review and Refine

  • If the result is not exactly as expected, continue with the Edit flow to make targeted adjustments.
  • Do NOT re-generate from scratch unless the fundamental layout is wrong.

Generate from Image Flow (Image/Mockup → Design)

Use this flow when the user provides an image, screenshot, or design mockup to recreate in Stitch.

1. Identify the Project

Use list_projects to find the correct projectId. If no suitable project exists, create one using create_project.

2. Upload the Image

Delegate to the upload-to-stitch skill to upload the image to the project. This creates a new screen with the image as its content.

3. Refine with Edit

Once uploaded, use list_screens to find the newly created screenId, then call edit_screens with a descriptive prompt to refine the design:

{
  "projectId": "...",
  "selectedScreenIds": ["<uploaded-screen-id>"],
  "prompt": "[Describe what to adjust, enhance, or recreate from this mockup]"
}

[!TIP] For best results, describe the intent behind the image rather than just saying "make it look like this". For example: "This is a dashboard mockup — recreate it with a proper data table, sidebar navigation, and chart widgets."

4. Present AI Feedback

Always show the text description and suggestions from outputComponents to the user.

5. Download Design Assets

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 -o via run_command or similar.
  • Directory: Ensure .stitch/designs exists.

Edit Flow (Modify Existing Screen)

1. Identify the Screen

Use list_screens or get_screen to find the correct projectId and screenId.

2. Formulate the Edit Prompt

Apply the Prompt Enhancement Pipeline, focusing on specificity:

  • Location: "Change the color of 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'."

3. Apply the Edit

Call the edit_screens tool.

{
  "projectId": "...",
  "selectedScreenIds": ["..."],
  "prompt": "[Your targeted edit prompt]"
}

4. Present AI Feedback

Always show the text description and suggestions from outputComponents to the user.

5. Download Design Assets

After editing, download the updated HTML and screenshot urls from outputComponents to the .stitch/designs directory, overwriting previous versions to ensure the local files reflect the latest edits.

  • Naming: Use the screen ID or a descriptive slug for the filename.
  • Tools: Use curl -o via run_command or similar.
  • Directory: Ensure .stitch/designs exists.

6. Update Project Metadata

After downloading assets, update .stitch/metadata.json to reflect any changes (e.g., updated screen titles or new screen IDs from the edit). The metadata file tracks all screens, their device types, and design system info. See the manage-design-system skill's examples/metadata.json for the format.

7. Verify and Repeat

  • Check the output screen to see if the changes were applied correctly.
  • If more polish is needed, repeat the edit flow with a new specific prompt.

Generate Variants Flow (Explore Variations)

Use this flow when the user wants to explore alternative layouts, color schemes, or content variations of an existing screen.

1. Identify the Screen

Use list_screens or get_screen to find the correct projectId and screenId.

2. Configure Variant Options

Call the generate_variants tool with the appropriate options:

{
  "projectId": "...",
  "selectedScreenIds": ["..."],
  "prompt": "[Describe the direction for variants]",
  "variantOptions": {
    "variantCount": 3,
    "creativeRange": "EXPLORE",
    "aspects": ["LAYOUT", "COLOR_SCHEME"]
  }
}

Variant Options:

  • variantCount: 1–5 variants (default: 3)
  • creativeRange: REFINE (subtle), EXPLORE (balanced), or REIMAGINE (radical)
  • aspects: Focus on specific dimensions — LAYOUT, COLOR_SCHEME, IMAGES, TEXT_FONT, TEXT_CONTENT, or leave empty for all

3. Present AI Feedback

Always show the text description and suggestions from outputComponents to the user.

4. Download Design Assets

Download the variant 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 -o via run_command or similar.
  • Directory: Ensure .stitch/designs exists.

💡 Tips

  • Be structural: Break the page down into header, hero, features, and footer in your prompt.
  • Content first: Describe what each section contains (text, images, CTAs) rather than how it looks.
  • Iterative Polish: Prefer editing for targeted adjustments over full re-generation.
  • No theme leakage: Never put hex codes, font names, or color roles in a generation prompt — the design system handles all visual styling.
  • Specify interactions: Mention hover states, animations, and click behavior rather than visual styling.
  • Keep edits focused: One edit at a time is often better than a long list of changes.
  • Reference components: Use professional terms like "navigation bar", "hero section", "footer", "card grid".
  • Precise colors in edits: Use hex codes for exact color matching when editing existing screens.

📚 References

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

design-md

免费

Analyze existing Stitch screens and document their colors, typography, components, and layout in DESIGN.md. The resulting design reference combines plain visual descriptions with precise color values to guide requests for new screens.

中文简介正在准备中。当前显示英语简介。

  • Document design rules from an existing screen
  • Prepare a design reference for new screen prompts
  • Record color codes and their functional roles
google-labs-code/stitch-skills85462026年8月18日 更新

Turn a rough interface idea into a structured prompt for Stitch, with clear page sections, colors, and component details. When available, existing design rules are included to guide consistent screens or focused edits.

中文简介正在准备中。当前显示英语简介。

  • Turn a rough screen idea into a clear prompt
  • Revise a prompt that produced an unsuitable design
  • Include existing design rules in a screen request
google-labs-code/stitch-skills85462026年8月18日 更新

Turn Stitch designs into React and Vite dashboards with reusable components and asynchronous data fetching. It applies shared design settings from DESIGN.md, includes accessibility checks, and supports optional blockchain data reads.

中文简介正在准备中。当前显示英语简介。

  • Build a React dashboard from a Stitch screen
  • Apply shared design settings from DESIGN.md
  • Add data fetching and loading states
google-labs-code/stitch-skills85462026年8月18日 更新

remotion

免费

Create walkthrough videos from Stitch app screens using Remotion. Arrange screenshots in sequence, add fades, slides, zoom effects, and explanatory text, then preview the timing and render a video such as an MP4.

中文简介正在准备中。当前显示英语简介。

  • Create an app introduction from Stitch screens
  • Explain a user journey through a sequence of screens
  • Highlight interface features with zoom and labels
google-labs-code/stitch-skills85462026年8月18日 更新

shadcn-ui

免费

Find, install, and customize shadcn/ui components for React applications. The skill guides project setup, theme changes, forms, dialogs, and dashboard layouts, with checks for keyboard access, screen reader support, and responsive behavior.

中文简介正在准备中。当前显示英语简介。

  • Add UI components to an existing React project
  • Customize themes and component variants
  • Build forms and dashboard layouts
google-labs-code/stitch-skills85462026年8月18日 更新

site-md

免费

Turn site requirements or existing content into a SITE.md project guide for the Stitch Build Loop. It records the site's purpose, visual direction, navigation, file structure, and prioritized tasks to guide successive development rounds.

中文简介正在准备中。当前显示英语简介。

  • Organize a site brief before development
  • Record site purpose and visual direction
  • List completed and planned pages
google-labs-code/stitch-skills85462026年8月18日 更新

查看 google-labs-code 的全部技能

报告此技能的问题