ds-spec
Use when a design decision in this project's design system needs what Material Design 3 says: before building, reviewing or migrating a component in the ds folder (src/components/ui/ds), and whenever a size, a state, a colour role or a Do and Don't is in question. Reads the current spec, guidelines, accessibility rules and component tokens from m3.material.io, with no browser, cached per site version.
- License 许可
- MIT
- 所属仓库
- emyann/nemia
- 最近更新
- 2026-11-15
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- ds-spec
- description
- Use when a design decision in this project's design system needs what Material Design 3 says: before building, reviewing or migrating a component in the ds folder (src/components/ui/ds), and whenever a size, a state, a colour role or a Do and Don't is in question. Reads the current spec, guidelines, accessibility rules and component tokens from m3.material.io, with no browser, cached per site version.
02 资源文件 1
- 脚本md3.mjs21.7 KB
03 SKILL.md 正文
ds-spec — the Material 3 spec on demand
md3.mjs next to this file fetches m3.material.io's own JSON (the site is a
client-rendered app; its content is plain, versioned JSON) and prints
markdown. Nothing is stored in the project: what you read is what the site
serves now, cached under ~/.cache/ds-spec/<site-version>/ and re-checked
at most once a day.
node .claude/skills/ds-spec/md3.mjs <command>
md3 in the table is that command.
| Command | What you get |
|---|---|
md3 list [filter] |
every page the site publishes (91: components, foundations, styles) with its tabs |
md3 page <page> [tab] |
one page as markdown — overview, specs, guidelines, accessibility; omit the tab for all four |
md3 tokens <page> [--theme dark] [--contrast "high contrast"] [--platform android] [--filter …] [--json] |
the component's md.comp.* tokens resolved for that context: value + reference chain (md.sys.color.primary → md.ref.palette.primary40), grouped by state / element |
md3 check [--file <path>] [--strict] |
site version vs the carbonVersion a project recorded in a JSON file of its own (default spec-version.json in the current folder); --strict exits 1 on drift (CI) |
md3 refresh |
re-read the site version now |
Every output starts with a provenance line: source URL, site version, page
updated date (or token-db version) — quote it when you report findings.
When to use it
- Building a component: read
page <c> specs(anatomy, measurements, color roles),page <c> guidelines(Do/Don't, behaviour),page <c> accessibility(labels, keyboard, targets), thentokens <c>for exact values and theirmd.sysreferences. Encode the values as role utilities, not literals. - Reviewing a component, against the four pages (overview, specs, guidelines, accessibility): check anatomy and measurements (incl. the 48dp touch target), states and color roles per state, every Do/Don't, every accessibility requirement. Link the pages from the component's doc comment and record deliberate deviations there. A component whose doc comment says "Material 3 does not describe this component." has no page of its own: review it against that doc comment, and against the pages it cites for the parts it borrows.
- Answering a design question ("should this be a switch or a checkbox?"): the guidelines tabs carry the decision rules; cite them.
- Tokens and theming:
page design-tokens(foundations) explains roles and how to use tokens;tokens <component>shows how a component consumes them.
Reading the output
✅ **Do** — …/❌ **Don't** — …are the site's guideline callouts (image chunks with a caption modifier); the image itself is not fetched.- Spec tables (
| Attribute | Value |) are the site's measurement tables. > Token table — run md3 tokens …marks where the site embeds its token viewer; the tokens command renders the same data.- Token values: colors as hex, lengths in
dp, opacities as fractions, shapes as families (circular).viais the reference chain;—means the token has no value for the selected context. - Context defaults follow the site (Theme Light, Contrast Default, Platform per the token db's default); override with the flags.
Caveats
- These endpoints are undocumented internals of m3.material.io. The script
fails loudly ("the site changed shape") rather than guessing; if that
happens, the fix is usually one regex in
getSite. - Content © Google, licensed CC BY 4.0 / Apache 2.0 — attribute when you reproduce it (the provenance line does).
- Foundations/styles pages describe tokens in prose and have no token table.
04 同仓库更多 Skills
groom-the-inbox
Read each card in play in the inbox against the repository and say, per card, done (the commit on the base that landed it), replaced (the decision or card that did), stale (each fact that moved, what it said and what it says now) or standing, reading closely only what the period touched. For the janitor's step, which proposes and never acts: a person removes or amends each card by the command the check writes.
write-a-spec
Turn an accepted intent into a spec an engineer can build from in this repository: the goal restated, the approach and why, every path it touches, the steps, the tests that prove it, the risks, and what is still open. For a step that designs a change before anyone builds it.
review-a-change
Review a change in this repository as a second engineer would: against its intent and spec, by reading the diff and the suite's verdict, with findings that name the file, the line and what goes wrong. For a read-only step that decides whether the work goes round again.
read-the-stats
Read a factory's stats since the janitor's last run, against the same length of time before it, write a short report, and propose one correction per card — an allow or deny by name, a line in an agent's body or a skill, or a refusal kept on purpose — each with the numbers behind it, never one already in the inbox. For the janitor's step, which proposes and never acts.
land-a-branch
Land a run's result on the base branch in this repository's own checkout, the way the step says it lands: make that one act, read its result, and write the message that records what landed — or change nothing and say why it refused. For a gated ending step (workspace: base).
implement-a-change
Build a change from its spec in this repository: tests first where a rule is claimed, small commits, the tests of what changed green for the right reason, and each review finding answered in the next round. For a step that writes the code.