Rubric Labs
최종 정리전체Ch 28 / 28

다시 읽는 큰 그림

27챕터의 교훈 + 여러분의 작업에 가져갈 원리 10개

원문 발췌 · L1356
<!-- Generated from spec.mdx + spec-config.ts | version: alpha -->
<!-- Do not edit directly. Run `bun run spec:gen` to regenerate. -->

# DESIGN.md Format

DESIGN.md is a self-contained, plain-text representation of a design system. It defines the visual identity of a brand and product, thereby ensuring that these stylistic choices can be followed across design sessions and between different AI agents and tools.  As a human-readable, open-format document, it serves as a living source of truth that both humans and AI can understand and refine.

A DESIGN.md file contains two parts: An optional YAML frontmatter, and a markdown body. The YAML front matter contains machine-readable design tokens. The markdown body sections provide human-readable design rationale and guidance. Prose may use descriptive color names (e.g., "Midnight Forest Green") that correspond to systematic token names (e.g., `primary`). The tokens are the normative values; the prose provides context for how to apply them.

# Design Tokens

DESIGN.md may embed design tokens in a structured format. The system that we use to describe design tokens is inspired by the
[Design Token JSON spec](https://www.designtokens.org/tr/2025.10/format/#abstract). Specifically, we adopt the concept of typed token groups (colors, typography, spacing) and the `{path.to.token}` reference syntax for cross-referencing values.

These tokens are easily converted from or to `tokens.json`, Figma variables, and Tailwind theme configs.

Design tokens are embedded as YAML front matter at the beginning of the file. The front matter block must begin with a line containing exactly `---` and end with a line containing exactly `---`. The YAML content between these delimiters is parsed according to the schema defined below.

Example:

```yaml
---
version: alpha
name: Daylight Prestige
colors:
  primary: "#1A1C1E"
  secondary: "#6C7278"
  tertiary: "#B8422E"
typography:
  h1:
    fontFamily: Public Sans
    fontSize: 48px
    fontWeight: 600
    lineHeight: 1.1
    letterSpacing: -0.02em
---
```

## Schema

Below is the schema for the design tokens defined in the front matter:

```yaml
version: <string>          # optional, current version: "alpha"
name: <string>
description: <string>      # optional
colors:
  <token-name>: <Color>
typography:
  <token-name>: <Typography>
rounded:
  <scale-level>: <Dimension>
spacing:
  <scale-level>: <Dimension | number>
components:
  <component-name>:
    <token-name>: <string|token reference>
```

The `<scale-level>` placeholder represents a named level in a sizing or spacing scale. Common level names include `xs`, `sm`, `md`, `lg`, `xl`, and `full`. Any descriptive string key is valid.

**Color**: A color value must start with "#" followed by a hex color code in the SRGB color space.

- `fontFamily` (string)
- `fontSize` (Dimension)
- `fontWeight` (number) - A numeric font weight value (e.g., `400`, `700`). In YAML, this may be expressed as either a bare number or a quoted string; both are equivalent.
- `lineHeight` (Dimension | number) - Accepts either a Dimension (e.g., `24px`, `1.5rem`) or a unitless number (e.g., `1.6`). A unitless number represents a multiplier of the element's `fontSize`, which is the recommended CSS practice.
- `letterSpacing` (Dimension)
- `fontFeature` (string) - configures
  [`font-feature-settings`](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/font-feature-settings).
- `fontVariation` (string) - configures
  [`font-variation-settings`](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/font-variation-settings).

**Dimension**: A dimension value is a string with a unit suffix. Valid units are: px, em, rem.

**Token References**: A token reference must be wrapped in curly braces, and contain an object path to another value in the YAML tree. For most token groups, the reference must point to a primitive value (e.g., `colors.primary-60`), not a group (e.g., `colors`). Within the `components` section, references to composite values (e.g., `{typography.label-md}`) are permitted.

# Sections

Every `DESIGN.md` follows the same structure. Sections can be omitted if they're not relevant to your project, but those present should appear in the sequence listed below. All sections use `<h2>` (`##`) headings. An optional `<h1>` heading may appear for document titling purposes but is not parsed as a section.

### Section Order

1. **Overview** (also: "Brand & Style")
2. **Colors**
3. **Typography**
4. **Layout** (also: "Layout & Spacing")
5. **Elevation & Depth** (also: "Elevation")
6. **Shapes**
7. **Components**
8. **Do's and Don'ts**

### Prose and Tokens

## Overview

Also known as "Brand & Style".

This section is a holistic description of a product's look and feel. It defines the brand personality, target audience, and the emotional response the UI should evoke, such as whether it should feel playful or professional, dense or spacious. It serves as foundational context for guiding the agent's high-level stylistic decisions when a specific rule or token isn't explicitly defined.

## Colors

This section defines the color palettes for the design system.

At least the `primary` color palette must be defined, and additional color palettes may be defined as needed.

When there are multiple color palettes, the design system may assign a semantic role for each palette. A common convention is to name the palettes in this order: `primary`, `secondary`, `tertiary`, and `neutral`.

Example:

```markdown
## Colors

The palette is rooted in high-contrast neutrals and a single, evocative accent color.

- **Primary (#1A1C1E):** A deep ink used for headlines and core text to provide
  maximum readability and a sense of permanence.
- **Secondary (#6C7278):** A sophisticated slate used primarily for utilitarian
  elements like borders, captions, and metadata.
- **Tertiary (#B8422E):** A vibrant earthy red as the sole driver for
  interaction, used exclusively for primary actions and critical highlights.
- **Neutral (#F7F5F2):** A warm limestone that serves as the foundation for all
  pages, providing a softer, more organic feel than pure white.
```

### Design Tokens

The `colors` section defines all color design tokens. The color tokens should be derived from the key color palettes defined in the markdown prose. The exact mapping from color palettes to color tokens may follow any consistent naming convention.

It is a
map\<string, Color>, that maps the name of the color token to its value.

```yaml
colors:
  primary: "#1A1C1E"
  secondary: "#6C7278"
  tertiary: "#B8422E"
  neutral: "#F7F5F2"
```

## Typography

This section defines typography levels.

Most design systems have 9 - 15 typography levels. The design system may prescribe a role for each typography level.

A common naming convention for typography levels is to use semantic categories such as `headline`, `display`, `body`, `label`, `caption`. Each category may further be divided into different sizes, such as `small`, `medium`, and `large`.

Example:

```markdown
## Typography

The typography strategy leverages two distinct weights of **Public Sans** for
the narrative and **Space Grotesk** for technical data.

- **Headlines:** Set in Public Sans Semi-Bold to establish an institutional
  and trustworthy voice.
- **Body:** Public Sans Regular at 16px ensures contemporary professionalism
  and long-form readability.
- **Labels:** Space Grotesk is used for all technical data, timestamps, and
  metadata. Its geometric construction evokes the precision of a digital
  stopwatch. Labels are strictly uppercase with generous letter spacing.
```

### Design Tokens

The `typography` section defines the precise font properties for the typography design tokens.

It is a
map\<string, Typography>

```yaml
typography:
  h1:
    fontFamily: Public Sans
    fontSize: 48px
    fontWeight: 600
    lineHeight: 1.1
    letterSpacing: -0.02em
  body-md:
    fontFamily: Public Sans
    fontSize: 16px
    fontWeight: 400
    lineHeight: 1.6
  label-caps:
    fontFamily: Space Grotesk
    fontSize: 12px
    fontWeight: 500
    lineHeight: 1
    letterSpacing: 0.1em
```

## Layout

Also known as "Layout & Spacing".

This section describes the layout and spacing strategy.

Many design systems follow a grid-based layout. Others, like Liquid Glass, use margins, safe areas, and dynamic padding.

Example:

```markdown
## Layout

The layout follows a **Fluid Grid** model for mobile devices and a
**Fixed-Max-Width Grid** for desktop (max 1200px).

A strict 8px spacing scale (with a 4px half-step for micro-adjustments) is used to maintain a consistent rhythm. Components are grouped using "containment" principles, where related items are housed in cards with generous internal padding (24px) to emphasize the soft, approachable nature of the brand.
```

### Design Tokens

The spacing section defines the spacing design tokens. These may include spacing units that are useful for implementing the layout model. For example, a fixed grid layout may have spacing units for column spans, gutters, and margins.

It is a
map\<string, Dimension | number> that maps the spacing scale identifier to a dimension value or a unitless number (e.g., column counts or ratios).

```yaml
spacing:
  base: 16px
  xs: 4px
  sm: 8px
  md: 16px
  lg: 32px
  xl: 64px
  gutter: 24px
  margin: 32px
```

## Elevation & Depth

Also known as "Elevation".

This section describes how visual hierarchy is conveyed based on the design style. If elevation is used, it defines the required styling (spread, blur, color). For flat designs, this section explains the alternative methods used to convey visual hierarchy (e.g., borders, color contrast).

Example:

```markdown
## Elevation & Depth

Depth is achieved through **Tonal Layers** rather than heavy shadows. The
background uses a soft off-white or very light green, while primary content sits on pure white cards.
```

## Shapes

This section describes how visual elements are shaped.

Example:

```markdown
## Shapes

The shape language is defined by **Architectural Sharpness**. All interactive
elements, containers, and inputs utilize a minimal **4px corner radius**. This
provides just enough softness to feel modern while maintaining a rigid,
engineered aesthetic.
```

### Design Tokens

The `rounded` section defines the design tokens for rounded corners used in
buttons, cards, and other rectangular shapes.

It is a map\<string, Dimension>.

```yaml
rounded:
  sm: 4px
  md: 8px
  lg: 12px
  full: 9999px
```

## Components

This section provides style guidance for component atoms within the design system. The following are common component types. Design systems are encouraged to define additional components relevant to their domain.

* **Buttons**: Covers primary, secondary, and tertiary variants, including sizing, padding, and states.
* **Chips**: Covers selection chips, filter chips, and action chips.
* **Lists**: Covers styling for list items, dividers, and leading/trailing elements.
* **Tooltips**: Covers positioning, colors, and timing.
* **Checkboxes**: Covers checked, unchecked, and indeterminate states.
* **Radio buttons**: Covers selected and unselected states.
* **Input fields**: Covers text inputs, text areas, labels, helper text, and error states.

> **Note:** The components specification is actively evolving. The current structure provides intentional flexibility for domain-specific component definitions while the spec matures.

### Design Tokens

The components section defines a collection of design tokens used to ensure consistent styling of common components. It's a map\<string, map\<string, string>> that maps a component identifier to a group of sub token names and values. The design token values may be literal values, or references to previously defined design tokens.

**Variants**. A component may have a variant for different UI states such as active, hover, pressed, etc. Those variant components may be defined under a different but related key, for example, "button-primary", "button-primary-hover", "button-primary-active". The agent will consider all variants and make the appropriate styling decisions.

```yaml
components:
  button-primary:
    backgroundColor: "{colors.primary-60}"
    textColor: "{colors.primary-20}"
    rounded: "{rounded.md}"
    padding: 12px
  button-primary-hover:
    backgroundColor: "{colors.primary-70}"
```

### Component Property Tokens

Each component has a set of properties that are themselves design tokens:

- backgroundColor: \<Color\>
- textColor: \<Color\>
- typography: \<Typography\>
- rounded: \<Dimension\>
- padding: \<Dimension\>
- size: \<Dimension\>
- height: \<Dimension\>
- width: \<Dimension\>

## Do's and Don'ts

This section provides practical guidelines and common pitfalls. These act as guardrails when creating designs.

```markdown
## Do's and Don'ts

- Do use the primary color only for the single most important action per screen
- Don't mix rounded and sharp corners in the same view
- Do maintain WCAG AA contrast ratios (4.5:1 for normal text)
- Don't use more than two font weights on a single screen
```

# Recommended Token Names (Non-Normative)

The following names are commonly used across design systems. They are not required but are provided as guidance for consistency.

**Colors:** `primary`, `secondary`, `tertiary`, `neutral`, `surface`, `on-surface`, `error`

**Typography:** `headline-display`, `headline-lg`, `headline-md`, `body-lg`, `body-md`, `body-sm`, `label-lg`, `label-md`, `label-sm`

**Rounded:** `none`, `sm`, `md`, `lg`, `xl`, `full`

# Consumer Behavior for Unknown Content

When a DESIGN.md consumer encounters content not defined by this spec:

| Scenario | Behavior | Example |
|---|---|---|
| Unknown section heading | Preserve; do not error | `## Iconography` |
| Unknown color token name | Accept if value is valid | `surface-container-high: '#ede7dd'` |
| Unknown typography token name | Accept as valid typography | `telemetry-data` |
| Unknown spacing value | Accept; store as string if not a valid dimension | `grid-columns: '5'` |
| Unknown component property | Accept with warning | `borderColor` |
| Duplicate section heading | Error; reject the file | Two `## Colors` headings |

여기까지 오셨다면 DESIGN.md를 외우는 수준이 아니라 다시 설계할 수 있는 수준이에요. 마지막으로 큰 그림을 한 번 더 정리해요.

7개 모듈의 한 줄 교훈

M1. 포맷 철학 — "AI를 1등 독자로 두면 포맷이 바뀐다"

  • 한 파일짜리 일반 텍스트라서 어느 도구·AI에서도 같은 방식으로 읽혀요
  • YAML(기계용) + 마크다운(사람·AI용) 이중 구조로 두 쪽이 어긋나지 않게
  • 토큰이 정답, 본문이 근거 — 어긋나면 토큰이 이겨요

M2. 토큰 스키마 — "형식은 좁게, 이름은 넓게"

  • 최상위 키 6개는 고정이지만 그 안의 이름은 자유
  • 색은 sRGB hex만, 길이는 px·em·rem만 — 검증·변환 단순
  • 참조 {path.to.token}로 값 복붙 없애고, 의미 연결을 구조로 표현

M3. 섹션 구조 — "추상 → 원자 → 조합 → 가드레일"

  • Overview → Colors → Typography → Layout → Elevation → Shapes → Components → Do's and Don'ts
  • 순서 어기면 경고, 중복은 에러 — 강제와 관용의 균형
  • Do's and Don'ts로 "하지 마" 목록을 명시

M4. 실제 예시 — "같은 기법, 다른 서사"

  • Atmospheric Glass: 밝은 유리 + 다채로운 배경
  • Paws & Paths: 모던 코퍼레이트, 의미별 색 분리
  • Totality Festival: 어두운 유리, 천문학 모티프로 일관성

M5. CLI — "스펙이 자동화에 바로 꽂히도록"

  • lint: CI에 맞는 심각도·종료 코드
  • diff: AI가 자기 수정의 품질 변화를 스스로 재는 도구
  • export: Tailwind·DTCG로 기존 생태계와 연결
  • spec: 포맷 자체를 AI 컨텍스트에 바로 주입

M6. 검사 규칙 — "AI가 메울 수 있는가로 심각도를 나눈다"

L256The linter runs seven rules against a parsed DESIGN.md. Each rule produces findings at a fixed severity level.
한국어로 풀면

검사 도구는 파싱된 DESIGN.md에 7개(+token-summary 포함 8개) 규칙을 돌려요. 각 규칙은 고정된 심각도 수준의 결과를 내놓아요.

에러 1 · 경고 5 · 정보 2 분포 — 빌드를 막는 건 "기능이 망가진 경우"뿐. 나머지는 사람·AI가 판단할 여지를 남겼어요.

M7. 확장성 — "새 것에는 관대, 모호함에는 엄격"

  • 처음 보는 섹션·토큰 이름은 그대로 보존
  • 처음 보는 컴포넌트 속성은 받되 경고
  • 중복 섹션만 에러 — 어느 쪽을 믿어야 할지 모르니까

여러분의 작업에 가져갈 원리 10개

이걸 가져가세요
  1. AI를 1등 독자로 가정하면 포맷이 바뀐다 — 구조·검증·톤이 전부 달라져요
  2. 기계용/사람용 층을 물리적으로 분리 — 한 파일 안에, 다른 위치에
  3. 규범 vs 근거의 우선순위를 선언 — 충돌 시 어느 쪽이 이기는지 정해두기
  4. 뼈대는 좁게, 이름은 넓게 — 스키마 고정 + 내부 이름 자유
  5. 형식 제약으로 AI 환각 차단 — sRGB hex만, 3단위만
  6. 참조로 값 복붙 없애기 — 디자인 결정의 연결 관계가 구조로 남음
  7. 심각도 = "AI가 메울 수 있는가" — 기능 파손만 에러
  8. 확장에 관대, 모호함에 엄격 — 보존 / 경고 / 에러 3단 정책
  9. 스펙을 CLI로 출력 가능하게 — AI 프롬프트에 바로 붙임
  10. 안티 패턴을 명시 (Do's and Don'ts) — "잘 만들어"보다 "금지 목록"이 강력

이 커리큘럼을 다 끝냈다면 할 수 있는 것

  • DESIGN.md 파일을 직접 쓰고 읽어낼 수 있어요
  • 8개 검사 규칙이 각각 어떤 실패를 막는지 설명할 수 있어요
  • 세 공식 예시의 기법과 서사를 비교할 수 있어요
  • 같은 원리를 여러분의 API 스펙·AI 시스템 프롬프트·팀 문서에 옮겨 심을 수 있어요

다음에 해볼 것

  • 여러분이 쓰는 디자인 시스템을 DESIGN.md로 바꿔 보기 (Figma 변수 → DTCG → DESIGN.md 순서)
  • Cursor·Claude에 DESIGN.md를 컨텍스트로 넣고 컴포넌트 생성 품질을 비교해 보기
  • lint·diff를 GitHub Actions에 붙여 PR 자동 리뷰 만들기
  • 이 스펙의 설계 원리를 팀의 "AI용 가이드 문서"에 이식해 보기

최종 체크리스트

  • 7개 모듈의 한 줄 교훈을 전부 떠올릴 수 있다
  • 원리 10개 중 3개 이상을 내 다른 프로젝트에 적용할 계획이 있다
  • "AI를 1등 독자로" 관점이 포맷 설계에 어떻게 영향 주는지 체화했다
  • DESIGN.md가 DTCG·Tailwind와 공존하는 방식을 설명할 수 있다
  • 심각도 정책("AI가 메울 수 있는가")을 다른 검사 도구 설계에 응용할 수 있다

완전 정복 완료

수고하셨어요. 이 원리들을 여러분의 스펙·AI 컨텍스트·문서에 가져가 실험해 보세요.