The first time I dug into Open Design’s resource directory, it was late at night. The path runs deep: /Applications/Open Design.app/Contents/Resources/open-design. Inside sit three repositories: design-systems/ with 149 brand folders, one DESIGN.md each; design-templates/ with 110 page templates, one SKILL.md each; craft/ with 11 craft-spec markdown files.
The app’s job is straightforward: you tell it what kind of page you want, it picks one item from each of the three repositories, and assembles a brand-consistent HTML page. I stared at those three directories for a while, and one question popped into my head: could this logic move into Claude Code as a Skill?
The answer is yes. And after the move, I realized the real treasure wasn’t the 149 brand files — those are one Read call away. The treasure was how it makes decisions.
The Problem
Open Design’s core is a three-axis composition system:
- Design systems (look) — the visual language of 149 brands, one DESIGN.md per brand, defining 9 dimensions like color, typography, components, and layout
- Templates (shape) — 110 page types, from SaaS landing pages to dashboards to slide decks, one SKILL.md per template
- Craft specs (quality) — 11 generic rule sets: typography, color, anti-AI-slop, state coverage, accessibility, and more
The division of labor is clean: design systems decide “which tokens to use,” craft specs decide “how to use these tokens,” and templates decide “what shape the output takes.” When the axes conflict, the brand wins; craft specs only fill in what the brand doesn’t cover.
This architecture is itself a design pattern: separation of concerns. Brand visuals decouple from generic quality constraints; template shape decouples from specific content. Get this relationship right first, or the Skill you write will go sideways.
The Approach
Before writing the Skill, I spent days reading Open Design’s source code. One goal only: find its core design patterns, not copy code. I landed on three.
Pattern 1: Six-Part Assembly
Open Design’s daemon has a composeSystemPrompt() that stitches the system prompt together in a fixed order, six parts:
# composeSystemPrompt() — six parts, assembled in order
1. Identity & Workflow — agent role and working loop
2. Active Design System — full DESIGN.md of the selected brand
3. Active Craft References — craft specs required by the template
4. Active Template Skill — template SKILL.md workflow
5. Project Metadata — mode, platform, locale, scenario
6. Output Contract — self-contained HTML output contract
Each part carries real content, not placeholders. A few examples.
Part 1, Identity, reads like this (excerpt): “You are Open Design’s design advisor. Your job is to ask, recommend, then build — never skip the questions.” One sentence pins the agent’s persona and its iron rule.
Part 2 is the selected brand’s DESIGN.md in full — thousands of words of token definitions: primary and secondary colors, neutral scales, heading and body fonts, radii, shadows, spacing scales.
Part 5, Project Metadata, is machine fields: mode=advisor, platform=web, locale=zh-CN, scenario=landing. Looks boring, but it decides how the other parts get interpreted.
Part 6, Output Contract, is the output’s martial law: “Single self-contained HTML file. Wrap in
The beauty of this pattern: each part is independent, swappable, and single-responsibility. And here’s the good news for the Skill port — you don’t need to actually concatenate into one string. The agent reads the six files separately with the Read tool, which is equivalent. Assembly logic becomes a “read-file checklist,” and maintenance cost gets cut in half.
The essence of a Skill is keeping the act of "assembly" itself, reimplemented with a cheaper mechanism.
Distillation notesPattern 2: Advisor-Style Interaction
Open Design’s interaction is rigidly fixed to one chain:
direction -> 5 deep questions -> smart recommendation -> confirm -> build
The 5 questions cover five dimensions: content, audience, visual style, brand preference, and scale. After the questions, a matching algorithm scores templates and design systems, recommends the Top 3 combinations, and only builds once the user signs off.
In the Skill, this chain is implemented natively with AskUserQuestion. A real question looks like this:
{
"question": "Who is the primary audience for this page?",
"header": "Audience",
"options": [
{"label": "Consumers", "description": "Visual impact first, prominent CTA"},
{"label": "Enterprise buyers", "description": "High information density, lots of trust signals"},
{"label": "Internal team", "description": "Function first, dashboard style"}
],
"multiSelect": false
}
Note that every option carries a description. That’s the soul of advisor-style interaction: options are never bare labels — each one tells the user “here’s what happens if you pick me.” Users don’t need to understand design; they only need to know their own business.
The value of this pattern: the final say always stays with the user; the algorithm only compresses a 149×110 option pool down to 3. The algorithm subtracts; the human decides.
Pattern 3: Token-Preview Hard Gate
Before building, Open Design shows a token preview: background color, accent color, and fonts. The user must explicitly say “go” before generation runs.
This is a HARD-GATE pattern, built to stop token burn. I went through several drafts of the gate wording and settled on this:
**Token Preview — confirm before build**
Brand: Linear-style · bg #FFFFFF · accent #5E6AD2
Fonts: Inter / Noto Sans SC
Reply "go" to generate, or tell me which value to change.
Three elements, all required: the three token values listed explicitly, a confirmation word (“go”), and instructions for how to change things. No fuzzy “please confirm” — a fuzzy confirmation is no confirmation.
The economics of the gate are blunt: one full generation burns thousands of tokens; asking one question costs nearly nothing. Every token-burning action deserves a gate in front of it.
The Skill’s Actual Structure
Three patterns, landed in a Skill. Start with the frontmatter — the Skill’s “front door,” whose wording directly decides whether Claude walks through the wrong one:
---
name: open-design
description: |
Use when the user wants to generate brand-consistent web pages or
HTML artifacts with a specific visual identity. Do NOT trigger for
general coding questions, writing tasks, or when the user already
has a complete design spec.
allowed-tools:
- Read
- Write
- Edit
- Bash
- Grep
- Glob
- AskUserQuestion
---
The description’s wording is the critical detail. The formula: verb-first (“Use when”) + trigger scenario + exclusion scenario. Write the trigger conditions concretely, so Claude knows when to enter this Skill.
A real pitfall here: my first draft said “design anything,” and the Skill started triggering on CSS bug questions — walking the user through 5 questions before touching the bug. Tightening the trigger conditions brought misfires to zero. Lesson: the description is a routing rule, not ad copy. Write it too wide and it’s a bug.
allowed-tools is the capability boundary: the Skill may call only these 7 tools. Write and Edit are in, Bash is in (for builds), but there’s no WebSearch — research isn’t its job.
The body breaks into six parts:
1. Identity — the agent’s persona is “design advisor,” not a menu picker. Maps to assembly part 1.
2. Resource Map — the resource path table:
OD = /Applications/Open Design.app/Contents/Resources/open-design
$OD/design-systems/<brand>/DESIGN.md
$OD/design-templates/<template>/SKILL.md
$OD/craft/<name>.md
3. Arguments — four input modes:
| Input | Mode | Behavior |
|---|---|---|
| (empty) | Advisor | Full 5-stage consultation |
brand template | Direct | Skip Q&A |
--browse term | Browse | Search resources |
--compare b1 b2 | Compare | Compare two design systems |
4. Workflow — the detailed 5-stage flow, each stage driven by AskUserQuestion.
5. Matching Algorithm — the weight formula for matching, next section.
6. Output Contract — HTML must be self-contained, wrapped in an <artifact> tag.
What the Matching Algorithm Looks Like
Open Design’s matching algorithm converts the user’s 5 answers into scores. The formula:
template_score = 3×keyword + 2×scenario + 2×style + 2×scale + 1×featured
design_system_score = 3×style + 3×brand + 2×tone
Templates score on five dimensions, keyword weight highest (3); design systems score on three, style and brand tied at the top (3).
In the Skill, this algorithm needs no code. It’s expressed as a matching index table: the agent reads the user’s answers, scores each item against the table, and takes the Top 3. This is a unique strength of Claude Skills — a traditional implementation would need dozens of lines of logic; here one structured table does the job.
The weights weren’t guessed; they were tuned. A few tuning notes:
- The keyword weight of 3 was arrived at by trying 1 and 2. Drop it to 2 and recommendations start favoring “hot scenario” templates instead of the ones that semantically match. Keywords are the most direct signal of user intent; the weight has to be the highest.
- The
featuredpoint is a safety net for new templates. New templates have no history data — without that 1 point, they never crack the Top 3. - In the design-system score, brand weight 3: when a user names a brand, they basically never change their mind. That dimension is less a score and more a “single-vote lock.”
Reusing the Craft Specs
The 11 craft specs are Open Design’s most valuable asset. They bind to no brand and no template — they’re generic design-quality constraints:
- typography — font-size ratio 1.2/1.25, line-height 1.0–1.6, ALL CAPS tracking ≥ 0.06em, line length 50–75ch
- color — 4-layer palette (neutrals 70–90%, accents 5–10%, semantics 0–5%, effects <1%), max 2 accents per screen
- anti-ai-slop — 7 "sins" to avoid: default indigo, two-color gradients, emoji as icons, fake data, etc.
- state-coverage — 5 required states: Loading / Empty / Error / Populated / Edge
The reference mechanism: each template’s frontmatter declares od.craft.requires, listing the craft files it needs. Before generating, the agent reads those files, then applies brand tokens and craft constraints together. “Read + apply,” two steps.
What happens when brand and craft fight? The adjudication rule is “brand first,” with quantified boundaries:
- If DESIGN.md explicitly defines a token (say, the primary color), the brand value wins and craft yields.
- Dimensions the brand doesn’t cover belong to craft. That’s craft’s home turf.
- If the brand value violates a craft hard rule (e.g., text contrast below 4.5:1), the agent must warn first, then still execute the brand value, and log the deviation. Warning is mandatory; execution is the brand’s right.
- Craft’s “advisory” rules (max 2 accents per screen) yield to the brand unconditionally; “accessibility hard rules” go through the warning flow.
And a real faceplant: one template’s frontmatter was missing od.craft.requires. The generated page had the right colors and completely broken typography. After a long hunt, I found the craft files had never been read — a missing reference means silently dropped constraints. I call it craft drift: tokens right, rules gone. The fix is unglamorous: add a hard check in the Workflow that lists the loaded craft files before generating, and halt if any are missing.
The Results
After the port, the results split into two buckets.
What works:
- The full advisor-style interaction flow
- Smart Top-3 recommendations
- Brand-consistent HTML output
- Automatic craft-spec application
- Browse and Compare modes
What doesn’t, and why:
- Pixel-level device-frame rendering — needs the app’s binary frame assets; the Skill can only read text files.
- Live preview — needs the app’s preview-pane process; the Skill runs inside Claude Code, which has no such runtime.
- Complex animations in some templates — they depend on the app’s animation engine, which self-contained HTML can’t carry.
- Decorative features like community pets — unrelated to generation logic, dropped during distillation.
That “doesn’t work” list is exactly the Skill’s boundary of applicability. A Skill distills decision logic; anything that depends on a specific runtime, binary assets, or native UI stays in the app. Only the parts reducible to “read files + make judgments + write files” are worth moving.
The Current State
From the Open Design case, a general method falls out:
Identify the core architecture
Don't rush to write code. First answer: what independent parts does this app have? How do they relate? Open Design's answer is three axes — look, shape, quality — decoupled from each other.
Find the design patterns
Behind every architectural decision sits a pattern. Separation of concerns, advisor-style interaction, hard gates — patterns outvalue implementations, because patterns can change carriers and implementations can't.
Re-express with Claude's native capabilities
A Skill is a re-expression of logic. Use AskUserQuestion instead of UI interaction, tables instead of algorithms, Read instead of file loading. Find the cheapest equivalent implementation.
Define boundaries
Write the "doesn't work" list explicitly. Don't try to replicate the whole app — distill the most valuable parts. The clearer the boundary, the harder the Skill is to misuse.
Test and iterate
Run 3 real tasks through it. Matching weights, description trigger conditions, gate wording — all of it was tuned in real trials, not imagined on paper.
Code goes stale; decision chains survive framework churn. “Ask first, then recommend; preview after recommending; build after previewing” — that chain works on any carrier.
Start Today
Don’t just read — start today:
- Pick a complex app you actually use and dig into its resource directory or source. Look for the parts where it repeats the same decisions over and over — the more fixed the decision flow, the more worth distilling.
- Draw a resource map: what resource categories does it have? What does each govern? How do they relate? Who wins conflicts? If one table can’t explain it, don’t start writing the Skill yet.
- Write the Skill’s frontmatter: short name, description in “verb-first + trigger scenario + exclusion scenario” form, and only the tools it truly needs in allowed-tools. Then read it three times as Claude and ask: “could this misfire?”
- Write the six-part body: Identity, Resource Map, Arguments, Workflow, matching index table, Output Contract. Skeleton first, content second.
- Trial-run 3 real tasks: log whether recommendations land, whether the gate catches waste, whether the description misfires. Tune weights, tighten wording.
- Gate the token-burning actions: preview → confirmation word → execute. Make the confirmation word concrete (like “go”), never “please confirm.”
The X-thread version
1/10 I stuffed a macOS app carrying 149 design systems into a single Claude Code Skill. The most surprising discovery: the hardest part wasn’t the code — it was one sentence in the description. 🧵
2/10 Open Design’s core is three-axis composition: 149 brand design systems (look) × 110 page templates (shape) × 11 craft specs (quality). Design systems decide “which tokens,” craft specs decide “how to use them,” templates decide “what shape the output takes.”
3/10 Before writing anything, I spent days reading the source with one goal: find the core design patterns, copy nothing. I landed on three: six-part assembly, advisor-style interaction, and the token-preview hard gate. Patterns outvalue implementations — patterns can change carriers.
4/10 Six-part assembly: Identity → Design System → Craft Refs → Template → Metadata → Output Contract. Each part independent and swappable. In the Skill there’s no real string concatenation — the agent Reads the files separately. Same effect, half the maintenance cost.
5/10 Advisor-style interaction: 5 fixed questions (content/audience/style/brand/scale) → algorithm scores → Top 3 recommendations → user decides. Every AskUserQuestion option needs a description telling the user “here’s what happens if you pick me.”
6/10 The matching formula: template = 3×keyword + 2×scenario + 2×style + 2×scale + 1×featured. The keyword weight of 3 was tuned — drop it to 2 and recommendations drift. No code needed in the Skill; one matching index table does it.
7/10 Token-preview hard gate: before building, show background/accent/font; the user replies “go” to execute. Three wording elements: list the values, give the confirmation word, explain how to change things. One generation burns thousands of tokens; one question costs nearly nothing.
8/10 Real pitfall ①: the description said “design anything,” and the Skill started triggering on CSS bug questions — walking users through 5 questions first. The description is a routing rule, not ad copy. Too wide = bug.
9/10 Real pitfall ②: a template’s frontmatter was missing od.craft.requires. Output had right colors, broken typography — the craft files were never read. That’s craft drift. Fix: a hard check in the Workflow listing loaded craft files; halt if any are missing.
10/10 The general method in five steps: identify architecture → find patterns → re-express with Claude’s native capabilities → define boundaries → test and iterate. Code goes stale; decision chains survive. Full post: https://citygenius-blog.pages.dev/article/open-design-to-skill
FAQ
What exactly is the three-axis composition?
Design systems (look: the visual language of 149 brands, one DESIGN.md per brand), templates (shape: 110 page types, one SKILL.md per template), craft specs (quality: 11 generic rule sets). Design systems decide “which tokens to use,” craft specs decide “how to use these tokens,” templates decide “what shape the output takes.” When in conflict, the brand wins; craft specs fill in what the brand doesn’t cover.
After converting to a Skill, what can’t be ported over?
Pixel-level device-frame rendering (needs the app’s binary assets), live preview (needs the app’s preview-pane process), complex animations in some templates (depend on the app’s runtime). Those live at the “app experience” layer. But the advisor-style interaction, Top-3 recommendations, brand-consistent HTML output, and automatic craft-spec application all work fully.
How is the matching algorithm implemented in a Skill?
No code needed — it’s a matching index table. template_score = 3×keyword + 2×scenario + 2×style + 2×scale + 1×featured; the agent scores against the table and takes the Top 3. The weights were tuned: keyword 3 is the lowest effective value found by trial, and the featured point is a safety net for new templates.
How do you write the trigger conditions in the description?
The three-part formula: verb-first (“Use when”) plus trigger scenario plus exclusion scenario. Write trigger scenarios concretely and exclusions clearly. The description is a routing rule, not ad copy — write it too wide and it misfires.
What’s the general method for distilling design patterns?
Five steps: identify the core architecture (which independent parts, how they relate); find the design patterns; re-express with Claude’s native capabilities (AskUserQuestion instead of UI interaction, tables instead of algorithms); define boundaries (write the “doesn’t work” list); test and iterate (run real tasks, tune weights and wording).
我第一次钻进 Open Design 的资源目录,是在一个深夜。路径很深:/Applications/Open Design.app/Contents/Resources/open-design。里面躺着三个仓库:design-systems/ 下 149 个品牌文件夹,每个一个 DESIGN.md;design-templates/ 下 110 个页面模板,每个一个 SKILL.md;craft/ 下 11 个工艺规范 md 文件。
这个应用的活儿很直接:你告诉它要做什么类型的页面,它从三个仓库各取一个,拼出一份品牌一致的 HTML。我盯着这三个目录看了一会儿,脑子里冒出一个问题:这套逻辑,能不能搬进 Claude Code,变成一个 Skill?
答案是能。而且搬完之后我发现,真正值钱的不是那 149 个品牌文件——那些用 Read 就能读到。值钱的是它做决策的方式。
问题
Open Design 的核心是一个三轴组合系统:
- 设计系统(外观) — 149 个品牌的视觉语言,每个品牌一个 DESIGN.md,定义色彩、排版、组件、布局等 9 个维度
- 模板(形态) — 110 个页面类型,从 SaaS 落地页到仪表盘到幻灯片,每个模板一个 SKILL.md
- 工艺规范(质量) — 11 套通用规则:排版、配色、反 AI 味、状态覆盖、无障碍等
三轴的分工很干净:设计系统决定”用什么 token”,工艺规范决定”怎么用这些 token”,模板决定”输出什么形态”。三者冲突时品牌优先,工艺规范只补品牌没覆盖的部分。
这个架构本身就是一种设计模式:关注点分离。品牌视觉和通用质量约束解耦,模板形态和具体内容解耦。先把这层关系吃透,后面写 Skill 才不会写歪。
做法
动手写 Skill 之前,我花了好几天读 Open Design 的源码。目标只有一个:找出它的核心设计模式,不抄代码。最后锁定三个。
模式一:六段拼装
Open Design 的 daemon 有个 composeSystemPrompt(),把系统提示词按固定顺序拼成六段:
# composeSystemPrompt() — six parts, assembled in order
1. Identity & Workflow — agent role and working loop
2. Active Design System — full DESIGN.md of the selected brand
3. Active Craft References — craft specs required by the template
4. Active Template Skill — template SKILL.md workflow
5. Project Metadata — mode, platform, locale, scenario
6. Output Contract — self-contained HTML output contract
每段都有真实内容,不是占位符。举几个例子。
第 1 段 Identity 长这样(节选):“You are Open Design’s design advisor. Your job is to ask, recommend, then build — never skip the questions.” 一句话定住 agent 的人设和铁律。
第 2 段是选中品牌的 DESIGN.md 全文,几千词的 token 定义:主色、辅助色、中性色阶、标题字体、正文字体、圆角、阴影、间距 scale。
第 5 段 Project Metadata 是机器字段:mode=advisor, platform=web, locale=zh-CN, scenario=landing。看着不起眼,但它决定了后面几段怎么被解读。
第 6 段 Output Contract 是输出的军规:“Single self-contained HTML file. Wrap in
这个模式的妙处在于每段独立、可替换、职责单一。搬进 Skill 有个好消息:不用真的拼成一个字符串。agent 用 Read 工具把六个文件分别读进来,效果等价。拼装逻辑变成了”读文件清单”,维护成本直接砍半。
Skill 的精髓是留下"拼装"这个动作本身,换一套更便宜的实现。
提炼手记模式二:顾问式交互
Open Design 的交互方式很固定,只有一条链:
direction -> 5 deep questions -> smart recommendation -> confirm -> build
5 个问题覆盖内容、受众、视觉风格、品牌偏好和规模五个维度。问完之后,匹配算法给模板和设计系统打分,推荐 Top 3 组合,用户拍板后才开工。
搬进 Skill,这条链用 AskUserQuestion 原生实现。一个真实的提问长这样:
{
"question": "这个页面的主要受众是谁?",
"header": "受众",
"options": [
{"label": "面向消费者", "description": "视觉冲击优先,CTA 要明显"},
{"label": "面向企业客户", "description": "信息密度高,信任背书多"},
{"label": "内部团队使用", "description": "功能优先,仪表盘风格"}
],
"multiSelect": false
}
注意每个 option 都带 description。这是顾问式交互的精髓:选项不是裸标签,每个选项都告诉用户”选我会发生什么”。用户不需要懂设计,只需要认识自己的业务。
这个模式的价值在于,选择权一直在用户手里,算法只负责把 149×110 的选项池压成 3 个。算法做减法,人做拍板。
模式三:Token 预览硬门控
开工之前,Open Design 会先展示一个 Token 预览:背景色、强调色和字体。用户必须明确说”开始”,生成才会执行。
这是个 HARD-GATE 模式,专门防止烧 token。门控的措辞我调过几版,最后定成这样:
**Token Preview — confirm before build**
Brand: Linear-style · bg #FFFFFF · accent #5E6AD2
Fonts: Inter / Noto Sans SC
Reply "开始" to generate, or tell me which value to change.
三要素缺一不可:明确列出三个 token 值,给出确认词(“开始”),告诉用户怎么改。不说”确认一下”这种模糊话,模糊的确认等于没有确认。
门控的经济学很直白:一次完整生成烧掉几千 token,问一句的成本几乎为零。所有烧钱的动作前面都应该有一道门。
Skill 的实际结构
三个模式落地成 Skill。先看 frontmatter,这是 Skill 的”大门”,写法直接决定 Claude 会不会进错门:
---
name: open-design
description: |
Use when the user wants to generate brand-consistent web pages or
HTML artifacts with a specific visual identity. Do NOT trigger for
general coding questions, writing tasks, or when the user already
has a complete design spec.
allowed-tools:
- Read
- Write
- Edit
- Bash
- Grep
- Glob
- AskUserQuestion
---
description 的写法是关键细节,记住三段式:动词开头(Use when)加触发场景,再加排除场景。触发条件写具体,Claude 才知道什么时候该进这个 Skill。
这里有个真实踩坑:第一版 description 我写了 “design anything”,结果用户问 CSS bug 也触发 Skill,进来先走 5 个问题,用户当场问号。收紧触发条件后误触发归零。教训:description 是路由规则,写宽了就是 bug。
allowed-tools 是能力的边界:Skill 只能调这 7 个工具。Write 和 Edit 在,Bash 在(跑构建),但没有 WebSearch——查资料这种活不归它管。
正文分六个部分:
1. Identity — agent 人设是”设计顾问”,不是菜单选择器。对应拼装第 1 段。
2. Resource Map — 资源路径表:
OD = /Applications/Open Design.app/Contents/Resources/open-design
$OD/design-systems/<brand>/DESIGN.md
$OD/design-templates/<template>/SKILL.md
$OD/craft/<name>.md
3. Arguments — 四种输入模式:
| 输入 | 模式 | 行为 |
|---|---|---|
| 空 | 顾问 | 完整 5 阶段咨询 |
brand template | 直接 | 跳过问答 |
--browse term | 浏览 | 搜索资源 |
--compare b1 b2 | 对比 | 比较两个设计系统 |
4. Workflow — 5 个阶段的详细流程,每阶段用 AskUserQuestion 推进。
5. Matching Algorithm — 匹配算法的权重公式,见下一节。
6. Output Contract — HTML 必须自包含,用 <artifact> 标签包裹。
匹配算法长什么样
Open Design 的匹配算法把用户的 5 个回答变成分数。公式:
template_score = 3×keyword + 2×scenario + 2×style + 2×scale + 1×featured
design_system_score = 3×style + 3×brand + 2×tone
模板看五个维度,关键词权重最高(3);设计系统看三个维度,风格和品牌并列最高(3)。
搬进 Skill,这个算法不需要写代码。它被表达成一张匹配索引表:agent 读完用户回答,对照表格逐项打分,取 Top 3。这就是 Claude Skill 的独特优势——传统实现要几十行逻辑,这里一张结构化表格搞定。
权重不是拍脑袋定的,是调出来的。几条调参经验:
- 关键词权重 3 是从 1 和 2 试出来的。降到 2,推荐结果开始偏向”场景热门”模板,而不是”语义对得上”的模板。关键词是用户意图最直接的信号,权重必须最高。
featured那 1 分是给新模板的兜底分。新模板没有历史数据,不给这 1 分它们永远排不进 Top 3。- 设计系统评分里品牌权重 3:用户点名要某个品牌时,基本不会改主意。这个维度与其说是评分,不如说是”一票锁定”。
工艺规范的复用
11 套工艺规范是 Open Design 最值钱的部分。它们不绑定任何品牌和模板,是通用的设计质量约束:
- typography — 字号比例 1.2/1.25,行高 1.0-1.6,ALL CAPS tracking ≥0.06em,行长 50-75ch
- color — 4 层调色板(中性色 70-90%,强调色 5-10%,语义色 0-5%,效果色 <1%),每屏最多 2 个强调色
- anti-ai-slop — 7 个必须避免的"罪过":默认靛蓝、双色渐变、emoji 做图标、伪造数据等
- state-coverage — 5 个必需状态:Loading / Empty / Error / Populated / Edge
引用机制:每个模板的 frontmatter 里声明 od.craft.requires,列出它需要的 craft 文件。agent 生成前先把这些文件读了,再同时套用品牌 token 和工艺约束。“读取 + 应用”,两步走。
品牌和工艺打架怎么办?裁决规则是”品牌优先”,量化边界分四条:
- DESIGN.md 明确定义了某个 token(比如主色),品牌值胜出,craft 让路。
- 品牌没覆盖的维度,craft 补位。这是 craft 的主场。
- 品牌值违反 craft 的硬性规则(比如文字对比度低于 4.5:1),agent 必须先警告,警告后仍然执行品牌值,并把这次偏离记下来。警告是义务,执行是权利。
- craft 的”建议级”规则(每屏最多 2 个强调色)无条件让位于品牌;“可访问性硬性规则”走警告流程。
还有个翻车现场:某个模板的 frontmatter 漏写了 od.craft.requires,生成出来的页面颜色是对的,排版全乱。查了半天,发现 craft 文件根本没被读到——引用漏写,约束就静默丢失了。这叫工艺漂移:token 对了,规矩丢了。修法很土:在 Workflow 里加一步硬检查,生成前必须列出已加载的 craft 文件,缺了就停。
结果
搬完之后,实际效果分两类。
能做到的:
- 完整的顾问式交互流程
- Top 3 智能推荐
- 品牌一致的 HTML 输出
- 工艺规范自动应用
- Browse 和 Compare 模式
做不到的,以及为什么:
- 设备框架的像素级渲染——要应用内的 frame 二进制资源,Skill 只能读文本文件,拿不到。
- 实时预览——要应用的 preview pane 进程,Skill 跑在 Claude Code 里,没有那个运行时。
- 部分模板的复杂动画——依赖应用内动画引擎,HTML 自包含输出带不动。
- 社区宠物之类的装饰功能——和生成逻辑无关,提炼时直接丢掉。
这个”做不到”清单恰恰划出了 Skill 的适用边界。Skill 提炼的是决策逻辑;凡是依赖特定运行时、二进制资源、原生 UI 的体验层,都留在应用里。能变成”读文件 + 做判断 + 写文件”的部分,才值得搬。
现状
从 Open Design 这个案例里,可以提炼出一套通用方法:
识别核心架构
别急着写代码。先回答:这个应用由哪几个独立部分组成?它们之间是什么关系?Open Design 的答案是三轴:外观、形态、质量,互相解耦。
找到设计模式
每个架构决策背后都有模式。关注点分离、顾问式交互、硬门控——模式比实现值钱,因为模式可以换载体,实现不行。
用 Claude 原生能力重新表达
Skill 是逻辑的重新表达。用 AskUserQuestion 代替 UI 交互,用表格代替算法,用 Read 代替文件加载。找最便宜的等价实现。
定义边界
明确写出"做不到"清单。不要试图复制整个应用,提炼最有价值的部分。边界写得越清楚,Skill 越不容易被误用。
测试和迭代
拿 3 个真实任务跑一遍。匹配权重、description 触发条件、门控措辞,全部是在试用里调出来的,不是在纸上想出来的。
代码会过时,决策链能穿越换代。“先问再推荐,推荐完先预览,预览完再开工”——这套链条换个载体照样能用。
现在就能动手
别光看,今天就能开干:
- 找一个你常用的复杂应用,钻进它的资源目录或源码。找那种”每次都在重复做决策”的部分——决策流程越固定,越值得提炼。
- 画一张资源映射表:它有哪几类资源?分别管什么?互相什么关系?冲突时谁优先?一张表讲不清,就别动手写 Skill。
- 写 Skill 的 frontmatter:name 取短名,description 按”动词开头 + 触发场景 + 排除场景”写,allowed-tools 只给必要的。写完后自己当 Claude 读三遍,问一句”会不会误触发”。
- 写正文六件套:Identity、Resource Map、Arguments、Workflow、匹配索引表、Output Contract。先搭骨架,再填内容。
- 拿 3 个真实任务试跑:记录推荐准不准、门控有没有拦住浪费、description 有没有误触发。调权重,收紧措辞。
- 给烧 token 的动作加硬门控:预览 → 确认词 → 执行。确认词要具体(比如”开始”),不要”确认一下”。
本篇的 X 速览版
1/10 我把一个装了 149 个设计系统的 macOS 应用,塞进了 Claude Code 的一个 Skill 里。最意外的发现:最难的不是写代码,是 description 里的一句话。🧵
2/10 Open Design 的核心是三轴组合:149 个品牌设计系统(外观)× 110 个页面模板(形态)× 11 套工艺规范(质量)。设计系统定”用什么 token”,工艺规范定”怎么用”,模板定”输出什么形态”。
3/10 动手前我花了好几天读源码,目标只有一个:找出它的核心设计模式,不抄代码。锁定三个:六段拼装、顾问式交互、Token 预览硬门控。模式比实现值钱,因为模式可以换载体。
4/10 六段拼装:Identity → Design System → Craft Refs → Template → Metadata → Output Contract。每段独立可替换。Skill 里不用真拼字符串,agent 用 Read 分开读,效果等价,维护成本砍半。
5/10 顾问式交互:5 个固定问题(内容/受众/风格/品牌/规模)→ 算法打分 → Top 3 推荐 → 用户拍板。AskUserQuestion 的每个选项都要带 description,告诉用户”选我会发生什么”。
6/10 匹配公式:template = 3×关键词 + 2×场景 + 2×风格 + 2×规模 + 1×featured。关键词权重 3 是试出来的,降到 2 推荐就开始跑偏。Skill 里不用写代码,一张匹配索引表搞定。
7/10 Token 预览硬门控:开工前先展示背景色/强调色/字体,用户回”开始”才执行。措辞三要素:列出值、给确认词、告诉用户怎么改。一次生成烧几千 token,问一句几乎零成本。
8/10 真实踩坑①:description 写了 “design anything”,用户问 CSS bug 也触发 Skill,进来先走 5 个问题。description 是路由规则,写宽了就是 bug。
9/10 真实踩坑②:模板 frontmatter 漏写 od.craft.requires,生成页面颜色对、排版全乱——craft 文件根本没被读到。这叫工艺漂移。修法:在 Workflow 里加硬检查,缺 craft 就停。
10/10 通用方法五步:识别架构 → 找模式 → 用 Claude 原生能力重表达 → 定义边界 → 试跑迭代。代码会过时,决策链能穿越换代。全文:https://citygenius-blog.pages.dev/article/open-design-to-skill
常见问题
三轴组合具体指什么?
设计系统(外观:149 个品牌的视觉语言,每个品牌一个 DESIGN.md)、模板(形态:110 个页面类型,每个模板一个 SKILL.md)、工艺规范(质量:11 套通用规则)。设计系统决定”用什么 token”,工艺规范决定”怎么用这些 token”,模板决定”输出什么形态”;冲突时品牌优先,工艺规范补品牌没覆盖的部分。
转成 Skill 后,哪些功能迁不过来?
设备框架的像素级渲染(要应用内二进制资源)、实时预览(要应用的 preview pane 进程)、部分模板的复杂动画(依赖应用内运行时)。这些是”应用体验”层。但顾问式交互、Top 3 推荐、品牌一致的 HTML 输出、工艺规范自动应用,核心链路全通。
匹配算法在 Skill 里怎么实现?
不用写代码,用匹配索引表。template_score = 3×keyword + 2×scenario + 2×style + 2×scale + 1×featured,agent 对照表格打分取 Top 3。权重是调出来的:关键词 3 是试出来的最低有效值,featured 的 1 分是新模板的兜底。
description 里的触发条件怎么写?
记住三段式:动词开头(Use when)加触发场景,再加排除场景。触发条件写具体,排除场景写清楚。description 是路由规则,不是广告词,写宽了会导致误触发。
提炼设计模式的通用方法是什么?
五步:识别核心架构(哪几个独立部分、什么关系);找到设计模式;用 Claude 原生能力重新表达(AskUserQuestion 代 UI 交互、表格代算法);定义边界(写出”做不到”清单);测试迭代(拿真实任务跑,调权重和措辞)。