关于 design-brief
design-brief 是一项 Agent 技能,可将结构化或自然语言设计简报转为基于设计令牌的 DESIGN.md,并可生成 HTML 预览。它通过明确的默认规则和约束解析八个设计维度。
主要功能
- 01解析结构化及自然语言简报
- 02解析八个设计维度
- 03将选项映射为具体设计令牌
- 04生成九部分 DESIGN.md
- 05可选生成 HTML 可视化预览
- 06报告未指定维度及默认值
适用场景
- 01将落地页需求转为设计规范
- 02统一配色、字体与布局选择
- 03用示例组件预览解析后的令牌
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ nexu-io/ open-design --skill design-brief安装后在 Claude Code 中输入/design-brief确认已加载。
详细介绍
设计简报技能
将结构化设计简报解析为具体的 DESIGN.md 和可选的视觉预览。Agent,请严格遵循此工作流。
背景
此技能中的 8 个维度源自 OpenDesign 最初的 71 套系统目录;71 是研究样本数,并非当前打包的系统数量。design-systems/ 中的每个 DESIGN.md 至少仍会明确:调色板、强调色、字体排印、展示字体、布局模型和组件样式。我们将这些内容提炼为 8 个相互独立的维度,涵盖设计师在放置任何像素之前所做的决策。之所以加入氛围和密度,是因为它们是自然语言简报中最常见的两种歧义来源(“做得简洁”对不同人来说含义各异)。
有意不纳入简报层级的维度:动画时序、响应式策略和无障碍对比度。这些由各个技能在模板层级强制执行(例如,saas-landing 会处理自身的响应式逻辑),而生成的 DESIGN.md 会包含合理的断点默认值,供后续使用。
1. 接收输入
用户会以以下两种格式之一提供设计简报:
选项 A:I-Lang 结构化简报
[PLAN:@DESIGN|type=saas_landing]
|palette=navy_and_white|accent=coral
|typography=inter|display=space_grotesk
|layout=single_column|max_width=1200px
|mood=professional_minimal
|density=spacious|section_gap=96px
|hero=headline+subhead+cta
|sections=features,pricing,testimonials,footer
|exclude=animations,parallax,gradients
|responsive=mobile_first
选项 B:自然语言
“我需要一个面向开发者工具的落地页。简洁、极简、深色模式。使用 Inter 字体。不要炫目的动画。”
如果用户提供的是选项 B,请使用下方映射表将其转换为结构化格式,然后继续。明确指出每个已明确说明的维度,并标记未说明的维度。
自然语言 → I-Lang 映射
对于自然语言输入中的每句话,识别维度关键词,并映射到最接近的结构化值:
| 自然语言短语 | 维度 | I-Lang 值 |
|---|---|---|
| “深色模式”、“深色主题” | 调色板 | monochrome_dark |
| “浅色”、“白色背景” | 调色板 | light_clean |
| “大地色系”、“暖色调” | 调色板 | earth_tones |
| “点缀色彩”、“鲜艳” | 强调色 | electric_blue(默认)或 coral |
| “低调的强调色” | 强调色 | muted_sage(默认)或 slate |
| “简洁”、“极简”、“简单” | 氛围 | professional_minimal |
| “活泼”、“有趣”、“友好” | 氛围 | playful |
| “大胆”、“粗野主义”、“原始” | 氛围 | brutalist |
| “编辑风格”、“杂志风” | 氛围 | editorial |
| “宽敞”、“大量留白” | 密度 | spacious |
| “紧凑”、“密集”、“信息丰富” | 密度 | compact |
| “Inter”、“系统字体” | 字体排印 | inter(默认)或 system_ui |
| “衬线字体”、“传统” | 字体排印 | georgia(默认)或 playfair |
| “等宽字体”、“代码风格” | 字体排印 | jetbrains_mono |
| “不要动画”、“静态” | 排除项 | animations |
| “不要渐变” | 排除项 | gradients |
| “不要图库照片” | 排除项 | stock_photos |
| “单页” | 布局 | single_column |
| “双栏”、“侧边栏” | 布局 | two_column |
| “移动端优先” | 响应式 | mobile_first |
当一个短语对应多个维度时(例如,“简洁的深色落地页” → mood=professional_minimal + palette=monochrome_dark + layout=single_column),请分别确定每个维度。当某个映射列出多个值时,第一个是默认值;只有在上下文强烈倾向其他选项时,Agent 才可选择备选值。
2. 验证维度
每份设计简报都必须确定以下 8 个维度。如果输入中缺少任何维度,请依据第 2.2 节中的规则选择合理的默认值。
下方列出的值构成一个封闭词汇表。只有表中的值在第 2.1 节中有对应的具体令牌映射。如果用户提供的值不在表中,Agent 必须请求澄清,而不是自行猜测。
| # | 维度 | 键 | 示例值 |
|---|---|---|---|
| 1 | 配色方案 | palette | navy_and_white, earth_tones, monochrome_dark, light_clean |
| 2 | 强调色 | accent | coral, electric_blue, emerald, muted_sage |
| 3 | 正文字体 | typography | inter, system_ui, dm_sans, georgia |
| 4 | 展示字体 | display | space_grotesk, clash_display, same_as_body, playfair |
| 5 | 布局模式 | layout | single_column, two_column, asymmetric |
| 6 | 氛围 | mood | professional_minimal, playful, brutalist, editorial |
| 7 | 密度 | density | compact, balanced, spacious |
| 8 | 限制条件 | exclude | animations, gradients, stock_photos, carousel |
2.1 符号值 → 具体令牌解析
每个符号值都映射到具体设计令牌。编写 DESIGN.md 前,Agent 必须先解析这些值:
| 符号值 | 具体令牌 |
|---|---|
palette=navy_and_white | 背景:#0F172A,表面:#1E293B,文本:#F8FAFC,次要文本:#94A3B8 |
palette=monochrome_dark | 背景:#09090B,表面:#18181B,文本:#FAFAFA,次要文本:#A1A1AA |
palette=light_clean | 背景:#FFFFFF,表面:#F8FAFC,文本:#0F172A,次要文本:#64748B |
palette=earth_tones | 背景:#FFFBEB,表面:#FEF3C7,文本:#451A03,次要文本:#92400E |
accent=coral | 强调色:#F97316,悬停:#EA580C |
accent=electric_blue | 强调色:#3B82F6,悬停:#2563EB |
accent=emerald | 强调色:#10B981,悬停:#059669 |
accent=muted_sage | 强调色:#84A98C,悬停:#6B8F73 |
accent=slate | 强调色:#64748B,悬停:#475569 |
typography=inter | 正文:Inter,400,1rem/1.6 |
typography=system_ui | 正文:system-ui,400,1rem/1.6 |
typography=dm_sans | 正文:DM Sans,400,1rem/1.6 |
typography=georgia | 正文:Georgia,400,1.125rem/1.7 |
display=space_grotesk | 展示字体:Space Grotesk,700,clamp(2rem, 5vw, 3.5rem) |
display=clash_display | 展示字体:Clash Display,700,clamp(2rem, 5vw, 3.5rem) |
display=playfair | 展示字体:Playfair Display,700,clamp(2rem, 5vw, 3.5rem) |
display=same_as_body | 展示字体继承正文字体系列,字重 600 |
density=compact | 区块间距:48px,内容内边距:16px/24px |
density=balanced | 区块间距:72px,内容内边距:24px/40px |
density=spacious | 区块间距:96px,内容内边距:24px/48px |
不在此表中的符号值均无效。如果用户提供了无法识别的值(例如,palette=ocean_blue),Agent 必须请求澄清:"我无法识别 palette=ocean_blue。你是指 navy_and_white、monochrome_dark、light_clean 还是 earth_tones?"
2.2 默认解析规则
未指定某个维度时,将根据情绪兼容性选择默认值:
| 未指定的维度 | 默认规则 |
|---|---|
palette | 如果 mood=editorial → light_clean。如果 mood=brutalist → monochrome_dark。否则 → light_clean。 |
accent | 如果 palette 为深色 → coral。如果 palette 为浅色 → electric_blue。 |
typography | 始终 → inter(跨平台可读性最高)。 |
display | 如果 mood=editorial → playfair。如果 mood=brutalist → space_grotesk。否则 → same_as_body。 |
layout | 始终 → single_column(最稳妥的响应式默认值)。 |
mood | 始终 → professional_minimal(最不受限的选项)。 |
density | 始终 → balanced。 |
exclude | 始终 → 无(除非指定,否则不设限制)。 |
如果 mood 也未指定,所有默认值都将回退到安全的中性组合:palette=light_clean、accent=electric_blue、typography=inter、display=same_as_body、layout=single_column、mood=professional_minimal、density=balanced、exclude=none。
3. 生成 DESIGN.md
此技能会根据已解析的简报维度从头生成新的 DESIGN.md。如果工作目录中已存在 DESIGN.md,Agent 应询问用户是覆盖还是跳过。
使用以下九部分大纲生成 DESIGN.md。此大纲是该技能可移植的独立输出,继承自 OpenDesign 最初的上游基线;它不是当前仓库的软件包架构。当前捆绑的软件包还包含 manifest.json、tokens.css 和可选的丰富资源,而仅含 DESIGN.md 的旧版内容及用户安装的内容仍可读取。所有颜色十六进制值、字体栈和间距值都必须来自第 2.1 节中已解析的令牌——不得使用解析表之外的值。
# [Project Name] Design System
## Visual Theme & Atmosphere
- Mood: [resolved from mood]
- Feel: [derived from mood — e.g., professional_minimal → "Clean, confident, restrained"]
- References: [if mood=editorial → "Magazine layouts, Monocle, Cereal"; if mood=brutalist → "Exposed structure, raw typography"]
## Color Palette & Roles
- Background: [resolved from palette]
- Surface: [resolved from palette]
- Text primary: [resolved from palette]
- Text secondary: [resolved from palette]
- Accent: [resolved from accent]
- Accent hover: [resolved from accent]
## Typography Rules
- Display: [resolved from display], 700, clamp(2rem, 5vw, 3.5rem)
- Body: [resolved from typography], 400, 1rem/1.6
- Mono: JetBrains Mono, 400, 0.875rem
## Component Stylings
- Buttons: [if mood=playful → "rounded-full", otherwise → "rounded-md"], accent bg, contrast text
- Cards: surface bg, subtle border, 12px radius
- Inputs: [if mood=brutalist → "thick border", otherwise → "transparent bg, bottom border"]
## Layout Principles
- Max width: 1200px
- Grid: [resolved from layout]
- Section spacing: [resolved from density]
- Content padding: [resolved from density]
## Depth & Elevation
- Shadows: [if mood=brutalist → "hard 4px offset", if mood=professional_minimal → "none", otherwise → "subtle sm"]
- Borders: 1px solid [derived from palette, 8% opacity of text color]
## Do's and Don'ts
- DO use the declared color tokens exclusively.
- DO maintain consistent section spacing.
- DO ensure all text meets WCAG AA contrast ratio.
- DON'T invent colors outside the palette.
- DON'T add decorative shadows unless Depth & Elevation allows them.
- DON'T use more than 2 display/body typefaces (monospace is a utility face for code and data — it does not count toward this limit).
## Responsive Behavior
- Breakpoints: 640px (sm), 768px (md), 1024px (lg), 1280px (xl)
- Mobile: single column, stack all sections vertically
- Tablet: allow 2-column feature grids
- Desktop: full layout with max-width constraint
- Images: fluid, max-width 100%, maintain aspect ratio
## Agent Prompt Guide
- Do NOT invent colors outside this palette.
- Do NOT add box-shadows unless specified above.
- Accent color appears maximum 3 times per viewport.
- All interactive elements need :focus-visible outline.
- [if exclude contains items → list each as "Do NOT use {item}."]
4. 生成 brief-preview.html
创建一个 HTML 文件,以可视化方式呈现已解析的设计令牌。预览必须按顺序包含以下 4 个部分:
- 调色板色样 — 一行水平排列的矩形,每个矩形显示颜色部分中的一种颜色。为每个色样标注其角色(Background、Surface、Text、Accent)和十六进制代码。
- 字体排版示例 — 三个文本块,分别展示 Display、Body 和 Mono 字体及其声明的字号。每个示例都使用一句示例文本(“The quick brown fox...”)。
- 间距标尺 — 使用可视化标尺或堆叠条展示区块间距和内容内边距,并标注其 px 值。
- 组件预览 — 使用已解析的令牌渲染 2–3 个可交互组件(主按钮、包含标题和正文的卡片、文本输入框)。这些组件应使用功能完整的 HTML/CSS,而不是截图。
预览本身应使用已解析的设计系统令牌(背景颜色、字体、间距)进行样式设计。预览应呈现为设计系统文档页面。
5. 报告未指定的维度
在输出末尾,列出用户未指定的维度以及所应用的默认值,并注明选择各默认值所依据的规则:
Dimensions resolved from defaults:
- display: set to "same_as_body" (rule: mood=professional_minimal → same_as_body)
- density: set to "balanced" (rule: static fallback, no spacing preference given)
- exclude: set to "none" (rule: no constraints unless specified)
这样可以确保所有假设都明确呈现,避免未说明的假设影响最终设计。