Brand to tokens

From event4u-app/agent-config · View interactive version

Brand to tokens is an AI agent skill from the GitHub repository event4u-app/agent-config. Turn a confirmed brand identity into a DTCG tokens.json source of truth — emit CSS vars + Tailwind via design-tokens, export locked brand deck templates.

How to use this skill

Skill file

brand-to-tokens

The brand→token derivation — the first consumer demand that closes the

ADR-061 §8 deferral. Takes a confirmed CODE0

constraint set and produces a DTCG tokens.json source of truth, then

hands it to the CODE0 toolchain to emit

CSS vars + Tailwind. The same tokens.json is the export that pack-ai-image

brand-asset generation and the greenfield scaffold seed consume (B → A;

contract: CODE0).

When to use

a maintained token system.

tokens.json export.

Procedure

  1. Take the confirmed brand-identity constraint set — colour story (roles +

values), type story (heading/body classes), spacing/radius intent. If a

consumer brand profile already registers values, those win

(CODE0).

  1. Author tokens.json on the design-tokens 3-layer DTCG model

($value / $type): brand palette → primitive.color.*; brand roles

(primary, accent, surface, destructive) → semantic.color.* referencing the

primitives; per-widget needs → component.*. Add dark.semantic.* overrides.

Type tokens come from CODE0

stage-2 (archetype → pairing-filter), added under the typography section.

  1. Generate CSS vars + Tailwind through the toolchain:

```bash

node <skills-root>/design-tokens/scripts/tokens.mjs generate \

--config tokens.json -o assets/design-tokens.css

node <skills-root>/design-tokens/scripts/tokens.mjs generate \

--config tokens.json --format tailwind

```

  1. Validate — `node <skills-root>/design-tokens/scripts/tokens.mjs

validate --dir src/` until clean (exit 0 is the evidence); convert

hardcoded values to var(--token).

  1. Export the deck templates — emit the locked-variable brand deck

templates from CODE0 — marp-brand-deck.md.example

(copy to .md to use) and reveal-brand-deck.yaml — substituting the brand

variables from tokens.json. No render engine is owned (decision 7); the

templates feed the user's own deck tool.

  1. Publish tokens.json as the source of truth other surfaces read

(pack-ai-image generation, greenfield scaffold) per the consumption contract.

Output format

  1. tokens.json — DTCG 3-layer (primitive → semantic → component) + dark.semantic + typography, every value {$value, $type}.
  2. Generated design-tokens.css + the Tailwind theme.extend snippet.
  3. validate evidence — exit 0, or the token_violation findings handed to polish.
  4. The exported brand deck templates (Marp + reveal) with brand variables locked from the tokens.

Gotcha

consumer-side copy.** pack-ai-image generation and the greenfield scaffold read

this file; a hand-edited downstream copy silently drifts from the brand.

the consumer's existing brand; a value with no brand provenance is off-brand

(CODE0 § Iron Law 2 flags it).

template; reference the token so the deck stays on-brand when tokens change.

Do NOT

CODE0 / brand-asset-generation

generate the marks from the tokens (B → A, never inverted).

See also

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.