From design-system-ops
Generates structured JSON metadata schemas for design system components encoding props, behavioral rules, composition constraints, prohibited combinations, and accessibility contracts for tooling like MCP servers, linters, and code generators.
npx claudepluginhub murphytrueman/design-system-opsThis skill uses the workspace's default tool permissions.
A skill for generating structured JSON metadata schemas for design system components. These schemas encode everything an AI agent, MCP server, code generator, or testing framework needs to work with a component programmatically — props, behavioural rules, composition constraints, accessibility contracts, and business context — in a format that does not require natural language parsing.
Generates AI-optimized prose descriptions for UI components in six-section format (purpose, props, anti-patterns, composition, accessibility, examples) for Figma MCP server and LLM consumption.
Implements Atomic Design hierarchy (Atoms, Molecules, Organisms, Templates, Pages) for design systems, producing component inventories, design token audits, composition rules, and Storybook coverage reports.
Generates detailed UI component specifications for design systems, including anatomy, variants, props, states, behavior, accessibility, and usage guidelines.
Share bugs, ideas, or general feedback.
A skill for generating structured JSON metadata schemas for design system components. These schemas encode everything an AI agent, MCP server, code generator, or testing framework needs to work with a component programmatically — props, behavioural rules, composition constraints, accessibility contracts, and business context — in a format that does not require natural language parsing.
Component documentation serves humans. Component metadata serves machines. The distinction matters because the information needs are different, the format requirements are different, and the failure modes are different.
A human reading a component's documentation can infer that "this button triggers the primary action" means it should be visually prominent and placed in the expected location. A code generation agent reading that same string cannot infer any of that — it needs explicit data: { "role": "primary_action", "visual_weight": "high", "placement": ["form_footer", "dialog_footer", "page_header"] }.
Most design systems have one layer of machine-readable data: TypeScript interfaces or PropTypes declarations that define prop names and types. This is necessary but insufficient. A TypeScript interface tells a tool that a Button accepts a variant prop of type "primary" | "secondary" | "ghost" — but it does not tell the tool when to use primary vs secondary, which combinations of props are prohibited, where the component can be placed in a layout, or what accessibility contract it must honour.
Structured metadata fills this gap. It encodes the knowledge layer between "what the component accepts" (TypeScript) and "how the component should be used" (documentation) as machine-readable data that tooling consumes directly.
The ai-component-description skill produces text descriptions optimised for LLM consumption. This skill produces structured data optimised for programmatic consumption. Together they serve the two modes of AI interaction: conversational (descriptions) and deterministic (metadata).
This skill generates structured JSON metadata schemas for tooling consumption — not human-readable documentation (use usage-guidelines or pattern-documentation for that) or LLM-facing descriptions (use ai-component-description). If the system has no component inventory yet, run component-audit or codebase-index first. If the team has no current need for machine-readable metadata (no MCP server, no code generation, no linting integration), this skill adds overhead without value — discuss the use case before generating.
Before producing output, check for a .ds-ops-config.yml file in the project root. If present, load:
system.framework — determines prop extraction approach (React, Vue, Svelte, etc.)system.component_paths — directs scanning to component source filesintegrations.* — enables auto-pull for component datametadata.schema_version — locks the output schema version for compatibilitymetadata.output_directory — overrides default output locationmetadata.include_business_context — toggles the business intelligence section (default: true)If integrations are configured in .ds-ops-config.yml, pull data automatically:
Figma MCP (integrations.figma.enabled: true):
integrations.figma.file_keyStorybook (integrations.storybook.enabled: true):
TypeScript/Source (always attempted):
If an integration fails, log it and proceed with available sources.
Ask for or confirm (skip questions already answered by auto-pull):
For each component, scan for existing metadata sources:
.metadata.json, .metadata.ts)Produce a source assessment per component:
| Component | TS interface | JSDoc | Storybook | Figma | Existing metadata | Gaps |
|---|---|---|---|---|---|---|
| Button | complete | partial | complete | yes | none | composition, behaviour |
| Card | complete | none | partial | yes | none | all semantic layers |
For each component, extract the prop layer automatically from TypeScript or equivalent:
{
"$schema": "https://designsystemops.com/schemas/metadata/v1.json",
"component": "Button",
"version": "1.0.0",
"status": "stable",
"props": [
{
"name": "variant",
"type": "enum",
"values": ["primary", "secondary", "ghost"],
"default": "primary",
"required": false,
"description": "Visual weight of the button",
"semantic": {
"primary": "Use for the single most important action on the page or in a section",
"secondary": "Use for supporting actions alongside a primary action",
"ghost": "Use for tertiary actions or actions within dense UI"
}
},
{
"name": "size",
"type": "enum",
"values": ["sm", "md", "lg"],
"default": "md",
"required": false,
"description": "Controls button height and text size"
},
{
"name": "disabled",
"type": "boolean",
"default": false,
"required": false,
"description": "Prevents interaction and applies disabled styling"
},
{
"name": "children",
"type": "ReactNode",
"required": true,
"description": "Button label content"
}
]
}
Extraction rules:
string, number, boolean, enum, ReactNode, function, object, arrayundefinedThe semantic layer encodes meaning that TypeScript types cannot express. For each component, add:
{
"behaviour": {
"states": ["default", "hover", "active", "focus", "disabled", "loading"],
"transitions": {
"default_to_loading": {
"trigger": "Form submission or async action",
"visual": "Replace label with spinner, disable interaction",
"duration": "Until async operation completes or times out"
}
},
"constraints": [
"A form must have exactly one primary variant Button",
"Loading state must disable all sibling interactive elements",
"Icon-only buttons must have an aria-label prop"
]
}
}
{
"composition": {
"valid_parents": ["Form", "Card", "Dialog", "Toolbar", "PageHeader"],
"valid_children": ["Icon", "text"],
"prohibited_nesting": ["Button may not contain another Button"],
"slot_contract": {
"children": {
"accepts": ["string", "Icon"],
"max_elements": 2,
"pattern": "Optional leading Icon + text label"
}
},
"common_combinations": [
{ "pattern": "Primary + Secondary pair", "context": "Dialog footer, form actions" },
{ "pattern": "Icon-only in Toolbar", "context": "Dense action bars" }
]
}
}
{
"accessibility": {
"role": "button",
"aria_required": [],
"aria_conditional": [
{ "prop": "aria-label", "when": "children is Icon only (no visible text)" },
{ "prop": "aria-expanded", "when": "button controls a collapsible region" },
{ "prop": "aria-haspopup", "when": "button opens a menu or dialog" }
],
"keyboard": {
"Enter": "Activate button",
"Space": "Activate button"
},
"focus": {
"receives_focus": true,
"focus_visible": "Required — uses system focus ring token",
"tab_order": "Follows DOM order unless explicitly managed"
},
"screen_reader": {
"announcement": "Button label + role",
"state_changes": "Announces disabled state change"
}
}
}
The business context layer connects the component to product outcomes. This layer is optional but recommended for components that directly influence conversion, engagement, or retention.
{
"business_context": {
"function": "conversion",
"metrics": {
"primary": "Click-through rate",
"secondary": ["Form completion rate"]
},
"experimentation": {
"safe_to_test": ["label text", "variant within brand palette"],
"never_test": ["removing disabled state logic", "removing aria attributes"],
"requires_review": ["changing size scale", "adding new variants"]
},
"usage_analytics": {
"track_renders": true,
"track_interactions": true,
"track_errors": true,
"custom_events": [
{ "event": "cta_click", "data": ["variant", "page", "position"] }
]
}
}
}
When to include business context:
Encode prop combinations that are technically valid but semantically wrong:
{
"prohibited_combinations": [
{
"combination": { "variant": "ghost", "size": "lg" },
"reason": "Ghost buttons at large size create false visual hierarchy — they appear as primary actions despite being tertiary",
"severity": "warning"
},
{
"combination": { "disabled": true, "loading": true },
"reason": "Redundant states — loading already prevents interaction. Use loading alone.",
"severity": "error"
}
]
}
Severity levels:
error — this combination is prohibited and tools should refuse to generate itwarning — this combination is discouraged and tools should flag it for reviewinfo — this combination has nuances the developer should be aware ofAssemble all layers into the complete metadata schema per component.
.ai/metadata/
schema.json # JSON Schema definition for validation
Button.metadata.json
Card.metadata.json
Modal.metadata.json
...
manifest.json # Index of all metadata files
{
"$schema": "https://designsystemops.com/schemas/metadata/v1.json",
"generated": "[date]",
"system": "[design system name]",
"component_count": 55,
"coverage": {
"props": "100%",
"semantic": "85%",
"accessibility": "90%",
"business_context": "40%",
"prohibited_combinations": "60%"
},
"components": [
{ "name": "Button", "file": "Button.metadata.json", "status": "stable" },
{ "name": "Card", "file": "Card.metadata.json", "status": "stable" }
]
}
Run validation checks on the generated schemas:
Structural validation:
Semantic validation:
Cross-reference validation:
Coverage reporting:
.ai/metadata/ directory