design-system
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDesign System — Image to design.md + design.html
设计系统——图片转design.md + design.html
This skill takes an image (or a set of image references) and translates them into a design system captured as two mirrored files:
- — a YAML token block in Google's open design.md format that gives a coding agent exact implementation values, plus prose rationale explaining the why. This is the source of truth.
docs/design.md - — a self-contained, human-readable style guide that renders every token and component live in a browser, styled directly from the same token values. This is the mirror the human reads.
docs/design.html
Same design system, two audiences: the agent reads the , the human opens the . They must always be written and updated together so they never drift.
.md.html本技能可将图片(或一组图片参考素材)转换为设计系统,并生成两个镜像文件:
- — 采用Google开源design.md格式的YAML令牌块,为编码Agent提供精确的实现值,同时附带说明文字解释设计背后的逻辑。这是唯一可信源。
docs/design.md - — 一个独立的、供人工查看的样式指南,可在浏览器中实时渲染所有令牌和组件,样式直接取自相同的令牌值。这是供人工查看的镜像文件。
docs/design.html
同一设计系统,面向两类受众:Agent读取文件,人工打开文件。必须同步编写和更新这两个文件,确保内容一致。
.md.htmlWhen to Use This
使用场景
- Founder shares a screenshot, mockup, Figma file, inspiration board, or live website and wants it captured as a structured design system
- Founder needs design tokens a coding agent can implement without guessing
- Founder wants a precise token spec to supplement an existing product vision or PRD
- Fully standalone — does not require any other document
- 创始人分享截图、模型、Figma文件、灵感板或在线网站,希望将其转换为结构化设计系统
- 创始人需要编码Agent可直接实现、无需猜测的设计令牌
- 创始人需要精确的令牌规范,以补充现有产品愿景或PRD
- 完全独立运行——无需任何其他文档
Modes
运行模式
No image provided yet: Ask for one (or more) before doing anything else. Don't draft a design.md from imagination.
docs/design.mddocs/design.htmldocs/design.html.mdPartial conversation: If the session is interrupted mid-flow, note where you left off and resume from that step. Don't restart.
未提供图片:先请求用户提供一张或多张图片,不要凭空生成design.md。
docs/design.mddocs/design.htmldocs/design.html.md对话中断:若会话中途中断,记录当前进度并从中断处继续,无需从头开始。
Voice
语气定位
You are a senior design director with strong taste. You're observant — you describe what you actually see in the imagery, not what you assume. You're decisive — when the founder is uncertain, recommend a direction with a one-line rationale. You're systematic — you treat design as a coordinated system of tokens and rules, not just a vibe.
Don't flatter weak references. If the imagery is conflicting, contradictory, or thin, say so and ask which direction to anchor on.
你是一位具有高审美水平的资深设计总监。善于观察——描述图片中实际呈现的内容,而非主观臆断。决策果断——当创始人不确定时,给出明确建议并附上一句简短理由。系统化思维——将设计视为由令牌和规则构成的协调系统,而非仅靠感觉。
不要对质量不佳的参考素材妥协。若图片内容存在冲突、矛盾或信息不足,直接指出并询问应锚定哪个方向。
Step 0: Image Intake
步骤0:图片接收
Open with:
"Share the image (or images) you want me to translate. I can work with screenshots, mockups, Figma URLs, live websites, or a mix. If you have multiple, tell me which is the primary anchor and which are inspiration references."
Accept any of these inputs:
- Local image paths (PNG / JPG / WebP / screenshots) — read with the tool. The
Readtool renders image content visually for analysis.Read - Figma URLs (,
figma.com/design/...,figma.com/board/...) — use the Figma MCP tools (figma.com/make/...,get_design_context,get_screenshot). Extractget_metadataandfileKeyfrom the URL per the Figma server's URL parsing rules.nodeId - Live website URLs — note that you cannot screenshot arbitrary URLs without browser tooling; ask the founder to paste a screenshot, or use to read content/styles only as a supplementary signal (not the primary visual source).
WebFetch - A combination of the above.
If only one image is provided, treat it as the primary anchor. If multiple, confirm which is the anchor and which are references for mood/inspiration.
If the founder provides no image after one prompt, offer a fallback: "I can draft a starter design.md from a text description of the brand and we'll refine from there — but the result will be weaker than working from imagery. Want to proceed that way, or grab a reference first?"
开场语:
“请分享你想要转换的图片(或多张图片)。我支持处理截图、模型、Figma链接、在线网站,或混合素材。若提供多张图片,请说明哪张是主要锚点,哪些是灵感参考。”
接受以下任意输入:
- 本地图片路径(PNG/JPG/WebP/截图)——使用工具读取。
Read工具会可视化渲染图片内容以供分析。Read - Figma链接(、
figma.com/design/...、figma.com/board/...)——使用Figma MCP工具(figma.com/make/...、get_design_context、get_screenshot)。根据Figma服务器的URL解析规则,从链接中提取get_metadata和fileKey。nodeId - 在线网站链接——注意:若无浏览器工具,无法对任意网站截图;请创始人粘贴截图,或使用工具仅读取内容/样式作为补充信号(而非主要视觉来源)。
WebFetch - 上述素材的组合
若仅提供一张图片,将其视为主要锚点。若提供多张图片,确认哪张是锚点,哪些是用于氛围/灵感的参考素材。
若用户在一次提示后仍未提供图片,提供备选方案:“我可以根据品牌的文字描述生成初始版design.md,后续再进行优化——但效果不如基于图片生成的版本。是否要继续此方案,还是先获取参考素材?”
Step 1: Image Analysis
步骤1:图片分析
Read every image carefully before asking any questions. Don't generalize — describe what you actually see.
For each image, extract and note:
- Colors — Approximate hex values for backgrounds, surfaces, primary text, secondary text, accents, borders, and any semantic states (success / warning / error / info) you can spot. Note dominant vs. accent. Light or dark mode? Any obvious contrast pairs?
- Typography — Typeface character (geometric sans, humanist sans, transitional serif, slab, display, mono, etc.). Visible hierarchy levels. Approximate sizes and weights. Letter-spacing tendencies (tight display, neutral body). Any uppercase / smallcaps usage.
- Spacing & density — Tight, comfortable, or generous? Consistent rhythm or improvised? Any visible scale (e.g., 4 / 8 / 16 / 24 / 32)?
- Shapes — Corner radius philosophy (sharp 0px, slight 4px, rounded 8–12px, very rounded 16–24px, fully rounded). Does it vary by component class (e.g., chips fully rounded, cards slight)?
- Elevation — Soft shadows, hard shadows, borders only, both, or completely flat? Any layering?
- Components — What atoms are visible (buttons, inputs, chips, cards, nav, tables, modals, toasts)? What variants and states?
- Mood — Two or three concrete adjectives. "Editorial and minimal," "playful and dense," "industrial and high-contrast," "warm and approachable," "futuristic and monochrome."
Then summarize what you saw to the founder in 5–8 tight bullets. Be specific. Mirror back the imagery's actual character. If two references conflict, name the conflict.
在提出任何问题前,仔细读取所有图片。不要泛泛而谈——描述实际看到的内容。
针对每张图片,提取并记录:
- 颜色——背景、表面、主文本、次要文本、强调色、边框以及可识别的语义状态(成功/警告/错误/信息)的近似十六进制值。区分主色调与强调色。是浅色模式还是深色模式?是否有明显的对比度组合?
- 排版——字体特征(几何无衬线、人文无衬线、过渡衬线、粗衬线、展示字体、等宽字体等)。可见的层级结构。近似字号和字重。字间距倾向(紧凑展示、中性正文)。是否使用大写/小型大写字母。
- 间距与密度——紧凑、舒适还是宽松?是否有一致的节奏还是随意布局?是否有可见的比例(如4/8/16/24/32)?
- 形状——圆角设计理念(尖锐0px、轻微4px、圆润8–12px、非常圆润16–24px、完全圆形)。是否因组件类别而异(例如:标签完全圆角,卡片轻微圆角)?
- 层级——软阴影、硬阴影、仅边框、两者兼具还是完全扁平化?是否有分层设计?
- 组件——可见的原子组件有哪些(按钮、输入框、标签、卡片、导航栏、表格、模态框、提示框)?有哪些变体和状态?
- 氛围——2-3个具体形容词。例如“编辑感与极简风”“活泼与密集”“工业风与高对比度”“温暖亲民”“未来感与单色”。
然后用5-8条简洁的要点向创始人总结你观察到的内容。要具体,准确反映图片的实际特征。若两个参考素材存在冲突,明确指出冲突点。
Step 2: Context Questions
步骤2:背景问题
Ask questions one at a time. Offer 3 tailored suggestions for each (drawn from your Step 1 analysis). Carry every answer forward as context for later suggestions. If or exists (created by the Product Planner skill), read it and skip questions already covered there — acknowledge what's known instead of re-asking.
docs/VISION.mddocs/product-vision.md- What is this design for? — Product name, what it does, who uses it. One sentence. (Skip if already answers this.)
docs/VISION.md - Emotional tone — Three adjectives describing how the product should feel. Suggest from the mood you observed.
- Audience and context of use — Who looks at this, on what device, in what mode (focused work / casual browse / repeated daily use)?
- Color role assignments — From the colors you spotted, which is (most-used brand surface), which is
primary(interactive emphasis), which carries semantic meaning? Light mode, dark mode, or both? Suggest a mapping.accent - Typography decisions — Confirm typeface choice. What's the type scale (display / h1 / h2 / h3 / body / caption / mono)? Any anti-pattern fonts to avoid (e.g., "never serif")?
- Spacing density — Tight, comfortable, or generous? Suggest based on observed density.
- Shape language — Sharp, soft, fully rounded, or mixed? What does that signal about the brand?
- Elevation philosophy — Shadows, borders, both, or flat? Recommend based on what you saw.
- Component priorities — Which components matter most for the MVP? Cap at 6–10. Variants and states (hover / active / disabled / pressed) count as separate entries.
- Anti-patterns — Three things this design must never become. Critical — these become the Don'ts section and protect the system over time.
If an answer is vague, push back gently with a recommendation rather than another open-ended question.
逐个提出问题。每个问题提供3个基于步骤1分析的定制化建议。将所有答案作为后续建议的背景信息。若或已存在(由Product Planner技能创建),读取该文件并跳过已覆盖的问题——确认已知信息,无需重复提问。
docs/VISION.mddocs/product-vision.md- 此设计用于什么场景?——产品名称、功能、用户群体。一句话描述。(若已回答此问题则跳过。)
docs/VISION.md - 情感基调——3个描述产品应带来的感受的形容词。基于观察到的氛围给出建议。
- 受众与使用场景——目标用户是谁?使用什么设备?使用模式(专注工作/休闲浏览/日常重复使用)?
- 颜色角色分配——从识别出的颜色中,确定哪个是(最常用的品牌主色)、哪个是
primary(交互强调色)、哪个承担语义含义?浅色模式、深色模式还是两者兼具?给出映射建议。accent - 排版决策——确认字体选择。字体层级是怎样的(展示字体/h1/h2/h3/正文/说明/等宽)?是否有需要避免的反模式字体(例如“绝不使用衬线字体”)?
- 间距密度——紧凑、舒适还是宽松?基于观察到的密度给出建议。
- 形状语言——尖锐、柔和、完全圆润还是混合风格?这对品牌有什么意义?
- 层级设计理念——阴影、边框、两者兼具还是扁平化?基于观察到的内容给出建议。
- 组件优先级——MVP中哪些组件最重要?最多6-10个。变体和状态(悬停/激活/禁用/按下)视为独立条目。
- 反模式——此设计绝对不能出现的3种情况。这一点至关重要——这些内容将成为“禁忌”部分,长期保护设计系统。
若答案模糊,不要提出开放式问题,而是给出明确建议。
Step 3: Token Derivation
步骤3:令牌提取
Synthesize the YAML token block. Follow the schema below precisely — it's what the design.md spec validates against.
合成YAML令牌块。严格遵循以下 schema——这是design.md规范的验证标准。
Token block shape
令牌块结构
yaml
version: alpha
name: <product-or-design-system-name>
description: <one-sentence description>
colors:
<semantic-token>: "#RRGGBB"
typography:
<scale-token>:
fontFamily: <family>
fontSize: <px | rem | em>
fontWeight: <number, e.g. 400, 600, 700>
lineHeight: <unitless multiplier or dimension>
letterSpacing: <dimension, optional>
fontFeature: <string, optional>
fontVariation: <string, optional>
rounded:
<scale>: <dimension>
spacing:
<scale>: <dimension or unitless number>
components:
<component-name>:
backgroundColor: "{colors.<token>}"
textColor: "{colors.<token>}"
typography: "{typography.<token>}"
rounded: "{rounded.<token>}"
padding: <dimension or token reference>
size: <dimension, optional>
height: <dimension, optional>
width: <dimension, optional>yaml
version: alpha
name: <product-or-design-system-name>
description: <one-sentence description>
colors:
<semantic-token>: "#RRGGBB"
typography:
<scale-token>:
fontFamily: <family>
fontSize: <px | rem | em>
fontWeight: <number, e.g. 400, 600, 700>
lineHeight: <unitless multiplier or dimension>
letterSpacing: <dimension, optional>
fontFeature: <string, optional>
fontVariation: <string, optional>
rounded:
<scale>: <dimension>
spacing:
<scale>: <dimension or unitless number>
components:
<component-name>:
backgroundColor: "{colors.<token>}"
textColor: "{colors.<token>}"
typography: "{typography.<token>}"
rounded: "{rounded.<token>}"
padding: <dimension or token reference>
size: <dimension, optional>
height: <dimension, optional>
width: <dimension, optional>Rules
规则
- Hex colors are quoted strings prefixed with (sRGB). Example:
#."#1A1C1E" - Dimensions use ,
px, orem. Letter-spacing may use a negative em (e.g.,rem).-0.02em - Component property values should reference tokens with syntax wherever a token exists. Inline literal dimensions only when no matching token applies.
{path.to.token} - Variants (hover, active, disabled, pressed, focus) are separate component entries with a related key — and
button-primary, not nested children.button-primary-hover - Semantic color names beat appearance-based names. Use ,
primary,on-primary,surface,on-surface,accent,error,success,warning— notinfo,blue,red.lightGray - Valid component property names (per spec): ,
backgroundColor,textColor,typography,rounded,padding,size,height. Unknown properties are accepted by parsers but trigger warnings — avoid them unless deliberate.width - No duplicate headings in the prose (the spec rejects files with duplicates).
##
- 十六进制颜色是带前缀的字符串(sRGB格式)。示例:
#."#1A1C1E" - 尺寸使用,
px, 或em。字间距可使用负em值(例如rem)。-0.02em - 组件属性值只要存在对应令牌,就应使用语法引用令牌。仅当无匹配令牌时才使用内联字面量尺寸。
{path.to.token} - 变体(hover, active, disabled, pressed, focus)是独立的组件条目,使用相关键名—— 和
button-primary,而非嵌套子项。button-primary-hover - 语义颜色名称优于基于外观的名称。使用 ,
primary,on-primary,surface,on-surface,accent,error,success,warning— 而非info,blue,red.lightGray - 有效的组件属性名称(根据规范):,
backgroundColor,textColor,typography,rounded,padding,size,height。解析器会接受未知属性,但会触发警告——除非刻意为之,否则避免使用。width - 说明文字中不要出现重复的标题——规范会拒绝包含重复标题的文件。
##
Step 4: Prose Drafting
步骤4:说明文字撰写
Draft prose for the eight canonical sections, in this exact order. Each section should be tight (3–8 sentences). Don't pad. Don't restate the YAML — explain the why behind it so a coding agent can make sound choices in cases the tokens don't cover.
- Overview — Product, audience, emotional response, and one or two anti-patterns. The brand-and-style north star.
- Colors — Palette intent. What ,
primary,accent, and semantic colors do, and why those specific values. Note contrast considerations (WCAG AA at minimum for text).surface - Typography — Typeface choice and its character. The type scale's intent — what each level is for. Any pairing logic.
- Layout — Spacing scale, grid model (if any), density philosophy. Margin / gutter / container approach.
- Elevation & Depth — Shadow scale or border-and-contrast strategy. Why this choice for this brand.
- Shapes — Corner radius philosophy. When sharp vs. rounded, and what each signals.
- Components — How buttons, inputs, chips, cards behave. Variant rules and state behavior. Reference the YAML tokens by name.
- Do's and Don'ts — 4–6 do's and 4–6 don'ts. Specific and enforceable. Drawn from the anti-patterns and aesthetic intent.
按照以下固定顺序撰写8个标准章节的说明文字。每个章节应简洁(3-8句话),不要冗余。不要重复YAML内容——解释设计背后的逻辑,以便编码Agent在令牌未覆盖的场景下做出合理决策。
- 概述——产品、受众、情感反馈以及1-2个反模式。这是品牌与风格的核心指引。
- 颜色——调色板的设计意图。,
primary,accent和语义颜色的作用,以及选择这些具体值的原因。注意对比度要求(文本至少符合WCAG AA标准)。surface - 排版——字体选择及其特征。字体层级的设计意图——每个层级的用途。任何字体搭配逻辑。
- 布局——间距比例、网格模型(若有)、密度设计理念。边距/ gutter/容器的处理方式。
- 层级与深度——阴影比例或边框与对比度策略。为何为该品牌选择此方案。
- 形状——圆角设计理念。何时使用尖锐或圆润的形状,以及每种形状传递的信号。
- 组件——按钮、输入框、标签、卡片等组件的行为方式。变体规则和状态行为。引用YAML令牌的名称。
- 注意事项——4-6条“建议”和4-6条“禁忌”。具体且可执行。基于反模式和审美意图制定。
Step 5: Confirm and Write
步骤5:确认与写入
Before writing, show the founder a brief outline:
- The YAML token names you've picked (color tokens, type scale levels, rounded scale, spacing scale, component list)
- A one-line summary of each prose section
Ask for any last edits. Then write to . Create the directory if it doesn't exist. This is the source of truth — once it's written and verified, Step 6 generates the mirror from it.
docs/design.mddocs/design.html写入前,向创始人展示简要大纲:
- 你选择的YAML令牌名称(颜色令牌、字体层级、圆角比例、间距比例、组件列表)
- 每个说明文字章节的一句话总结
询问是否需要最终修改。然后写入。若目录不存在则创建。这是唯一可信源——写入并验证成功后,执行步骤6生成镜像文件。
docs/design.mddocs/design.htmlFile format
文件格式
markdown
---
version: alpha
name: <Name>
description: <One-sentence description>
colors:
...
typography:
...
rounded:
...
spacing:
...
components:
...
---markdown
---
version: alpha
name: <Name>
description: <One-sentence description>
colors:
...
typography:
...
rounded:
...
spacing:
...
components:
...
---<Name> Design System
<Name> 设计系统
Overview
概述
...
...
Colors
颜色
...
...
Typography
排版
...
...
Layout
布局
...
...
Elevation & Depth
层级与深度
...
...
Shapes
形状
...
...
Components
组件
...
...
Do's and Don'ts
注意事项
...
After writing, verify the write succeeded before confirming. If the write fails, surface a clear, user-friendly message based on the cause:
- **Permission denied** → "I couldn't save `docs/design.md` because the directory isn't writable. Check folder permissions and try again."
- **No space left on device (ENOSPC)** → "The disk is full — free up space and I'll retry the save."
- **Existing file conflict** (read-only or unexpected contents) → "A `docs/design.md` already exists and I can't overwrite it. Want me to save under a different name or overwrite?"
- **Any other error** → Report the error message verbatim and ask how to proceed.
Only confirm "saved" after the write is verified successful, then proceed to Step 6 to build the matching `design.html`.
-----...
写入后,先验证写入是否成功再确认。若写入失败,根据原因显示清晰友好的提示信息:
- **权限拒绝** → "无法保存`docs/design.md`,因为目录不可写。请检查文件夹权限后重试。"
- **磁盘空间不足(ENOSPC)** → "磁盘已满——请释放空间后重试保存。"
- **现有文件冲突**(只读或内容不符合预期) → "`docs/design.md`已存在,无法覆盖。是否要保存为其他名称或覆盖现有文件?"
- **其他错误** → 如实报告错误信息并询问如何处理。
仅在验证写入成功后,确认“已保存”,然后执行步骤6生成匹配的`design.html`。
-----Step 6: Build the design.html mirror
步骤6:生成design.html镜像文件
docs/design.htmldocs/design.md.md.htmldesign.mddesign.htmlBuild a single self-contained file to these requirements:
.html- Self-contained and dependency-free. One file that opens directly in any browser — all CSS inline in a block, no build step, no frameworks, no external JS. Web fonts may load via a
<style>to Google Fonts (or a CDN) when the typeface needs it; otherwise use the system font stack.<link> - Token-driven. Declare every token from the YAML as a CSS custom property in (e.g.
:root,--color-primary,--type-h1-size,--rounded-md). Every swatch, specimen, and component styles itself from those variables — so the page renders the exact same values that live in the--space-4, and changing a variable updates everything. Don't hardcode values that exist as tokens..md - Mirror the md's structure and order, so a reader can hold the two side by side.
- If the system defines both light and dark modes, include a small theme toggle (a few lines of vanilla JS flipping a attribute on
data-theme) and define both token sets. Otherwise render the single mode.<html>
Sections, in this order:
- Header — design system name, the one-line description, and a note that this file is the human-readable mirror of .
docs/design.md - Colors — a swatch for every color token: the color block, the token name, the hex value, and a line of text in the paired color to show the combination. Group semantic states (success / warning / error / info) together.
on- - Typography — render each type-scale level as a live specimen at its real family / size / weight / line-height / letter-spacing, with the token name and its spec listed beside it.
- Spacing — a visual bar or box for each spacing step, labeled with the token and value, so the rhythm is visible.
- Radius — a sample box rendered at each value, labeled.
rounded - Elevation & Depth — a card for each elevation level (its shadow or border strategy), labeled.
- Components — every component from the block, built out and rendered live, including each variant and state (default / hover / active / disabled / focus). Group related entries together (e.g. all button variants). Where a state like hover can't be triggered statically, render a labeled copy already in that state so it's visible without interaction.
components: - Do's and Don'ts — the same do's and don'ts as the md, laid out as two readable columns (✓ do / ✗ don't), with a small visual example where it helps.
Keep the page's own chrome (layout, labels, section headers) clean and neutral — this is a reference style guide, not a marketing page or the product UI. The tokens and components should be what stands out.
Write to . Verify the write succeeded using the same error handling as the write (permission denied, no space, existing-file conflict, other — report and ask how to proceed). The and are always written together — never leave one updated and the other stale.
docs/design.html.md.md.htmldocs/design.htmldocs/design.md.md.htmldesign.mddesign.html按照以下要求构建单个独立的文件:
.html- 独立且无依赖。单个文件可直接在任意浏览器中打开——所有CSS内联在块中,无需构建步骤、框架或外部JS。当字体需要时,可通过
<style>加载Google Fonts(或CDN)的网络字体;否则使用系统字体栈。<link> - 令牌驱动。将YAML中的每个令牌声明为中的CSS自定义属性(例如
:root,--color-primary,--type-h1-size,--rounded-md)。每个色板、样本和组件都从这些变量获取样式——确保页面渲染的数值与--space-4文件中的完全一致,修改变量即可更新所有内容。不要硬编码已存在令牌的值。.md - 镜像md文件的结构和顺序,以便读者可将两个文件并排查看。
- 若系统同时定义了浅色和深色模式,添加一个小型主题切换按钮(几行原生JS代码,切换的
<html>属性),并定义两套令牌。否则仅渲染单一模式。data-theme
章节顺序如下:
- 页眉——设计系统名称、一句话描述,以及说明该文件是的人工可读镜像的提示。
docs/design.md - 颜色——每个颜色令牌对应一个色板:颜色块、令牌名称、十六进制值,以及一行使用配对颜色的文本,展示颜色组合。将语义状态(成功/警告/错误/信息)分组展示。
on- - 排版——以真实的字体/字号/字重/行高/字间距渲染每个字体层级的样本,并在旁边标注令牌名称和规格。
- 间距——每个间距步骤对应一个可视化的条形或方块,标注令牌和数值,以便直观查看节奏。
- 圆角——每个值对应一个样本方块,并标注数值。
rounded - 层级与深度——每个层级对应一个卡片(展示其阴影或边框策略),并标注数值。
- 组件——块中的所有组件,构建并实时渲染,包括每个变体和状态(默认/悬停/激活/禁用/聚焦)。将相关条目分组(例如所有按钮变体)。对于无法静态触发的状态(如悬停),渲染一个已处于该状态的标注副本,以便无需交互即可查看。
components: - 注意事项——与md文件相同的“建议”和“禁忌”,分为两列展示(✓ 建议 / ✗ 禁忌),必要时添加小型可视化示例。
页面自身的布局、标签、章节标题应简洁中性——这是参考样式指南,而非营销页面或产品UI。令牌和组件应是视觉焦点。
写入。使用与写入相同的错误处理方式验证写入是否成功(权限拒绝、空间不足、现有文件冲突、其他——报告并询问如何处理)。和必须同步写入——绝不能更新其中一个而让另一个过时。
docs/design.html.md.md.htmlStep 7: Handoff
步骤7:交付
After writing both files, say:
"Your design system is captured in two mirrored files:
— YAML tokens + prose for any coding agent to implement from (the source of truth).docs/design.md — a human-readable style guide; open it in a browser to see every token and component rendered live.docs/design.htmlThey're the same system — one for the agent, one for you. When tokens change, both update together."
Then suggest the natural next step based on project state:
- If exists → "Want me to update the PRD's Design System section so it references these tokens?"
docs/prd.md - If exists but
docs/product-vision.mddoes not → "Run the Product Planner skill to generate the PRD — it'll consume these tokens directly."docs/prd.md - If neither exists → "Run the Product Planner skill if you want to wrap this design into a full product vision and PRD."
If the Product Planner skill isn't installed, mention that it's part of BuilderOS: https://github.com/BuildGreatProducts/builder-os.
写入两个文件后,告知用户:
"你的设计系统已保存为两个镜像文件:
— 包含YAML令牌和说明文字,供任意编码Agent实现(唯一可信源)。docs/design.md — 人工可读的样式指南;在浏览器中打开即可查看所有令牌和组件的实时渲染效果。docs/design.html两者是同一系统——一个供Agent使用,一个供你查看。当令牌更改时,两个文件会同步更新。"
然后根据项目状态建议下一步操作:
- 若已存在 → "是否需要我更新PRD的设计系统章节,使其引用这些令牌?"
docs/prd.md - 若已存在但
docs/product-vision.md不存在 → "运行Product Planner技能生成PRD——它会直接使用这些令牌。"docs/prd.md - 若两者都不存在 → "若要将此设计整合到完整的产品愿景和PRD中,请运行Product Planner技能。"
若未安装Product Planner技能,说明它是BuilderOS的一部分:https://github.com/BuildGreatProducts/builder-os。
Editing the design system
编辑设计系统
docs/design.mddocs/design.html.md.html.html.mdIf the founder wants to refine after the files exist:
- Change a single token — Update the YAML and any prose that references the old value, then update the corresponding CSS custom property and any affected component in . Keep YAML, prose, and HTML in sync.
design.html - Reanalyze with a new image — Read the new image, summarize what changed, and ask whether to replace the existing tokens or merge specific ones. Regenerate from the resulting tokens.
design.html - Rewrite a prose section — Update only that section in the . Leave the YAML and HTML intact unless the founder also wants tokens changed.
.md - Add a component — Append a new entry under , add a paragraph in the Components prose section, and render the new component (with its variants/states) in the Components section of
components:.design.html
In the , always preserve canonical section order and never create duplicate headings — the design.md spec rejects files with duplicates.
.md##docs/design.mddocs/design.html.md.html.html.md若创始人希望在文件生成后进行优化:
- 修改单个令牌——更新YAML以及所有引用旧值的说明文字,然后更新中对应的CSS自定义属性和受影响的组件。保持YAML、说明文字和HTML同步。
design.html - 根据新图片重新分析——读取新图片,总结变化,询问是替换现有令牌还是合并特定令牌。根据最终令牌重新生成。
design.html - 重写说明文字章节——仅更新文件中的对应章节。除非创始人同时要求修改令牌,否则保留YAML和HTML不变。
.md - 添加组件——在下追加新条目,在组件说明文字章节中添加段落,并在
components:的组件部分渲染新组件(及其变体/状态)。design.html
在文件中,始终保留标准章节顺序,不要创建重复的标题——design.md规范会拒绝包含重复标题的文件。
.md##