Loading...
Loading...
Generate AI-ready metadata for design system components to enable intelligent UI generation. Analyzes component structure and generates structured metadata that helps AI understand when and how to use components correctly. Useful for teams building AI-consumable design systems.
npx skill4agent add thedesignproject/agent-skills ai-component-metadatascripts/generate_metadata.py# Automatic generation (reads component file)
python scripts/generate_metadata.py path/to/Component.tsx
# Or use the template directly
cp assets/metadata-template.tsx your-component-metadata.tsxexport const componentMetadata = {
component: {
name: "ComponentName",
category: "atoms|molecules|organisms",
description: "Brief description",
type: "interactive|display|container|input|navigation"
},
usage: {
useCases: ["primary-use", "secondary-use"],
requiredProps: [],
commonPatterns: [
{
name: "pattern-name",
description: "When to use",
composition: "JSX example"
}
],
antiPatterns: [
{
scenario: "what-not-to-do",
reason: "why",
alternative: "what-instead"
}
]
},
composition: {
slots: {},
nestedComponents: [],
commonPartners: [],
parentConstraints: []
},
behavior: {
states: [],
interactions: {},
responsive: {}
},
accessibility: {
role: "ARIA role",
keyboardSupport: "description",
screenReader: "behavior",
focusManagement: "strategy",
wcag: "AA"
},
aiHints: {
priority: "high|medium|low",
keywords: [],
context: "when to use"
}
}// Figma provides visual context
const figmaContext = await Figma.get_design_context();
// Your metadata provides behavioral context
const componentMetadata = components.Button.metadata;
// AI combines both for complete understanding