design-md-visual-system
Skill0 starsChanged 3 months agoMITView on GitHub
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).
In this repository11 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 67
Confirm genre A: If B, switch skills.
- Very specific: line 72
Prefer a light token ladder: primitive hex in colors → semantic roles in color-aliases → component props via {colors.x} / {typography.y} …
- Very specific: line 74
Lint: when structure is Google-shaped: npx -y @google/design.md lint DESIGN.md.
- Distinctive: line 75
Optional export: when a build pipeline needs it:
- Distinctive: line 91
Do not collapse these into one thin file.
- Distinctive: line 97
Prefer not to overwrite a strong brand brief.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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 usesalpha),name,description,colors,typography(role tokens),spacing,canvas(if slide/deck),components(each needs adescription:). Optional:color-aliases,borders,shadows,rounded/radii,motion. Note:canvasis 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 incolor-aliases→ component props via{colors.x}/{typography.y}refs. Do not paste DTCG$value/$typeJSON into the YAML — that is an export target, not the authoring format.
- Prefer a light token ladder: primitive hex in
- 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(v3theme.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.mdlowercase OK — match corpus). - Product UI system:
docs/DESIGN.system.mdordocs/visual-system.mdifdocs/DESIGN.mdis already genre B. - Prefer not to overwrite a strong brand brief; split.
Evolution
- Google DESIGN.md format remains
version: alphain 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 formatalphatag. - Bundled corpus lint profile: 10/34 files are 0-error canaries (list in
references/gold-corpus/README.md); the rest warn/error only onclamp()/vwresponsive 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
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

