Install
$ agentstack add skill-peiqingzhang-art-inspired-design-system-for-ai-tokens-to-components ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Tokens to Components
Generate a complete, production-ready component library from DTCG design tokens. The output is a set of React components styled entirely by the token system.
Why this matters
Design tokens alone don't ship products — components do. This skill bridges the gap between a token JSON file and actual usable UI. Every color, font, radius, and spacing value in the output traces back to a named token, so changing a token cascades everywhere. No magic numbers, no hardcoded hex values.
Prerequisites
This skill expects design tokens in one of these formats:
- DTCG JSON (
.tokens.jsonfiles) — preferred, output by thepainting-to-m3orpainting-to-themeskills - CSS custom properties (
theme.cssfile with--color-*variables) - Raw JSON with at minimum: primary/secondary/tertiary colors, font names, spacing scale
If the user doesn't have tokens yet, suggest the painting-to-m3 skill (strict M3) or painting-to-theme skill (expressive/painting-faithful) first.
Step 0: Check for Design Brief
Before parsing tokens, check if a design-brief.md file exists in the token directory or its sibling review directory:
ls /tokens/design-brief.md # before review files are moved
ls /review/design-brief.md # after review files are moved
If found, read it. Extract:
- Theme name — use in preview HTML title, README heading, and component output directory name
- Mood — reference in preview page subtitle and README description
- Design intent — use as the README's introductory sentence
- Intended use case — helps decide which component preset to recommend in Step 2
The design brief is the handoff contract from the painting-to-m3 or painting-to-theme skill. It carries the reasoning behind the token choices that is not visible in raw JSON. Using it makes your component output more coherent with the design intent.
Also check for a Painting Color Proportions section in the brief. When proportions are present, the token system has already tinted surface/neutral palettes to match the dominant painting color's atmospheric presence. The preview HTML will automatically render a proportion bar showing the painting's color balance alongside the components, helping users see the visual connection between their source painting and the generated UI.
Workflow Overview
Tokens → Parse → Generate Component CSS → Build React Components → Present to User
Step 1: Parse the Tokens
Read the token files and resolve all aliases to concrete values. Build an internal lookup:
resolved = {
"color.sys.light.primary": "#5c5ea1",
"color.sys.light.on-primary": "#ffffff",
...
"typography.sys.body-large.fontFamily": "Source Serif 4",
"typography.sys.body-large.fontSize": "16px",
...
"shape.corner.medium": "12px",
"spacing.4": "16px",
...
}
Use the parsing script at scripts/parse_tokens.py to do this:
python scripts/parse_tokens.py --token-dir ./themes/{painting-name}/{variant}/tokens/ --output ./themes/{painting-name}/{variant}/tokens/resolved.json
Optionally, pass --css to also output CSS custom properties directly.
Step 2: Ask the Human What They Need
Before generating 25 components the user doesn't need, ask:
- What kind of project? This determines which components to prioritize.
- Web app / dashboard → buttons, cards, inputs, tables, navigation, dialogs
- Marketing site → hero sections, CTAs, testimonial cards, feature grids
- Mobile-first → bottom sheets, FABs, compact cards, swipe actions
- Which component set? Offer these presets:
- Core (always recommended): Button, Card, Input, Chip, Badge, Avatar, Divider
- Navigation: AppBar, Tabs, Sidebar, Breadcrumb, Bottom Navigation
- Data: Table, List, DataCard, Stat
- Feedback: Dialog, Snackbar, Tooltip, Progress, Skeleton
- Layout: Container, Grid, Stack, Surface
- All — generates everything
- TypeScript or JavaScript?
- TypeScript (default for new projects) — generates
.tsxfiles withPropsinterfaces, typed sub-components, andindex.ts - JavaScript — generates
.jsxfiles withindex.js
- Storybook?
- Yes — generates
[Component].stories.tsxalongside each component, with named exports per variant - No (default) — skip story files
- Framework target?
- React + Tailwind (default — generates .tsx/.jsx with CSS variables mapped to tokens)
- React + CSS Modules (generates component + .module.css)
- Plain HTML + CSS (generates .html + .css)
Step 3: Generate the Component Library
For each component, follow this pattern:
Component Generation Rules
- Token-first styling: Every visual property MUST reference a token. Never hardcode:
- Colors →
var(--color-*)from color tokens - Font →
var(--font-brand)/var(--font-plain)from typography tokens - Radius →
var(--radius-*)from shape tokens - Spacing →
var(--spacing-*)from spacing tokens
- M3 component anatomy: Follow Material Design 3 component specs:
- Button: container + label + optional icon, uses primary/onPrimary roles
- Card: surface container + content area, uses surface-container roles
- Input: container + label + supporting text, uses outline/surface-variant roles
- etc.
- Variants per component: Generate at minimum:
- Filled variant (uses primary container color)
- Outlined variant (uses outline color with transparent fill)
- Text/Tonal variant (uses primary-container with on-primary-container text)
- State layers: All interactive components include M3 state layers via
.m3-interactive+.state-layerCSS classes defined intheme.css. Do not usefilter: brightness()as a substitute. The state layer is a `inside aposition: relative` container:
- Hover: 8% opacity
- Focus-visible: 12% opacity
- Pressed (active): 12% opacity
- Disabled: no overlay (component uses 38% opacity on content instead)
- Accessibility: All interactive components MUST meet WCAG 2.1 AA keyboard accessibility:
- Focusable via Tab (
tabIndex={0}on non-native-interactive elements) - Activatable via Enter/Space (
onKeyDownhandler) - Correct ARIA roles (
role="option"for chips,role="article"for cards, etc.) - Proper label associations (
htmlFor/idpairing for inputs) aria-invalid,aria-describedbyfor form elementsaria-labelon icon-only elements (badges, avatars)
Component Templates
Read the component templates in references/component-specs.md for detailed specifications of each M3 component's anatomy, variants, and token mappings.
Step 4: Generate the Output Files
For React + Tailwind (default)
Run the script:
python scripts/generate_components.py \
--resolved-tokens ./themes/{painting-name}/{variant}/tokens/resolved.json \
--output-dir ./themes/{painting-name}/{variant}/components \
--review-dir ./themes/{painting-name}/{variant}/review \
--theme-name "Van Gogh — Green Wheat Fields" \
--sets all \
[--no-typescript] # default is TypeScript on
[--storybook] # off by default
CLI parameters:
--resolved-tokens(required): Path to resolved.json from parse_tokens.py--output-dir: Component output directory (default:./components)--review-dir: Directory for preview.html and README.md (defaults to--output-dir)--theme-name: Theme name used in README and preview title--sets: Comma-separated set names (core,navigation,data,feedback,layout) orall(default:core)--components: Optional comma-separated individual component names, merged with--sets--no-typescript: Generate plain .jsx files instead of TypeScript--storybook: Generate .stories.tsx files for each component
The script automatically generates all output: component files, theme.css, index.ts, preview.html, and README.md. Review files (preview.html, README.md) go to --review-dir when specified.
If the script is unavailable, generate the preview HTML manually following the template in references/preview-template.html.
Step 5: Present and Iterate
Show the user:
- The preview HTML (render it or share the file)
- A summary: "Generated X components with Y variants using your [theme name] tokens"
- The component files ready for download, including
README.md - If Storybook was generated, note which story files were created
Ask:
- Do the components feel right with these colors and typography?
- Any components you want to add or modify?
- Should I adjust any token mappings (e.g., make cards use a different surface level)?
- Do you want Storybook stories generated for any components?
Reference Files
references/component-specs.md— Detailed M3 component anatomy and token mappingsscripts/parse_tokens.py— Token parser and alias resolverreferences/preview-template.html— Fallback template for preview.html if the script is unavailablescripts/generate_components.py— Component code generator (also generates preview.html and README.md)
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: peiqingzhang
- Source: peiqingzhang/artinspireddesignsystemfor_AI
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.