Skip to content
Back to skills

Mstar Design Md

ASecurity

DESIGN.md 设计系统规范:创建/审计/维护 design tokens、三级完整性清单、light/dark 双主题(DESIGN.dark.md)。用户提到 DESIGN.md / design tokens / design system,或实现、审查 UI 时读取。

  • 74 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 20, 2026
ai-agentsgitfrontendfullstackdocumentation

Works with

  • cli

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned November 27, 2026

npx -y skills add btspoony/mstar-harness --skill mstar-design-md --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mstar Design Md?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mstar Design Md
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/btspoony-mstar-design-md/badge)](https://www.skillsdirectory.com/skills/btspoony-mstar-design-md)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: mstar-design-md
description: DESIGN.md 设计系统规范:创建/审计/维护 design tokens、三级完整性清单、light/dark 双主题(DESIGN.dark.md)。用户提到 DESIGN.md / design tokens / design system,或实现、审查 UI 时读取。
---

## 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-conventions`. On conflict, **`mstar-harness-core` wins**.

| 你还可能要 Read | 何时 |
|-----------------|------|
| `mstar-phase-gates` | Prepare 阶段判定 gate、何时 DESIGN.md 必须就绪 |
| `mstar-conventions` | `{HARNESS_DIR}` / `{SPECS_DIR}` 路径解析 |
| `mstar-roles` | Product/architecture/frontend/QC role boundaries and PM-owned acceptance |
| `mstar-coding-behavior` | 实现角色消费 DESIGN.md 前的通用编码约束 |
| `mstar-design-system` | 一个实现需要收敛到既有 baseline(原型 / 设计导出 / 既有产品标记 / 书面契约)时:baseline 定位与机器化、三层 parity、defect/decision/phantom 分诊、coverage 证据 |

## Scope (DESIGN.md lifecycle)

| Topic | See |
|-------|-----|
| Normative spec: section definitions, token naming, light/dark rules, **YAML frontmatter structure**, completeness levels | `references/design-md-spec.md` |
| Three-level completeness checklist (MVP / Standard / Production) | `references/completeness-checklist.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` |

**Precedence.** When two artefacts in this skill disagree, `references/design-md-spec.md` wins on rules and `templates/DESIGN.md.template` wins on shape (section order, placeholder layout); a template that contradicts a stated rule is the defect.

**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`**).

## 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`.

## Prototype vs document

When the repository also ships a prototype, this document is a **summary of that prototype, not a second source**:

- **Authority.** The prototype is the design; `DESIGN.md` states in prose what it establishes. On conflict the prototype wins — unless the prototype is silent, in which case the decision and its reason belong in `DESIGN.md`. An unrecorded silence becomes a guess in the next implementation.
- **One-directional sync.** `baseline → fixture → document`. Change the prototype, rerun the generator that derives the machine-readable fixture, then bring `DESIGN.md` in line. Hand-editing the fixture, or iterating in `DESIGN.md` and back-filling the prototype, is the reverse direction and a defect regardless of which side turns out to be right.
- **The fixture must be a tracked file derived from a tracked source.** A deriver or comparator that reads a gitignored working path at runtime has no baseline: on a clean checkout it fails, and in the degraded mode it warns and exits `0`, which reads as a pass forever.
- **A lagging document fails nothing.** A fixture that lags the prototype fails its check; nothing fails when `DESIGN.md` lags both. That direction is a **review obligation**: the reviewer compares the document against the fixture, because no gate will.

Converging an implementation onto that baseline — baseline kinds, parity layers, defect / decision / phantom triage — → skill `mstar-design-system`.

## Role lifecycle

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

`@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.

### Orchestrator: `@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)`.

### 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
- `project-manager` — map relevant supplied visual/design evidence to the ACs through `mstar-roles/references/project-manager/acceptance.md`; no automatic real-environment gate

## 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.

## Completeness levels(Evidence)

Level definitions and the pass rule live in `references/design-md-spec.md` §7; the itemized checks live in `references/completeness-checklist.md` § Level 1–3. Neither is restated here.

The template carries all three levels' keys, with Level 2 and 3 commented out behind `<!-- LEVEL2_PLACEHOLDER: ... -->` / `<!-- LEVEL3_PLACEHOLDER: ... -->` markers that say when to activate them (spec §5); an audit detects these markers and recommends the upgrade.

## Workflows

### Workflow 1: Create DESIGN.md (Prepare phase)

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

### Workflow 2: Audit DESIGN.md completeness

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

### Workflow 3: Add dark theme

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

### Workflow 4: Consume DESIGN.md (implementation roles)

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

## 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:** run `mstar design-md validate <dir>` (engine `validateDesignTokenFrontmatter`, `assertLightDarkParity`, `completenessLevel`) 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. Contract → `mstar-use-cli/references/checks-and-lints.md` § Engine check callouts.

## References

- `references/design-md-spec.md` — open when writing, validating or auditing a DESIGN.md format and token rules; normative spec: section definitions, token naming conventions, light/dark contract
- `references/completeness-checklist.md` — open when auditing a DESIGN.md level by level; three-level audit checklist with detailed criteria per level

**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

Files in this skill

  • SKILL.md9.4 KB
  • references/completeness-checklist.md9.3 KB
  • references/design-md-spec.md17 KB
  • references/vercel-example.md14.1 KB
  • templates/DESIGN.dark.md.template10.7 KB
  • templates/DESIGN.md.template16 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.