mstar-design-md

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Load order

加载顺序

Before first Read of this skill: Read
mstar-harness-core
(SKILL.md).
For Prepare phase integration and gate rules, read
mstar-phase-gates
. For plan directory paths (
{HARNESS_DIR}
,
{SPECS_DIR}
), read
mstar-plan-conventions
. On conflict,
mstar-harness-core
wins
.
你还可能要 Read何时
mstar-phase-gates
Prepare 阶段判定 gate、何时 DESIGN.md 必须就绪
mstar-plan-conventions
{HARNESS_DIR}
/
{SPECS_DIR}
路径解析
mstar-roles
@architect
/
@product-manager
/
@frontend-dev
/
@qc-specialist
/
@qa-engineer
角色职责边界
mstar-coding-behavior
实现角色消费 DESIGN.md 前的通用编码约束
首次阅读本技能前:请阅读
mstar-harness-core
(SKILL.md)。
关于Prepare阶段集成和关卡规则,请阅读
mstar-phase-gates
。关于计划目录路径(
{HARNESS_DIR}
{SPECS_DIR}
),请阅读
mstar-plan-conventions
。若出现冲突,
mstar-harness-core
优先级最高
你还可能需要阅读适用场景
mstar-phase-gates
Prepare阶段判定关卡、确定DESIGN.md必须就绪的时机
mstar-plan-conventions
{HARNESS_DIR}
/
{SPECS_DIR}
路径解析
mstar-roles
@architect
/
@product-manager
/
@frontend-dev
/
@qc-specialist
/
@qa-engineer
的角色职责边界
mstar-coding-behavior
实现角色使用DESIGN.md前的通用编码约束

Scope (DESIGN.md lifecycle)

范围(DESIGN.md生命周期)

TopicSee
Normative spec: section definitions, token naming, light/dark rules, YAML frontmatter structure
references/design-md-spec.md
Three-level completeness checklist (MVP / Standard / Production)
references/completeness-checklist.md
Vercel Geist DESIGN.md as annotated reference
references/vercel-example.md
Full template with YAML frontmatter and Level 2/3 placeholders
templates/DESIGN.md.template
Dark theme template (same token names, different values)
templates/DESIGN.dark.md.template
YAML frontmatter is the SSOT for token values. Colors, typography, spacing, rounded, and components live in the frontmatter as structured, machine-readable data. The Markdown body is supplementary documentation (rules, intent, usage guidance). When reading DESIGN.md, always parse the YAML frontmatter first; when writing, keep frontmatter and body in sync.
Out of scope: rendered UI preview tooling outside the repo; frontend implementation that consumes DESIGN.md tokens (use
@frontend-dev
/
@fullstack-dev
); QC review verdict rules (→
mstar-review-qc
).
主题参考文档
规范性规范:章节定义、令牌命名、明暗主题规则、YAML前置元数据结构
references/design-md-spec.md
三级完整性检查清单(MVP / Standard / Production)
references/completeness-checklist.md
带注释的Vercel Geist DESIGN.md参考示例
references/vercel-example.md
包含YAML前置元数据和Level 2/3占位符的完整模板
templates/DESIGN.md.template
暗色主题模板(相同令牌名称,不同值)
templates/DESIGN.dark.md.template
YAML前置元数据是令牌值的SSOT(唯一可信源)。颜色、排版、间距、圆角和组件信息以结构化、机器可读的数据形式存放在前置元数据中。Markdown正文是补充文档(规则、设计意图、使用指南)。阅读DESIGN.md时,请先解析YAML前置元数据;编写时,请保持前置元数据与正文内容一致。
超出范围的内容: 仓库外的渲染UI预览工具;使用DESIGN.md令牌的前端实现(请联系
@frontend-dev
/
@fullstack-dev
);QC评审结论规则(→
mstar-review-qc
)。

Location

存放位置

  • Primary: project root
    DESIGN.md
    (human + agent visible, aligns with
    AGENTS.md
    )
  • Dark theme: project root
    DESIGN.dark.md
    (same token names, different values)
  • DESIGN.md
    is a project-level design contract, not a harness internal artifact. It lives beside
    README.md
    and
    AGENTS.md
    .
  • 主文件:项目根目录下的
    DESIGN.md
    (人员和Agent均可查看,与
    AGENTS.md
    保持一致)
  • 暗色主题文件:项目根目录下的
    DESIGN.dark.md
    (相同令牌名称,不同值)
  • DESIGN.md
    项目级设计契约,而非harness内部工件。它与
    README.md
    AGENTS.md
    存放在同一目录下。

