Design-DNA Skill – Tokens & Patterns
This skill provides shared understanding of design-dna for all lanes.
It is used by:
design-system-architect
- Implementation agents (e.g.
nextjs-builder, expo-builder) when applying tokens
- Gate agents (
nextjs-standards-enforcer, design QA) when checking usage
Core Concepts
design-dna.json encodes:
- Color palette + semantic roles,
- Typography scale and roles,
- Spacing grid,
- Named patterns (cards, layouts, shells, etc.).
- It is the law for UI work: where tokens exist, ad-hoc values are forbidden.
Usage Pattern
When reading design-dna:
- Identify available roles for:
- Colors (primary, secondary, accent, surface, etc.),
- Typography (display, heading, body, caption),
- Spacing (base grid, section spacing, gaps),
- Patterns (hero, card grid, dashboard shell, etc.).
- Note any documented minimums or constraints (e.g., minimum font size).
When applying tokens in implementation:
- Map design-dna roles to the project's styling tools:
- CSS variables,
- Utility classes,
- Component variants.
- Avoid creating new arbitrary values when tokens already cover the need.
When enforcing tokens in gates:
- Treat:
- Inline styles and raw hex values as hard violations when tokens exist,
- Spacing and typography outside the defined scales as violations,
- Overuse/misuse of accent colors as design-dna violations if documented.
CSS Comment Format (OS 7.0)
For projects without JSON design-dna, tokens and rules can be embedded in CSS comments.
Token Syntax
/* @design-token: <name> = <value> */
Examples:
/* @design-token: primary = #007AFF */
/* @design-token: secondary = #5856D6 */
/* @design-token: spacing-base = 8px */
/* @design-token: font-body = 16px/24px Inter */
Rule Syntax
/* @design-rule: <constraint> = <value> */
Examples:
/* @design-rule: min-touch-target = 44px */
/* @design-rule: max-content-width = 1200px */
/* @design-rule: min-font-size = 14px */
Priority Order
When checking for design rules, agents search in this order:
- JSON (highest priority):
.claude/design-dna/*.json, design-dna.json, design-tokens.json
- Markdown:
design-system.md, .claude/design-dna/README.md, docs/design-system.md
- CSS comments (lowest priority): Any
*.css file with @design-token: or @design-rule:
JSON takes precedence because it provides structured, machine-parseable tokens. CSS comments are a fallback for legacy projects or quick prototypes.
This skill ensures all agents reason about design-dna in a consistent way and
know when to consult project design documentation for deeper schema and examples.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: adilkalam-orca-design-dna-skill3description: Design-DNA Skill – Tokens & Patterns4---56# Design-DNA Skill – Tokens & Patterns78This skill provides shared understanding of **design-dna** for all lanes.910It is used by:11- `design-system-architect`12- Implementation agents (e.g. `nextjs-builder`, `expo-builder`) when applying tokens13- Gate agents (`nextjs-standards-enforcer`, design QA) when checking usage1415## Core Concepts1617- `design-dna.json` encodes:18 - Color palette + semantic roles,19 - Typography scale and roles,20 - Spacing grid,21 - Named patterns (cards, layouts, shells, etc.).22- It is the **law** for UI work: where tokens exist, ad-hoc values are forbidden.2324## Usage Pattern25261. When reading design-dna:27 - Identify available roles for:28 - Colors (primary, secondary, accent, surface, etc.),29 - Typography (display, heading, body, caption),30 - Spacing (base grid, section spacing, gaps),31 - Patterns (hero, card grid, dashboard shell, etc.).32 - Note any documented minimums or constraints (e.g., minimum font size).33342. When applying tokens in implementation:35 - Map design-dna roles to the project's styling tools:36 - CSS variables,37 - Utility classes,38 - Component variants.39 - Avoid creating new arbitrary values when tokens already cover the need.40413. When enforcing tokens in gates:42 - Treat:43 - Inline styles and raw hex values as hard violations when tokens exist,44 - Spacing and typography outside the defined scales as violations,45 - Overuse/misuse of accent colors as design-dna violations if documented.4647---4849## CSS Comment Format (OS 7.0)5051For projects without JSON design-dna, tokens and rules can be embedded in CSS comments.5253### Token Syntax54```css55/* @design-token: <name> = <value> */56```5758**Examples:**59```css60/* @design-token: primary = #007AFF */61/* @design-token: secondary = #5856D6 */62/* @design-token: spacing-base = 8px */63/* @design-token: font-body = 16px/24px Inter */64```6566### Rule Syntax67```css68/* @design-rule: <constraint> = <value> */69```7071**Examples:**72```css73/* @design-rule: min-touch-target = 44px */74/* @design-rule: max-content-width = 1200px */75/* @design-rule: min-font-size = 14px */76```7778### Priority Order7980When checking for design rules, agents search in this order:811. **JSON** (highest priority): `.claude/design-dna/*.json`, `design-dna.json`, `design-tokens.json`822. **Markdown**: `design-system.md`, `.claude/design-dna/README.md`, `docs/design-system.md`833. **CSS comments** (lowest priority): Any `*.css` file with `@design-token:` or `@design-rule:`8485JSON takes precedence because it provides structured, machine-parseable tokens. CSS comments are a fallback for legacy projects or quick prototypes.8687---8889This skill ensures all agents reason about design-dna in a consistent way and90know when to consult project design documentation for deeper schema and examples.9192---93> Converted and distributed by [TomeVault](https://tomevault.io/claim/adilkalam) — claim your Tome and manage your conversions.94<!-- tomevault:4.0:skill_md:2026-04-13 -->