From design-system-ops
Writes documentation for design tokens covering semantic intent, usage context, and do/don't examples for reference guides.
npx claudepluginhub murphytrueman/design-system-opsThis skill uses the workspace's default tool permissions.
A skill for writing documentation for design tokens that communicates semantic intent, usage context, and application rules across all three tiers. Output is reference documentation that tells consumers what a token means and how to use it correctly — not just what value it resolves to.
Generates design token documentation with visual swatches and code examples. Use when documenting token values, creating token reference guides, or building searchable design system documentation.
Defines and organizes design tokens for color, spacing, typography, elevation, borders, motion with global/alias/component tiers, naming conventions, and best practices.
Audits design system token definitions for naming violations, missing semantic tiers, and structural debt in tiered architectures. Generates severity-rated findings and prioritized remediations.
Share bugs, ideas, or general feedback.
A skill for writing documentation for design tokens that communicates semantic intent, usage context, and application rules across all three tiers. Output is reference documentation that tells consumers what a token means and how to use it correctly — not just what value it resolves to.
Token documentation has a chronic problem: it stops at the value. A token reference that says color.action.primary: #0066CC tells a consumer the resolved colour, but not when to use it, what it communicates to users, which components it belongs on, or what happens when it is misapplied. Teams that rely purely on value-level documentation make naming decisions based on colour proximity rather than semantic intent, and the system drifts.
The goal is documentation that makes the semantic contract legible. A consumer reading these docs should come away understanding not just what a token resolves to, but why it exists and where it belongs.
This skill documents existing tokens. It does not create new tokens, redesign the token architecture, or validate token file structure (use schema-validator for structural validation, token-audit for architectural assessment). If the token set is empty or has not been defined yet, this skill does not apply — help the team establish their token architecture first. If only primitive tokens exist (no semantic tier), note that the documentation value is limited since primitive tokens are largely self-documenting, and suggest establishing a semantic tier before investing in documentation.
Before producing output, check for a .ds-ops-config.yml file in the project root. If present, load:
integrations.style_dictionary — if enabled, parse the token tree automaticallyintegrations.figma — if enabled, pull Figma variables to cross-referenceintegrations.documentation — if enabled, check for existing token docs to update rather than rewriteStyle Dictionary v4 (integrations.style_dictionary.enabled: true):
Figma MCP (integrations.figma.enabled: true):
Documentation platform (integrations.documentation.enabled: true):
If an integration fails, log it and proceed with manual input.
Ask for or confirm (skip questions already answered by auto-pull):
:root { --token: value; }), SCSS/Sass variables ($token: value;), TypeScript/JavaScript token objects, Tailwind config (theme / extend block), or listed by nameFor CSS custom properties and SCSS variables: infer token hierarchy from naming patterns (e.g. --color-blue-500 → primitive, --color-action-primary → semantic, --button-bg-default → component). For Tailwind configs, the theme block is the token source. For TypeScript/JavaScript token objects: the exported object hierarchy maps directly to token tiers — nested keys are the path (e.g. tokens.color.brand.blue[500] → color.brand.blue.500). Include both the object key path and resolved value in the documentation. For as const objects, the literal types provide exact values without runtime ambiguity.
If the full system is being documented, suggest starting with the semantic tier. Primitive tokens document themselves — their names and values are sufficient. Semantic tokens are where intent documentation does the most work. If the system uses component tokens, include those after semantics.
Primitive token documentation is lightweight. The goal is to establish what the scale looks like and what it is derived from — not to explain when to use color.blue.400 vs color.blue.500, because that is the semantic tier's job.
Document:
Format per primitive group:
[Token group name]
Scale: [describe the scale — e.g. 50–950 in 50-point increments, or T-shirt sizing]
Source: [where values come from]
Values: [list or reference to the token file]
Usage: Reference via semantic tokens only.
Semantic tokens carry the intent contract. This is where most documentation effort belongs.
For each semantic token or semantic token group, document:
Intent: What does this token communicate to users? One sentence. Not what it looks like — what it means.
Example: color.action.primary — Identifies the primary interactive action in a given context. Signals that an element is the most important or most expected next step for the user.
Resolved value: What value does this token produce in the default theme? (And in other themes if theming is supported.)
Tier reference: Which primitive token does this semantic token reference?
Usage context: Where this token belongs — which component surfaces, which states, which user-facing roles.
Usage constraint: Where this token should not be used — specific misuse patterns to avoid.
Component associations: Which components from the design system use this token by default.
Format per semantic token:
[token.name]
Intent: [one sentence on what this token communicates]
Resolved value: [value(s) by theme]
References: [primitive token(s)]
Use on: [list of appropriate surfaces or component types]
Do not use on: [specific misuse contexts]
Used by: [component names that reference this token by default]
Not every system has a component token tier — many systems bind semantic tokens directly in component code, and that is a valid architecture. If the system does use component tokens, they are the most specific tier and the most commonly under-documented because they feel obvious. "Of course button.background.default is the button's default background" — but what should happen if a product team wants to override it? Which semantic token should they route through? Are there states the documentation has not covered?
If the system does not use component tokens, skip this section entirely. Do not recommend introducing them unless the context calls for it (white-labelling, multi-brand, complex components with many token bindings).
For component tokens, document:
Group component token documentation by component. Do not produce a flat alphabetical list of component tokens — it is unusable.
Format per component group:
[Component name] tokens
[token.name] — [prop or state it controls]
References: [semantic token]
Override guidance: [expected / discouraged / never — with one-sentence reason]
If the system supports multiple themes (light/dark, brand variants, platform-specific themes), document how the semantic tokens resolve across themes and what the contract is for adding a new theme.
This documentation is often missing entirely, which means teams learn the theming system by reading the token files rather than by reading a clear contract. The contract should answer:
At the end of the documentation, include a brief misuse reference: a list of the most common incorrect token usages the design systems team has seen, with the correct alternative for each.
Format:
Common misuse: Using [wrong token] to achieve [visual outcome]
Why it's wrong: [one sentence — what the wrong token communicates that conflicts with the intended use]
Use instead: [correct token]
Five to ten entries is usually enough to cover the most frequent errors.
At the top of the token documentation, include a governance section that answers the question every consumer eventually asks: "Who do I talk to when I need a token that does not exist?"
Token governance:
This note prevents the common failure mode where token documentation is accurate at publication but becomes stale because no one owns the update process.
If the system uses or is migrating to DTCG 2025.10 format, include a specification alignment section:
Token type documentation. For each DTCG token type used in the system, document:
color, dimension, typography, shadow)Resolver and set documentation. If the system uses DTCG resolvers:
Migration status. For systems partially migrated to DTCG:
$type annotations, non-standard composite structures)?Produce a supplementary JSON reference that AI tools and build pipelines can consume directly:
{
"tokenArchitecture": {
"tiers": ["primitive", "semantic", "component"],
"format": "dtcg-2025.10|style-dictionary|custom",
"totalTokenCount": 0,
"themeSupport": true|false,
"themes": ["light", "dark"]
},
"semanticTokens": [
{
"name": "color.action.primary",
"type": "color",
"intent": "Primary interactive action colour",
"references": "color.blue.500",
"themes": {
"light": "#0066CC",
"dark": "#66AAFF"
},
"usedBy": ["button.background.default", "link.color.default"],
"useOn": ["primary actions", "interactive elements"],
"doNotUseOn": ["decorative surfaces", "text body"]
}
]
}
This reference complements the human-readable documentation. Keep both in sync — changes to the documentation should be reflected in the JSON, and vice versa.
Token documentation needs to be findable, not just accurate. Recommend the following structure for the documentation platform:
The semantic reference is the most-used section. Make sure it is the easiest to find and navigate.
In addition to the full documentation, produce a one-page quick reference organised by what the consumer is trying to do, not by token category:
"I need a colour for..."
color.action.primarycolor.action.secondarycolor.action.destructivecolor.feedback.successcolor.feedback.errorcolor.feedback.warningcolor.content.primarycolor.content.secondarycolor.surface.primarycolor.surface.elevated"I need spacing for..."
spacing.xs or spacing.smspacing.lg or spacing.xlspacing.pagespacing.component.padding"I need typography for..."
typography.heading.lgtypography.heading.mdtypography.body.mdtypography.body.smAdapt this template to the actual tokens in the system. The quick reference should use the real token names and be published alongside the full documentation as a fast-lookup tool.