Role lifecycle

角色生命周期

Creator:
@architect
(primary) +
@product-manager
(requirements)

创建者:
@architect
(主导) +
@product-manager
(提供需求)

@architect
owns DESIGN.md content — token selection, naming, completeness level decisions.
@product-manager
provides design intent: brand identity, target audience, must-have UI patterns, accessibility requirements.
@architect
负责DESIGN.md的内容——令牌选择、命名、完整性级别决策。
@product-manager
提供设计意图:品牌标识、目标受众、必备UI模式、可访问性要求。

Orchestrator:
@project-manager

协调者:
@project-manager

In Prepare phase, PM decides whether the project needs a DESIGN.md. If yes, dispatches to
@architect
with product requirements from
@product-manager
. PM checks DESIGN.md exists and meets the assigned completeness level before
plan(locked)
.
在Prepare阶段,PM决定项目是否需要DESIGN.md。若需要,将
@product-manager
提供的产品需求分派给
@architect
。PM需在
plan(locked)
前检查DESIGN.md是否存在,并确认其达到计划中指定的完整性级别。

Consumers

使用者

  • @frontend-dev
    /
    @fullstack-dev
    — read DESIGN.md before implementing styled components; map tokens to CSS/theme variables
  • @qc-specialist
    — verify UI implementation aligns with DESIGN.md tokens
  • @qa-engineer
    — verify visual output matches design spec when
    QA gate: mandatory
  • @frontend-dev
    /
    @fullstack-dev
    —— 实现样式化组件前阅读DESIGN.md;将令牌映射为CSS/主题变量
  • @qc-specialist
    —— 验证UI实现是否符合DESIGN.md令牌要求
  • @qa-engineer
    —— 当**
    QA gate: mandatory
    **时,验证视觉输出是否匹配设计规范

Phase gate integration

阶段关卡集成

DESIGN.md is a Prepare-stage artifact (like spec). It must be created and reviewed before
plan(locked)
for any plan that includes UI work.
  1. PM includes "DESIGN.md creation/audit" in Prepare tracking checklist when the plan involves UI
  2. @architect
    creates or updates DESIGN.md;
    @product-manager
    reviews design intent alignment
  3. PM gates on: DESIGN.md exists, meets completeness level declared in plan,
    @product-manager
    signed off
For hotfix or plans with no UI changes, DESIGN.md check may be skipped.
DESIGN.md是Prepare阶段工件(类似规范文档)。任何包含UI工作的计划,都必须在
plan(locked)
前创建并审核DESIGN.md。
  1. 当计划涉及UI工作时,PM将“DESIGN.md创建/审核”加入Prepare阶段跟踪清单
  2. @architect
    创建或更新DESIGN.md;
    @product-manager
    审核设计意图的一致性
  3. PM需确认以下关卡条件:DESIGN.md已存在、达到计划中声明的完整性级别、
    @product-manager
    已签字确认
对于热修复或无UI变更的计划,可跳过DESIGN.md检查。

Completeness levels

完整性级别

DESIGN.md supports three levels, each with built-in upgrade path:
  1. Level 1 — MVP (minimal, prevents guesswork): palette, base typography, spacing scale
  2. Level 2 — Standard (consistent components): full token scales, breakpoints, component tokens (Button, Input)
  3. Level 3 — Production (complete design system): dual theme, elevation, motion, shapes, component library, voice
The template includes all levels; Level 2 and 3 sections are commented out with
<!-- LEVEL2_PLACEHOLDER: ... -->
markers that explain when to activate them. The audit workflow detects these placeholders and can recommend upgrade.
Full checklist →
references/completeness-checklist.md
.
DESIGN.md支持三个级别,每个级别都内置升级路径:
  1. Level 1 — MVP(最小化配置,避免主观猜测):调色板、基础排版、间距比例
  2. Level 2 — Standard(组件一致):完整令牌比例、断点、组件令牌(Button、Input)
  3. Level 3 — Production(完整设计系统):双主题、阴影层级、动效、形状、组件库、文案风格
模板包含所有级别;Level 2和3的章节通过
<!-- LEVEL2_PLACEHOLDER: ... -->
标记注释,注释内容说明了激活这些章节的时机。审计工作流会检测这些占位符,并可推荐升级。
完整检查清单→
references/completeness-checklist.md

