跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
设计与 UI

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.ts per 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.

PillarWhat it answersFailure mode if missing
PropsWhat you set(always present)
VariantsWhich combination to pickAgent picks invalid combinations
RelationshipsWhere the component fits structurally and a11y-wiseAgent generates code that compiles but is structurally wrong
Tokens (component-scoped)Which design values bind to this componentAgent 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. Use invalidCombinations for cells that shouldn't ship.
  • Accessibility folds into Relationships. ARIA role, keyboardSupport, and screenReader describe 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

阅读完整来源 ↗