npx skills add ...
npx skills add thedesignproject/agent-skills --skill agentic-design-systems
Use when designing, scaffolding, extending, or auditing a component library whose primary consumer is an AI agent — i.e. the design system needs machine-readable metadata (props, variants, relationships, tokens, anti-patterns) rather than only prose docs. Triggers include "agentic design system", "design system for AI/Claude", "make my design system AI-readable", "component metadata schema", "scaffold a UI library for an agent", or planning a new component library where the main consumer is an LLM. Don't use this skill for purely human-facing design system work — use figma:figma-generate-library for that.
npx skills add thedesignproject/agent-skills --skill agentic-design-systems
When this skill triggers, you're helping the user build, extend, or audit a component library whose primary consumer is an AI agent. The bar: given a prose request like "Build a confirmation modal with a destructive action," an agent picks the right component, the right variant, and the right tokens — without inventing patterns.
This skill gives you the schema, the workflow, and the principles. Adapt it to where the user is.
Before producing anything, figure out which mode applies:
meta.types.ts, then write a .meta.ts per component, then build the index and validator. Anti-patterns first (see Step 5).If the prompt is ambiguous, ask one targeted question — don't guess.
Treat every component as the intersection of four things. Most metadata schemas only model the first; that's why agents misuse the components.
| Pillar | What it answers | Failure mode if missing |
|---|---|---|
| Props | What you set | (always present) |
| Variants | Which combination to pick | Agent picks invalid combinations |
| Relationships | Where the component fits structurally and a11y-wise | Agent generates code that compiles but is structurally wrong |
| Tokens (component-scoped) | Which design values bind to this component | Agent invents colors and spacing |
Plus aiHints — the meta layer that tells an agent when to use the component, which variant fits which situation, and what never to do.
button-primary-bg-hover, button-primary-bg-disabled, etc. Theming becomes a token swap; one source of truth.appearance × size × density) and let the agent pick a cell. Use invalidCombinations for cells that shouldn't ship.role, keyboardSupport, and screenReader describe how the component fits into the document and interaction model — that's relational. No separate a11y pillar.{scenario, reason, alternative} triples — they force precision.Write this once at meta.types.ts. Every component's .meta.ts imports it and is type-checked. The schema is the contract.
When generating a component's .meta.ts, fill every field that applies. Empty arrays are fine; missing keys aren't — that's what the validator catches.
Recommend a sibling package inside the consuming app's monorepo (packages/ui-next/). Switchover later is just an import rewrite. A separate repo only makes sense when independent versioning is required.
Write meta.types.ts before any components. Everything else flows from it.
Pick something small and high-traffic. Button is canonical. Ship the full set together:
Wire up Storybook early (.storybook/main.ts for story discovery, .storybook/preview.ts for theme imports). One story per variant matrix cell makes design-space regressions obvious at a glance.
Metadata ships with the component or the component doesn't ship. Don't defer it.
tokens/core.css — raw brand palette and scales (--color-brand-600, --space-4).tokens/themes/*.css — map component-scoped tokens (--button-primary-bg) to core values.Component CSS only ever references component-scoped tokens. Theme swaps stay mechanical.
For each component, write the antiPatterns array before writing the implementation. The structured-triple format (scenario, reason, alternative) forces precision — you can't write "don't overuse primary buttons"; you have to write which scenario, why it's wrong, what to do instead. The anti-patterns end up driving the API.
Variants aren't a flat list of strings. Declare axes (appearance × size × density) so the agent picks along independent dimensions. Use invalidCombinations to rule out cells that shouldn't ship (e.g. appearance: "ghost" × size: "xs" — too small to be tappable).
requires — providers that must exist abovemustBeChildOf / mustBeParentOf — structural constraintstriggers — events emittedblocksWhen — prop-state-dependent behaviorexposesState — what descendants can readThis is the pillar that prevents agents from generating code that compiles but is structurally wrong.
Generate metadata/index.json — a flat list of {name, category, path, keywords, priority}. Agents scan this first to shortlist candidates, then read the full .meta.ts only for relevant components. Cheap discovery, expensive depth.
Build with a script (scripts/build-index.ts) that walks every *.meta.ts, dynamically imports each one, and writes the JSON. Run it on every metadata change so the index can never lie about what exists.
A short script (scripts/validate-metadata.ts) walks every *.meta.ts (via fast-glob), dynamically imports each one, shape-checks the export, and asserts:
aiHints.selectionCriteria or variants.purposetokens.* key is component-scoped (kebab-case of the component name)antiPatterns is non-empty for priority: "high" componentsrelationships.role / keyboardSupport / screenReader are non-empty (enforces the "a11y folds into Relationships" decision)invalidCombinations references only declared axis valuesRun in CI. If the metadata is wrong, the build fails. The schema is enforced, not aspirational.
Don't switch over at the end — switch per-component as parity is reached.
states block. No behavior.states array.The user hands an agent a Figma screenshot or a prose request — "Build a confirmation modal with a destructive action" — and the agent:
metadata/index.json and shortlists Modal, Button, Heading..meta.ts.Button.relationships.mustBeChildOf includes ModalFooter; picks appearance: "danger" from aiHints.selectionCriteria.appearance: "primary" siblings because antiPatterns flags it.That's the bar. If the metadata can't get an agent to that outcome, fix the metadata.
Button/
Button.tsx ← implementation
Button.meta.ts ← four pillars + aiHints
Button.tokens.css ← component-scoped tokens
Button.stories.tsx ← visual test surface
Button.test.tsx ← behavior tests
index.ts ← single canonical export