Workflows

工作流

Workflow 1: Create DESIGN.md (Prepare phase)

工作流1:创建DESIGN.md(Prepare阶段)

  1. Read
    references/design-md-spec.md
    for section definitions and YAML frontmatter structure
  2. Copy
    templates/DESIGN.md.template
    to
    {PROJECT_ROOT}/DESIGN.md
    — the template includes the full YAML frontmatter skeleton
  3. Interview
    @product-manager
    for brand colors, typography preferences, must-have patterns
  4. Fill Level 1 frontmatter tokens (uncomment and replace
    "[placeholder]"
    values with concrete hex/px values)
  5. If plan requires Level 2+ out of the gate, uncomment and fill those sections too
  6. Update the body prose to match the frontmatter values (target audience, aesthetic principles, rhythm rules)
  7. Run the completeness audit workflow below to confirm level
  8. Report to PM: path created, level achieved, what's needed for next level
  1. 阅读
    references/design-md-spec.md
    了解章节定义和YAML前置元数据结构
  2. templates/DESIGN.md.template
    复制到
    {PROJECT_ROOT}/DESIGN.md
    ——模板包含完整的YAML前置元数据框架
  3. @product-manager
    沟通,获取品牌颜色、排版偏好、必备UI模式
  4. 填充Level 1前置元数据令牌(取消注释并将
    "[placeholder]"
    替换为具体的十六进制/像素值)
  5. 若计划初始要求Level 2+,则取消对应章节注释并填充内容
  6. 更新正文内容以匹配前置元数据的值(目标受众、美学原则、节奏规则)
  7. 运行下方的完整性审计工作流确认级别
  8. 向PM汇报:文件路径、已达到的级别、升级到下一级别所需的内容

Workflow 2: Audit DESIGN.md completeness

