DESIGN.md Visual System (implementation-grade)
Persistent design contract for coding agents — the design-side peer of AGENTS.md:
machine tokens plus the judgment tokens alone cannot carry.
Genre gate (read first)
Liz has two different documents both sometimes called DESIGN.md:
| Genre |
Job |
Skill |
| A — Visual system |
Machine tokens + prose so a coding agent can implement UI/slides/landings without inventing taste |
This skill |
| B — Brand / distribution brief |
Product identity, audience, motion/OG/favicon briefs for image AI |
design-brief-authoring / design-brief-for-image-gen |
If Liz says 「写 DESIGN.md」without context: ask which job, or infer from target (slide template / landing system → A; favicon·OG·生图 → B). Do not ship a thin vibe paragraph and call it done. Do not replace a good B-doc with A or vice versa — split into two files if both jobs exist.
Gold corpus (bundled): references/gold-corpus/<template>/design.md — all 34 templates, structure-verified (lint profile + refresh in references/gold-corpus/README.md). External sources: the beautiful-html-templates tool (templates/*/design.md); public mirror github.com/zarazhangrui/beautiful-html-templates.
Primary reference: references/gold-corpus/soft-editorial/design.md (+ signal, monochrome, bold-poster, grove for contrast).
Google format + CLI: npx -y @google/design.md (lint / export / spec) — upstream spec lives at google-labs-code/design.md (not google/design.md).
Bar (what "not garbage" means)
Thin tokens + 6 vibe bullets = fail. Gold files are ~500–700 lines and always carry:
- YAML frontmatter — normative tokens agents can copy
- Overview with density philosophy + Key Characteristics bullets
- Signature Treatments — non-optional when that element type appears
- Defaults subsections (when unsure, reach for X)
- Do / Don't paired and specific
- CJK & International + Iteration Guide + Known Gaps
Full anatomy → references/anatomy-and-patterns.md
Rubric + audit blockquote → references/quality-rubric.md
Mini skeleton → references/skeleton.md
Authoring workflow
- Confirm genre A. If B, switch skills.
- Extract, don't invent. Pull colors/type/radius/shadows from real CSS/HTML (or from a chosen gold template). Ground truth > vibe.
- Name the system in one paragraph (cultural refs + what it is not). Put that in
description: and expand in Overview.
- Lock 1–3 signature moves (e.g. Signal = gold italic mid-sentence; Soft Editorial = roman/italic weight drop + pastel cards; Raw Grid = 3px black borders + hard offset shadow). These become Signature Treatments.
- Write YAML first:
version (Google format still uses alpha), name, description, colors, typography (role tokens), spacing, canvas (if slide/deck), components (each needs a description:). Optional: color-aliases, borders, shadows, rounded/radii, motion. Note: canvas is a local extension — the official CLI schema ignores it on export (kept for agent prose context only).
- Prefer a light token ladder: primitive hex in
colors → semantic roles in color-aliases → component props via {colors.x} / {typography.y} refs. Do not paste DTCG $value / $type JSON into the YAML — that is an export target, not the authoring format.
- Write body in canonical order (see anatomy). Every color/type role gets prose why + Defaults.
- Lint when structure is Google-shaped:
npx -y @google/design.md lint DESIGN.md. Fix broken refs.
- Optional export when a build pipeline needs it:
npx -y @google/design.md export --format css-tailwind DESIGN.md (Tailwind v4 @theme)
npx -y @google/design.md export --format json-tailwind DESIGN.md (v3 theme.extend)
npx -y @google/design.md export --format dtcg DESIGN.md (W3C Design Tokens Format)
Genre A DESIGN.md stays the agent-facing source; DTCG/Tailwind outputs are interchange, not a reason to delete prose.
- Self-score with rubric. Below 7/10 on Structure or Signature → keep writing.
Interoperability (keep boundaries clear)
| Artifact |
Job |
| Genre A DESIGN.md |
Coding-agent contract: tokens + rationale + signatures |
DTCG tokens.json |
Cross-tool / multi-platform token exchange |
| Tailwind theme / CSS vars |
Runtime styling in the app |
| Genre B brief |
Image/motion/OG identity — separate file |
Do not collapse these into one thin file. If a mature design-ops pipeline already treats DTCG as canonical for mobile+web codegen, keep DESIGN.md as the AI-facing mirror of a subset plus the judgment layer — still extract, don't invent.
Placement
- Slide/template pack: beside the template (
design.md lowercase OK — match corpus).
- Product UI system:
docs/DESIGN.system.md or docs/visual-system.md if docs/DESIGN.md is already genre B.
- Prefer not to overwrite a strong brand brief; split.
Evolution
- Google DESIGN.md format remains
version: alpha in file frontmatter — expect schema drift; re-lint after CLI upgrades.
- Iteration Guide = rules for additive change without drift.
- Known Gaps = intentional absences + debts (also serves as a lightweight changelog of what not to "fix").
- Skill pack version (this file's
version:) is independent of the Google format alpha tag.
- Bundled corpus lint profile: 10/34 files are 0-error canaries (list in
references/gold-corpus/README.md); the rest warn/error only on clamp()/vw responsive sizes + schema-extension keys — intentional, not defects. Never cite a non-canary corpus file as a lint-clean example.
Anti-patterns
- ❌ Genre confusion (OG brief pretending to be UI system, or vice versa)
- ❌ Invented hex/fonts not in code or chosen reference
- ❌ YAML without component
description: / body without Signature Treatments
- ❌ Inter/Roboto default stack with no role separation (display / body / mono chrome)
- ❌ "Use generous whitespace" with no pad tokens or density philosophy
- ❌ Semantic rainbow (success green / warn yellow) forced onto a monochrome or single-accent system
- ❌ Replacing DESIGN.md prose with DTCG-only JSON and hoping agents infer taste
- ❌ Deleting existing DESIGN.md wholesale — enhance or split
References
Google DESIGN.md 规范/CLI(外部权威源,URL 逐个 curl 验证)
- Spec 仓库 —
https://github.com/google-labs-code/design.md — 证据 高(200)— 用途:格式规范/字段定义/上游变更;旧路径 google/design.md 已 404
- Stitch spec 可读版 —
https://stitch.withgoogle.com/docs/design-md/specification — 证据 高(200)— 用途:人读规范,比 repo 好读
- Stitch overview —
https://stitch.withgoogle.com/docs/design-md/overview — 证据 高(200)— 用途:DESIGN.md 是什么/何时用
- npm 包 —
https://registry.npmjs.org/@google/design.md — 证据 高(200,latest 0.4.0)— 用途:CLI 版本/lint/export 行为变化
- 官方博客公告 —
https://blog.google/innovation-and-ai/models-and-research/google-labs/stitch-design-md/ — 证据 高(200)— 用途:设计动机与边界
令牌标准(DTCG)
- Format 2025.10 —
https://www.designtokens.org/tr/2025.10/format/ — 证据 高(200)— 用途:export --format dtcg 的目标格式;跨工具互通讨论
本地兜底/工具
- CLI 权威 schema —
npx -y @google/design.md spec — 证据 高(本机实测)— 用途:字段合法性裁决(lint 报错时先查它,别猜)
- Gold corpus 真源(刷新镜像用)— 本地
beautiful-html-templates 工具 templates/*/design.md 或公开镜像 github.com/zarazhangrui/beautiful-html-templates — 用途:更新 references/gold-corpus/(见其 README)
- Hermes bundled
design-md — 用途:CLI 封装入口
Related
- Spec/CLI lint-export: Hermes bundled
design-md / npx @google/design.md
- Brand/OG briefs:
design-brief-authoring, design-brief-for-image-gen
- Steal motion/structure from live sites:
creative-artifact-production → design-template-extraction
- Frontend slides fixed 1920×1080 stage policy: see bold-poster / grove templates' "Frontend Slides Fixed-Stage Policy" section when generating decks
1---2name: design-md-visual-system3description: Use when writing or auditing Genre-A UI DESIGN.md visual systems for coding agents: YAML tokens + prose (Signature Treatments, Defaults, Do/Don't, CJK, Iteration, Known Gaps). Extract from real CSS/HTML or a gold template; lint and optionally export via npx @google/design.md. Not for brand/OG/image briefs (Genre B — use design-brief skills instead).4license: MIT5---67# DESIGN.md Visual System (implementation-grade)89Persistent design contract for coding agents — the design-side peer of `AGENTS.md`:10machine tokens plus the judgment tokens alone cannot carry.1112## Genre gate (read first)1314Liz has **two different documents** both sometimes called DESIGN.md:1516| Genre | Job | Skill |17|---|---|---|18| **A — Visual system** | Machine tokens + prose so a coding agent can *implement* UI/slides/landings without inventing taste | **This skill** |19| **B — Brand / distribution brief** | Product identity, audience, motion/OG/favicon briefs for *image* AI | `design-brief-authoring` / `design-brief-for-image-gen` |2021If Liz says 「写 DESIGN.md」without context: ask which job, or infer from target (slide template / landing system → A; favicon·OG·生图 → B). **Do not** ship a thin vibe paragraph and call it done. **Do not** replace a good B-doc with A or vice versa — split into two files if both jobs exist.2223**Gold corpus (bundled):** `references/gold-corpus/<template>/design.md` — all 34 templates, structure-verified (lint profile + refresh in `references/gold-corpus/README.md`). External sources: the `beautiful-html-templates` tool (`templates/*/design.md`); public mirror `github.com/zarazhangrui/beautiful-html-templates`. 24Primary reference: `references/gold-corpus/soft-editorial/design.md` (+ `signal`, `monochrome`, `bold-poster`, `grove` for contrast). 25Google format + CLI: `npx -y @google/design.md` (`lint` / `export` / `spec`) — upstream spec lives at `google-labs-code/design.md` (not `google/design.md`).2627## Bar (what "not garbage" means)2829Thin tokens + 6 vibe bullets = fail. Gold files are ~500–700 lines and always carry:30311. **YAML frontmatter** — normative tokens agents can copy322. **Overview** with *density philosophy* + **Key Characteristics** bullets333. **Signature Treatments** — *non-optional* when that element type appears344. **Defaults** subsections (when unsure, reach for X)355. **Do / Don't** paired and specific366. **CJK & International** + **Iteration Guide** + **Known Gaps**3738Full anatomy → `references/anatomy-and-patterns.md` 39Rubric + audit blockquote → `references/quality-rubric.md` 40Mini skeleton → `references/skeleton.md`4142## Authoring workflow43441. **Confirm genre A.** If B, switch skills.452. **Extract, don't invent.** Pull colors/type/radius/shadows from real CSS/HTML (or from a chosen gold template). Ground truth > vibe.463. **Name the system in one paragraph** (cultural refs + what it is *not*). Put that in `description:` and expand in Overview.474. **Lock 1–3 signature moves** (e.g. Signal = gold italic mid-sentence; Soft Editorial = roman/italic weight drop + pastel cards; Raw Grid = 3px black borders + hard offset shadow). These become Signature Treatments.485. **Write YAML** first: `version` (Google format still uses `alpha`), `name`, `description`, `colors`, `typography` (role tokens), `spacing`, `canvas` (if slide/deck), `components` (each needs a `description:`). Optional: `color-aliases`, `borders`, `shadows`, `rounded`/`radii`, `motion`. Note: `canvas` is a local extension — the official CLI schema ignores it on export (kept for agent prose context only).49 - Prefer a light **token ladder**: primitive hex in `colors` → semantic roles in `color-aliases` → component props via `{colors.x}` / `{typography.y}` refs. Do not paste DTCG `$value` / `$type` JSON into the YAML — that is an export target, not the authoring format.506. **Write body in canonical order** (see anatomy). Every color/type role gets prose *why* + Defaults.517. **Lint** when structure is Google-shaped: `npx -y @google/design.md lint DESIGN.md`. Fix broken refs.528. **Optional export** when a build pipeline needs it:53 - `npx -y @google/design.md export --format css-tailwind DESIGN.md` (Tailwind v4 `@theme`)54 - `npx -y @google/design.md export --format json-tailwind DESIGN.md` (v3 `theme.extend`)55 - `npx -y @google/design.md export --format dtcg DESIGN.md` (W3C Design Tokens Format)56 Genre A DESIGN.md stays the **agent-facing** source; DTCG/Tailwind outputs are interchange, not a reason to delete prose.579. **Self-score** with rubric. Below 7/10 on Structure or Signature → keep writing.5859## Interoperability (keep boundaries clear)6061| Artifact | Job |62|---|---|63| **Genre A DESIGN.md** | Coding-agent contract: tokens + rationale + signatures |64| **DTCG `tokens.json`** | Cross-tool / multi-platform token exchange |65| **Tailwind theme / CSS vars** | Runtime styling in the app |66| **Genre B brief** | Image/motion/OG identity — separate file |6768Do not collapse these into one thin file. If a mature design-ops pipeline already treats DTCG as canonical for mobile+web codegen, keep DESIGN.md as the AI-facing mirror of a *subset* plus the judgment layer — still extract, don't invent.6970## Placement7172- Slide/template pack: beside the template (`design.md` lowercase OK — match corpus).73- Product UI system: `docs/DESIGN.system.md` or `docs/visual-system.md` if `docs/DESIGN.md` is already genre B.74- Prefer not to overwrite a strong brand brief; **split**.7576## Evolution7778- Google DESIGN.md format remains `version: alpha` in file frontmatter — expect schema drift; re-lint after CLI upgrades.79- **Iteration Guide** = rules for additive change without drift.80- **Known Gaps** = intentional absences + debts (also serves as a lightweight changelog of what not to "fix").81- Skill pack version (this file's `version:`) is independent of the Google format `alpha` tag.82- Bundled corpus lint profile: 10/34 files are 0-error canaries (list in `references/gold-corpus/README.md`); the rest warn/error only on `clamp()`/`vw` responsive sizes + schema-extension keys — intentional, not defects. Never cite a non-canary corpus file as a lint-clean example.8384## Anti-patterns8586- ❌ Genre confusion (OG brief pretending to be UI system, or vice versa)87- ❌ Invented hex/fonts not in code or chosen reference88- ❌ YAML without component `description:` / body without Signature Treatments89- ❌ Inter/Roboto default stack with no role separation (display / body / mono chrome)90- ❌ "Use generous whitespace" with no pad tokens or density philosophy91- ❌ Semantic rainbow (success green / warn yellow) forced onto a monochrome or single-accent system92- ❌ Replacing DESIGN.md prose with DTCG-only JSON and hoping agents infer taste93- ❌ Deleting existing DESIGN.md wholesale — enhance or split9495## References9697**Google DESIGN.md 规范/CLI(外部权威源,URL 逐个 curl 验证)**98- Spec 仓库 — `https://github.com/google-labs-code/design.md` — 证据 高(200)— 用途:格式规范/字段定义/上游变更;旧路径 `google/design.md` 已 40499- Stitch spec 可读版 — `https://stitch.withgoogle.com/docs/design-md/specification` — 证据 高(200)— 用途:人读规范,比 repo 好读100- Stitch overview — `https://stitch.withgoogle.com/docs/design-md/overview` — 证据 高(200)— 用途:DESIGN.md 是什么/何时用101- npm 包 — `https://registry.npmjs.org/@google/design.md` — 证据 高(200,latest 0.4.0)— 用途:CLI 版本/lint/export 行为变化102- 官方博客公告 — `https://blog.google/innovation-and-ai/models-and-research/google-labs/stitch-design-md/` — 证据 高(200)— 用途:设计动机与边界103104**令牌标准(DTCG)**105- Format 2025.10 — `https://www.designtokens.org/tr/2025.10/format/` — 证据 高(200)— 用途:`export --format dtcg` 的目标格式;跨工具互通讨论106107**本地兜底/工具**108- CLI 权威 schema — `npx -y @google/design.md spec` — 证据 高(本机实测)— 用途:字段合法性裁决(lint 报错时先查它,别猜)109- Gold corpus 真源(刷新镜像用)— 本地 `beautiful-html-templates` 工具 `templates/*/design.md` 或公开镜像 `github.com/zarazhangrui/beautiful-html-templates` — 用途:更新 `references/gold-corpus/`(见其 README)110- Hermes bundled `design-md` — 用途:CLI 封装入口111112## Related113114- Spec/CLI lint-export: Hermes bundled `design-md` / `npx @google/design.md`115- Brand/OG briefs: `design-brief-authoring`, `design-brief-for-image-gen`116- Steal motion/structure from live sites: `creative-artifact-production` → design-template-extraction117- Frontend slides fixed 1920×1080 stage policy: see bold-poster / grove templates' "Frontend Slides Fixed-Stage Policy" section when generating decks