mstar-design-md
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLoad order
加载顺序
Before first Read of this skill: Read (SKILL.md). For Prepare phase integration and gate rules, read . For plan directory paths (, ), read . On conflict, wins.
mstar-harness-coremstar-phase-gates{HARNESS_DIR}{SPECS_DIR}mstar-plan-conventionsmstar-harness-core| 你还可能要 Read | 何时 |
|---|---|
| Prepare 阶段判定 gate、何时 DESIGN.md 必须就绪 |
| |
| |
| 实现角色消费 DESIGN.md 前的通用编码约束 |
首次阅读本技能前:请阅读(SKILL.md)。 关于Prepare阶段集成和关卡规则,请阅读。关于计划目录路径(、),请阅读。若出现冲突,优先级最高。
mstar-harness-coremstar-phase-gates{HARNESS_DIR}{SPECS_DIR}mstar-plan-conventionsmstar-harness-core| 你还可能需要阅读 | 适用场景 |
|---|---|
| Prepare阶段判定关卡、确定DESIGN.md必须就绪的时机 |
| |
| |
| 实现角色使用DESIGN.md前的通用编码约束 |
Scope (DESIGN.md lifecycle)
范围(DESIGN.md生命周期)
| Topic | See |
|---|---|
| Normative spec: section definitions, token naming, light/dark rules, YAML frontmatter structure | |
| Three-level completeness checklist (MVP / Standard / Production) | |
| Vercel Geist DESIGN.md as annotated reference | |
| Full template with YAML frontmatter and Level 2/3 placeholders | |
| Dark theme template (same token names, different values) | |
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 / ); QC review verdict rules (→ ).
@frontend-dev@fullstack-devmstar-review-qc| 主题 | 参考文档 |
|---|---|
| 规范性规范:章节定义、令牌命名、明暗主题规则、YAML前置元数据结构 | |
| 三级完整性检查清单(MVP / Standard / Production) | |
| 带注释的Vercel Geist DESIGN.md参考示例 | |
| 包含YAML前置元数据和Level 2/3占位符的完整模板 | |
| 暗色主题模板(相同令牌名称,不同值) | |
YAML前置元数据是令牌值的SSOT(唯一可信源)。颜色、排版、间距、圆角和组件信息以结构化、机器可读的数据形式存放在前置元数据中。Markdown正文是补充文档(规则、设计意图、使用指南)。阅读DESIGN.md时,请先解析YAML前置元数据;编写时,请保持前置元数据与正文内容一致。
超出范围的内容: 仓库外的渲染UI预览工具;使用DESIGN.md令牌的前端实现(请联系 / );QC评审结论规则(→ )。
@frontend-dev@fullstack-devmstar-review-qcLocation
存放位置
- Primary: project root (human + agent visible, aligns with
DESIGN.md)AGENTS.md - Dark theme: project root (same token names, different values)
DESIGN.dark.md - is a project-level design contract, not a harness internal artifact. It lives beside
DESIGN.mdandREADME.md.AGENTS.md
- 主文件:项目根目录下的(人员和Agent均可查看,与
DESIGN.md保持一致)AGENTS.md - 暗色主题文件:项目根目录下的(相同令牌名称,不同值)
DESIGN.dark.md - 是项目级设计契约,而非harness内部工件。它与
DESIGN.md和README.md存放在同一目录下。AGENTS.md
Role lifecycle
角色生命周期
Creator: @architect
(primary) + @product-manager
(requirements)
@architect@product-manager创建者:@architect
(主导) + @product-manager
(提供需求)
@architect@product-manager@architect@product-manager@architect@product-managerOrchestrator: @project-manager
@project-manager协调者:@project-manager
@project-managerIn Prepare phase, PM decides whether the project needs a DESIGN.md. If yes, dispatches to with product requirements from . PM checks DESIGN.md exists and meets the assigned completeness level before .
@architect@product-managerplan(locked)在Prepare阶段,PM决定项目是否需要DESIGN.md。若需要,将提供的产品需求分派给。PM需在前检查DESIGN.md是否存在,并确认其达到计划中指定的完整性级别。
@product-manager@architectplan(locked)Consumers
使用者
- /
@frontend-dev— read DESIGN.md before implementing styled components; map tokens to CSS/theme variables@fullstack-dev - — verify UI implementation aligns with DESIGN.md tokens
@qc-specialist - — verify visual output matches design spec when
@qa-engineerQA gate: mandatory
- /
@frontend-dev—— 实现样式化组件前阅读DESIGN.md;将令牌映射为CSS/主题变量@fullstack-dev - —— 验证UI实现是否符合DESIGN.md令牌要求
@qc-specialist - —— 当**
@qa-engineer**时,验证视觉输出是否匹配设计规范QA gate: mandatory
Phase gate integration
阶段关卡集成
DESIGN.md is a Prepare-stage artifact (like spec). It must be created and reviewed before for any plan that includes UI work.
plan(locked)- PM includes "DESIGN.md creation/audit" in Prepare tracking checklist when the plan involves UI
- creates or updates DESIGN.md;
@architectreviews design intent alignment@product-manager - PM gates on: DESIGN.md exists, meets completeness level declared in plan, signed off
@product-manager
For hotfix or plans with no UI changes, DESIGN.md check may be skipped.
DESIGN.md是Prepare阶段工件(类似规范文档)。任何包含UI工作的计划,都必须在前创建并审核DESIGN.md。
plan(locked)- 当计划涉及UI工作时,PM将“DESIGN.md创建/审核”加入Prepare阶段跟踪清单
- 创建或更新DESIGN.md;
@architect审核设计意图的一致性@product-manager - PM需确认以下关卡条件:DESIGN.md已存在、达到计划中声明的完整性级别、已签字确认
@product-manager
对于热修复或无UI变更的计划,可跳过DESIGN.md检查。
Completeness levels
完整性级别
DESIGN.md supports three levels, each with built-in upgrade path:
- Level 1 — MVP (minimal, prevents guesswork): palette, base typography, spacing scale
- Level 2 — Standard (consistent components): full token scales, breakpoints, component tokens (Button, Input)
- 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 markers that explain when to activate them. The audit workflow detects these placeholders and can recommend upgrade.
<!-- LEVEL2_PLACEHOLDER: ... -->Full checklist → .
references/completeness-checklist.mdDESIGN.md支持三个级别,每个级别都内置升级路径:
- Level 1 — MVP(最小化配置,避免主观猜测):调色板、基础排版、间距比例
- Level 2 — Standard(组件一致):完整令牌比例、断点、组件令牌(Button、Input)
- Level 3 — Production(完整设计系统):双主题、阴影层级、动效、形状、组件库、文案风格
模板包含所有级别;Level 2和3的章节通过标记注释,注释内容说明了激活这些章节的时机。审计工作流会检测这些占位符,并可推荐升级。
<!-- LEVEL2_PLACEHOLDER: ... -->完整检查清单→。
references/completeness-checklist.mdWorkflows
工作流
Workflow 1: Create DESIGN.md (Prepare phase)
工作流1:创建DESIGN.md(Prepare阶段)
- Read for section definitions and YAML frontmatter structure
references/design-md-spec.md - Copy to
templates/DESIGN.md.template— the template includes the full YAML frontmatter skeleton{PROJECT_ROOT}/DESIGN.md - Interview for brand colors, typography preferences, must-have patterns
@product-manager - Fill Level 1 frontmatter tokens (uncomment and replace values with concrete hex/px values)
"[placeholder]" - If plan requires Level 2+ out of the gate, uncomment and fill those sections too
- Update the body prose to match the frontmatter values (target audience, aesthetic principles, rhythm rules)
- Run the completeness audit workflow below to confirm level
- Report to PM: path created, level achieved, what's needed for next level
- 阅读了解章节定义和YAML前置元数据结构
references/design-md-spec.md - 将复制到
templates/DESIGN.md.template——模板包含完整的YAML前置元数据框架{PROJECT_ROOT}/DESIGN.md - 与沟通,获取品牌颜色、排版偏好、必备UI模式
@product-manager - 填充Level 1前置元数据令牌(取消注释并将替换为具体的十六进制/像素值)
"[placeholder]" - 若计划初始要求Level 2+,则取消对应章节注释并填充内容
- 更新正文内容以匹配前置元数据的值(目标受众、美学原则、节奏规则)
- 运行下方的完整性审计工作流确认级别
- 向PM汇报:文件路径、已达到的级别、升级到下一级别所需的内容
Workflow 2: Audit DESIGN.md completeness
工作流2:审计DESIGN.md完整性
- Read and
DESIGN.md(if exists) — parse the YAML frontmatter for structured token valuesDESIGN.dark.md - Load
references/completeness-checklist.md - Check each checklist item; note gaps in both frontmatter (missing/uncommented keys, placeholder values) and body (missing rules/documentation)
- Report:
- Current completeness level
- Gaps preventing next level (frontmatter gaps vs. body gaps, tagged separately)
- Presence of upgrade placeholders (,
LEVEL2_PLACEHOLDERin both frontmatter comments and body HTML comments)LEVEL3_PLACEHOLDER - Recommendation: whether to upgrade now or defer
- Update DESIGN.md level tag (e.g., ) if changed
<!-- COMPLETENESS_LEVEL: 1 — last audited YYYY-MM-DD -->
- 阅读和
DESIGN.md(若存在)——解析YAML前置元数据获取结构化令牌值DESIGN.dark.md - 加载
references/completeness-checklist.md - 检查每个清单项;记录前置元数据(缺失/未取消注释的键、占位符值)和正文(缺失规则/文档)中的漏洞
- 汇报内容:
- 当前完整性级别
- 阻碍升级到下一级别的漏洞(分别标记前置元数据漏洞和正文漏洞)
- 是否存在升级占位符(前置元数据注释和正文HTML注释中的、
LEVEL2_PLACEHOLDER)LEVEL3_PLACEHOLDER - 建议:立即升级或延迟升级
- 若级别变更,更新DESIGN.md的级别标签(例如)
<!-- COMPLETENESS_LEVEL: 1 — last audited YYYY-MM-DD -->
Workflow 3: Add dark theme
工作流3:添加暗色主题
- Read existing to extract token names
DESIGN.md - Copy to
templates/DESIGN.dark.md.template{PROJECT_ROOT}/DESIGN.dark.md - For each token in DESIGN.md, define the dark-theme equivalent value
- Preserve same token names; only values change (see § Light/Dark rules)
references/design-md-spec.md - Audit with Workflow 2 to confirm Level 3 completeness
- 阅读现有提取令牌名称
DESIGN.md - 将复制到
templates/DESIGN.dark.md.template{PROJECT_ROOT}/DESIGN.dark.md - 为DESIGN.md中的每个令牌定义对应的暗色主题值
- 保留相同的令牌名称;仅修改值(请参阅§ 明暗主题规则)
references/design-md-spec.md - 通过工作流2审计确认达到Level 3完整性
Workflow 4: Consume DESIGN.md (implementation roles)
工作流4:使用DESIGN.md(实现角色)
Before writing styled UI code:
- Read (and
DESIGN.mdif exists)DESIGN.dark.md - Parse the YAML frontmatter for token values — this is the SSOT for colors, typography, spacing, rounded, and components
- Resolve component ,
{colors.X},{typography.X}references by tracing back to the corresponding frontmatter keys{rounded.X} - Extract tokens into implementation layer (CSS custom properties, Tailwind config, theme object, etc.)
- Follow DESIGN.md body Voice & Content rules for copy text
- If DESIGN.md is missing, has no frontmatter, or is incomplete, report to PM — do not guess tokens
编写样式化UI代码前:
- 阅读(若存在则同时阅读
DESIGN.md)DESIGN.dark.md - 解析YAML前置元数据获取令牌值——这是颜色、排版、间距、圆角和组件的SSOT
- 通过追溯到对应的前置元数据键,解析组件的、
{colors.X}、{typography.X}引用{rounded.X} - 将令牌提取到实现层(CSS自定义属性、Tailwind配置、主题对象等)
- 遵循DESIGN.md正文中的Voice & Content规则编写文案
- 若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
- § Light/Dark rules defines the contract
references/design-md-spec.md
Engine check (when available): run(ormstar design-md validate <dir>in a host hook) to validate the token frontmatter schema above, the light/dark parity ofimport { validateDesignTokenFrontmatter, assertLightDarkParity, completenessLevel } from "@mstar-harness/engine"(same token names, different values), and the achieved completeness level. OnDESIGN.dark.md-> do not proceed; fix and re-run. Skill text below remains authoritative when the runtime is absent.fail
双主题通过两个文件实现相同令牌名称,不同值:
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
参考文档
- — normative spec: section definitions, token naming conventions, light/dark contract
references/design-md-spec.md - — three-level audit checklist with detailed criteria per level
references/completeness-checklist.md - — Vercel Geist DESIGN.md as annotated reference (read when creating from scratch or needing design inspiration)
references/vercel-example.md
Templates (this skill):
- — full template including all Level 1-3 sections with placeholder comments
templates/DESIGN.md.template - — dark theme template with same token names, different values
templates/DESIGN.dark.md.template
- —— 规范性规范:章节定义、令牌命名约定、明暗主题契约
references/design-md-spec.md - —— 三级审计清单,包含每个级别的详细标准
references/completeness-checklist.md - —— 带注释的Vercel Geist DESIGN.md参考示例(从零创建或需要设计灵感时阅读)
references/vercel-example.md
本技能提供的模板:
- —— 完整模板,包含所有Level 1-3章节及占位符注释
templates/DESIGN.md.template - —— 暗色主题模板,使用相同令牌名称、不同值",
templates/DESIGN.dark.md.template