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.
thedesignproject · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add thedesignproject/agent-skills --skill agentic-design-systems技能说明
name: agentic-design-systems description: 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.
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.
Diagnose first
Before producing anything, figure out which mode applies:
- Greenfield — user is starting a new system intended for agent consumption. Walk through the build workflow. Start with the schema and one worked component (Button is canonical); don't try to scaffold everything at once.
- Retrofitting — user has a component library and wants to make it agent-readable. Skip workspace setup. Add
meta.types.ts, then write a.meta.tsper component, then build the index and validator. Anti-patterns first (see Step 5). - Auditing — user has metadata already. Score each component against the four pillars and the validator checks. Flag missing relationships, prose anti-patterns, raw global tokens, and ungrounded variant axes.
- Single component — user wants to add or fix one component. Generate the full file set in Step 3. Metadata ships with the component or it doesn't ship.
If the prompt is ambiguous, ask one targeted question — don't guess.
The four pillars
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.
Four design decisions baked into the schema
- States are implicit in tokens, not a separate pillar. Encode
button-primary-bg-hover,button-primary-bg-disabled, etc. Theming becomes a token swap; one source of truth. - Variants are a matrix, not a flat enum. Declare axes (
appearance × size × density) and let the agent pick a cell. UseinvalidCombinationsfor cells that shouldn't ship. - Accessibility folds into Relationships. ARIA
role,keyboardSupport, andscreenReaderdescribe how the component fits into the document and interaction model — that's relational. No separate a11y pillar. - Anti-patterns are first-class and structured. Never prose. Always
{scenario, reason, alternative}triples — they force precision.
The schema (canonical contract)
Write this once at meta.types.ts. Every component's .meta.ts imports it and is type-checked. The schema is the contract.
interface ComponentMeta {
component: {
name: string;
category: "atoms" | "molecules" | "organisms";
type: "interactive" | "display" | "container" | "input" | "navigation";
description: string;
path: string;
figma?: { nodeId: string | null };
};
props: Record<string, PropDef>;
variants: {
axes: Record<string, readonly string[]>;
purpose: Record<`${string}.${string}`, string>;
invalidCombinations?: { axes: Record<string, string>; reason: string }[];
};
relationships: {
requires?: string[]; // contexts/providers above
mustBeChildOf?: string[];
mustBeParentOf?: string[];
optionalSibling?: string[];
commonPartners?: string[];
triggers?: string[]; // events emitted
blocksWhen?: { when: string; effect: string }[];
exposesState?: string[]; // state descendants can read
role: string; // a11y
keyboardSupport: string;
screenReader: string;
};
tokens: {
color?: Record<string, string>;
spacing?: Record<string, string>;
typography?: Record<string, string>;
border?: Record<string, string>;
motion?: Record<string, string>;
elevation?: Record<string, string>;
};
aiHints: {
priority: "high" | "medium" | "low";
keywords: string[];
selectionCriteria: Record<string, string>;
usage: {
useCases: string[];
commonPatterns: { name: string; composition: string }[];
antiPatterns: { scenario: string; reason: string; alternative: string }[];
};
};
}
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.
Build workflow
Step 1 — Workspace shape
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.
Step 2 — Schema as TypeScript contract
Write meta.types.ts b