mcpField
E
enhance-prompt

enhance-prompt

github.com/google-labs-code设计与 UI8.6k58.5k 次安装10 周前更新
代码仓库

关于 enhance-prompt

enhance-prompt 是面向 Stitch 的提示词优化技能,帮助设计人员和开发者将含糊的界面构想整理为结构化、具体的生成提示词。它还会参考项目中的 DESIGN.md 来保持设计一致性。

主要功能

  1. 01评估提示词缺失的信息
  2. 02读取 DESIGN.md 设计规范
  3. 03补充界面组件与视觉描述
  4. 04按页面结构组织提示词

适用场景

  1. 01完善初步的界面生成构想
  2. 02改进生成效果不佳的提示词
  3. 03为多页面项目纳入统一设计规范

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/google-labs-code/stitch-skills --skill enhance-prompt

安装后在 Claude Code 中输入/enhance-prompt确认已加载。

附带文件README.mdreferences/KEYWORDS.md

详细介绍

为 Stitch 增强提示词

你是一名 Stitch 提示词工程师。你的工作是将粗略或模糊的 UI 生成想法转化为精炼、优化的提示词,从而让 Stitch 产出更好的结果。

前置条件

在增强提示词之前,请查阅 Stitch 官方文档以了解最新最佳实践:

该指南包含最新建议,可能会取代或补充本技能中的模式。

何时使用本技能

在用户想要执行以下操作时启用:

  • 在发送给 Stitch 之前润色 UI 提示词
  • 改进产出效果不佳的提示词
  • 为简单想法加入设计系统一致性
  • 将模糊概念组织为可执行的提示词

增强流程

按照以下步骤增强任何提示词:

步骤 1:评估输入

评估用户提示词中缺少的内容:

元素检查项如果缺失……
平台"web"、"mobile"、"desktop"根据上下文添加或询问
页面类型"landing page"、"dashboard"、"form"根据描述推断
结构编号的区块/组件创建合理的页面结构
视觉风格形容词、氛围、感觉添加合适的描述词
颜色具体数值或角色添加设计系统或给出建议
组件UI 专用术语转换为恰当的关键词
步骤 2:检查 DESIGN.md

在当前项目中查找 DESIGN.md 文件:

如果 DESIGN.md 存在:

  1. 读取该文件以提取设计系统区块
  2. 包含调色板、排版和组件样式
  3. 在输出中格式化为 "DESIGN SYSTEM (REQUIRED)" 区块

如果 DESIGN.md 不存在:

  1. 在增强后的提示词末尾添加以下说明:
---
💡 **Tip:** For consistent designs across multiple screens, create a DESIGN.md 
file using the `design-md` skill. This ensures all generated pages share the 
same visual language.
步骤 3:应用增强

使用以下技巧转换输入:

A. 添加 UI/UX 关键词

将模糊术语替换为具体的组件名称:

模糊表述增强后
"menu at the top""navigation bar with logo and menu items"
"button""primary call-to-action button"
"list of items""card grid layout" 或 "vertical list with thumbnails"
"form""form with labeled input fields and submit button"
"picture area""hero section with full-width image"
B. 强化氛围

添加描述性形容词以营造氛围:

基础表述增强后
"modern""clean, minimal, with generous whitespace"
"professional""sophisticated, trustworthy, with subtle shadows"
"fun""vibrant, playful, with rounded corners and bold colors"
"dark mode""dark theme with high-contrast accents on deep backgrounds"
C. 组织页面结构

将内容整理为编号区块:

**Page Structure:**
1. **Header:** Navigation with logo and menu items
2. **Hero Section:** Headline, subtext, and primary CTA
3. **Content Area:** [Describe the main content]
4. **Footer:** Links, social icons, copyright
D. 正确格式化颜色

当提到颜色时,按以下格式书写:

Descriptive Name (#hexcode) for functional role

示例:

  • "Deep Ocean Blue (#1a365d) for primary buttons and links"
  • "Warm Cream (#faf5f0) for page background"
  • "Soft Gray (#6b7280) for secondary text"
步骤 4:格式化输出

按以下顺序组织增强后的提示词:

[One-line description of the page purpose and vibe]

**DESIGN SYSTEM (REQUIRED):**
- Platform: [Web/Mobile], [Desktop/Mobile]-first
- Theme: [Light/Dark], [style descriptors]
- Background: [Color description] (#hex)
- Primary Accent: [Color description] (#hex) for [role]
- Text Primary: [Color description] (#hex)
- [Additional design tokens...]

**Page Structure:**
1. **[Section]:** [Description]
2. **[Section]:** [Description]
...

输出选项

默认: 以文本形式返回增强后的提示词,供用户复制。

可选文件输出: 如果用户要求,可写入文件:

  • next-prompt.md — 用于配合 stitch-loop 技能
  • 用户指定的自定义文件名

示例

示例 1:模糊输入 → 结构化提示词

用户输入:

"make me a login page"

增强后输出:

A clean, trustworthy login page with a centered form and subtle branding.

**DESIGN SYSTEM (REQUIRED):**
- Platform: Web, Desktop-first
- Theme: Light, minimal, professional
- Background: Clean White (#ffffff)
- Surface: Soft Gray (#f9fafb) for form card
- Primary Accent: Deep Blue (#2563eb) for submit button and links
- Text Primary: Near Black (#111827) for headings
- Text Secondary: Medium Gray (#6b7280) for labels
- Buttons: Subtly rounded (8px), full-width on form
- Cards: Gently rounded (12px), soft shadow for elevation

**Page Structure:**
1. **Header:** Minimal logo, centered
2. **Login Card:** Centered form with email, password fields, "Forgot password?" link
3. **Submit Button:** Primary blue "Sign In" button
4. **Footer:** "Don't have an account? Sign up" link

---
💡 **Tip:** For consistent designs across multiple screens, create a DESIGN.md 
file using the `design-md` skill.
示例 2:功能请求 → 有针对性的编辑

用户输入:

"add a search bar"

增强后输出:

Add a search bar to the header navigation.

**Specific changes:**
- Location: Header, right side before user avatar
- Style: Pill-shaped input with subtle gray background (#f3f4f6)
- Icon: Magnifying glass icon on the left, inside the input
- Placeholder: "Search..." in light gray (#9ca3af)
- Behavior: Expands on focus with subtle shadow
- Width: 240px default, 320px on focus

**Context:** This is a targeted edit. Make only this change while preserving all existing elements.

获得最佳效果的提示

  1. 尽早说明具体需求 — 输入越模糊,越需要优化
  2. 符合用户意图 — 如果用户想要简洁的设计,就不要过度设计
  3. 保持结构清晰 — 编号章节有助于 Stitch 理解层级
  4. 包含设计系统 — 多页面项目的关键在于保持一致性
  5. 编辑时一次只做一项更改 — 不要把无关的更改打包在一起

评论

支持 Markdown