项目简介
定义了一种结合 YAML 设计令牌与 Markdown 说明的设计格式。提供命令行工具进行校验和差异比较,让编码代理能够持久理解设计系统。
README 预览
# DESIGN.md\n\nA format specification for describing a visual identity to coding agents. DESIGN.md gives agents a persistent, structured understanding of a design system.\n\n## The Format\n\nA DESIGN.md file combines machine-readable design tokens (YAML front matter) with human-readable design rationale (markdown prose). Tokens give agents exact values. Prose tells them *why* those values exist and how to apply them.\n\n```md\n---\nname: Heritage\ncolors:\n primary: "#1A1C1E"\n secondary: "#6C7278"\n tertiary: "#B8422E"\n neutral: "#F7F5F2"\ntypography:\n h1:\n fontFamily: Public Sans\n fontSize: 3rem\n body-md:\n fontFamily: Public Sans\n fontSize: 1rem\n label-caps:\n fontFamily: Space Grotesk\n fontSize: 0.75rem\nrounded:\n sm: 4px\n md: 8px\nspacing:\n sm: 8px\n md: 16px\n---\n\n## Overview\n\nArchitectural Minimalism meets Journalistic Gravitas. The UI evokes a\npremium matte finish — a high-end broadsheet or contemporary gallery.\n\n## Colors\n\nThe palette is rooted in high-contrast neutrals and a single accent color.\n\n- **Primary (#1A1C1E):** Deep ink for headlines and core text.\n- **Secondary (#6C7278):** Sophisticated slate for borders, captions, metadata.\n- **Tertiary (#B8422E):** "Boston Clay" — the sole driver for interaction.\n- **Neutral (#F7F5F2):** Warm limestone foundation, softer than pure white.\n```\n\nAn agent that reads this file will produce a UI with deep ink headlines in Public Sans, a warm limestone background, and Boston Clay call-to-action buttons.\n\n## Getting Started\n\nValidate a DESIGN.md against the spec, catch broken token references, check WCAG contrast ratios, and surface structural findings — all as structured JSON that agents can act on.\n\n```bash\nnpx @google/design.md lint DESIGN.md\n```\n\n```json\n{\n "findings": [\n {\n "severity": "warning",\n "path": "components.button-primary",\n "message": "textColor (#ffffff) on backgroundColor (#1A1C1E) has contrast ratio 15.42:1