工作流2:审计DESIGN.md完整性

  1. Read
    DESIGN.md
    and
    DESIGN.dark.md
    (if exists) — parse the YAML frontmatter for structured token values
  2. Load
    references/completeness-checklist.md
  3. Check each checklist item; note gaps in both frontmatter (missing/uncommented keys, placeholder values) and body (missing rules/documentation)
  4. Report:
    • Current completeness level
    • Gaps preventing next level (frontmatter gaps vs. body gaps, tagged separately)
    • Presence of upgrade placeholders (
      LEVEL2_PLACEHOLDER
      ,
      LEVEL3_PLACEHOLDER
      in both frontmatter comments and body HTML comments)
    • Recommendation: whether to upgrade now or defer
  5. Update DESIGN.md level tag (e.g.,
    <!-- COMPLETENESS_LEVEL: 1 — last audited YYYY-MM-DD -->
    ) if changed
  1. 阅读
    DESIGN.md
    DESIGN.dark.md
    (若存在)——解析YAML前置元数据获取结构化令牌值
  2. 加载
    references/completeness-checklist.md
  3. 检查每个清单项;记录前置元数据(缺失/未取消注释的键、占位符值)和正文(缺失规则/文档)中的漏洞
  4. 汇报内容:
    • 当前完整性级别
    • 阻碍升级到下一级别的漏洞(分别标记前置元数据漏洞和正文漏洞)
    • 是否存在升级占位符(前置元数据注释和正文HTML注释中的
      LEVEL2_PLACEHOLDER
      LEVEL3_PLACEHOLDER
    • 建议:立即升级或延迟升级
  5. 若级别变更,更新DESIGN.md的级别标签(例如
    <!-- COMPLETENESS_LEVEL: 1 — last audited YYYY-MM-DD -->

Workflow 3: Add dark theme

工作流3:添加暗色主题

  1. Read existing
    DESIGN.md
    to extract token names
  2. Copy
    templates/DESIGN.dark.md.template
    to
    {PROJECT_ROOT}/DESIGN.dark.md
  3. For each token in DESIGN.md, define the dark-theme equivalent value
  4. Preserve same token names; only values change (see
    references/design-md-spec.md
    § Light/Dark rules)
  5. Audit with Workflow 2 to confirm Level 3 completeness
  1. 阅读现有
    DESIGN.md
    提取令牌名称
  2. templates/DESIGN.dark.md.template
    复制到
    {PROJECT_ROOT}/DESIGN.dark.md
  3. 为DESIGN.md中的每个令牌定义对应的暗色主题值
  4. 保留相同的令牌名称;仅修改值(请参阅
    references/design-md-spec.md
    § 明暗主题规则)
  5. 通过工作流2审计确认达到Level 3完整性

Workflow 4: Consume DESIGN.md (implementation roles)

工作流4:使用DESIGN.md(实现角色)

Before writing styled UI code:
  1. Read
    DESIGN.md
    (and
    DESIGN.dark.md
    if exists)
  2. Parse the YAML frontmatter for token values — this is the SSOT for colors, typography, spacing, rounded, and components
  3. Resolve component
    {colors.X}
    ,
    {typography.X}
    ,
    {rounded.X}
    references by tracing back to the corresponding frontmatter keys
  4. Extract tokens into implementation layer (CSS custom properties, Tailwind config, theme object, etc.)
  5. Follow DESIGN.md body Voice & Content rules for copy text
  6. If DESIGN.md is missing, has no frontmatter, or is incomplete, report to PM — do not guess tokens
编写样式化UI代码前:
  1. 阅读
    DESIGN.md
    (若存在则同时阅读
    DESIGN.dark.md
  2. 解析YAML前置元数据获取令牌值——这是颜色、排版、间距、圆角和组件的SSOT
  3. 通过追溯到对应的前置元数据键,解析组件的
    {colors.X}
    {typography.X}
    {rounded.X}
    引用
  4. 将令牌提取到实现层(CSS自定义属性、Tailwind配置、主题对象等)
  5. 遵循DESIGN.md正文中的Voice & Content规则编写文案
  6. 若DESIGN.md缺失、无前置元数据或不完整,请向PM汇报——请勿自行猜测令牌值

Light/Dark dual-theme rules

明暗双主题规则

Dual theme uses same token names, different values across two files:
DESIGN.md         DESIGN.dark.md
-----------       --------------
gray-100: #fff    gray-100: #111
gray-1000: #000   gray-1000: #eee
  • Token names are the SSOT interface — consumers reference tokens by name, not raw values
  • references/design-md-spec.md
    § Light/Dark rules defines the contract
Engine check (when available): run
mstar design-md validate <dir>
(or
import { validateDesignTokenFrontmatter, assertLightDarkParity, completenessLevel } from "@mstar-harness/engine"
in a host hook) to validate the token frontmatter schema above, the light/dark parity of
DESIGN.dark.md
(same token names, different values), and the achieved completeness level. On
fail
-> do not proceed; fix and re-run. Skill text below remains authoritative when the runtime is absent.
双主题通过两个文件实现相同令牌名称,不同值
DESIGN.md         DESIGN.dark.md
-----------       --------------
gray-100: #fff    gray-100: #111
gray-1000: #000   gray-1000: #eee
  • 令牌名称是SSOT接口——使用者通过名称引用令牌,而非原始值
  • references/design-md-spec.md
    § 明暗主题规则定义了相关约定
引擎检查(若可用): 运行
mstar design-md validate <dir>
(或在宿主钩子中导入
import { validateDesignTokenFrontmatter, assertLightDarkParity, completenessLevel } from "@mstar-harness/engine"
),验证上述令牌前置元数据架构、
DESIGN.dark.md
的明暗主题一致性(相同令牌名称,不同值)以及已达到的完整性级别。若检查
fail
→请勿继续;修复后重新运行。当运行时环境不可用,以下技能文本仍为权威内容。

References

参考文档

  • references/design-md-spec.md
    — normative spec: section definitions, token naming conventions, light/dark contract
  • references/completeness-checklist.md
    — three-level audit checklist with detailed criteria per level
  • references/vercel-example.md
    — Vercel Geist DESIGN.md as annotated reference (read when creating from scratch or needing design inspiration)
Templates (this skill):
  • templates/DESIGN.md.template
    — full template including all Level 1-3 sections with placeholder comments
  • templates/DESIGN.dark.md.template
    — dark theme template with same token names, different values
  • references/design-md-spec.md
    —— 规范性规范:章节定义、令牌命名约定、明暗主题契约
  • references/completeness-checklist.md
    —— 三级审计清单,包含每个级别的详细标准
  • references/vercel-example.md
    —— 带注释的Vercel Geist DESIGN.md参考示例(从零创建或需要设计灵感时阅读)
本技能提供的模板:
  • templates/DESIGN.md.template
    —— 完整模板,包含所有Level 1-3章节及占位符注释
  • templates/DESIGN.dark.md.template
    —— 暗色主题模板,使用相同令牌名称、不同值",