ai-component-metadata — скилл для Claude Code: метаданные компонентов
Скилл ai-component-metadata для Claude Code описывает компоненты дизайн-системы в формате метаданных для генерации интерфейсов. Запускается при разборе компонента и помогает агенту выбрать его варианты и способы использования.
MIT ★ 107 обновлён 2026-11-08
npx skills add thedesignproject/agent-skills --skill ai-component-metadata -a claude-codeЧто делает ai-component-metadata
Скилл анализирует состав компонента, его слоты и дочерние элементы, варианты, состояния, типы пропсов и атрибуты доступности. Затем он формирует метаданные со сценариями использования, ограничениями композиции, поведением и подсказками для ИИ.
Для автоматической генерации скрипт scripts/generate_metadata.py читает файл компонента; запускать его нужно через python. Альтернатива — скопировать шаблон assets/metadata-template.tsx и заполнить его вручную. Готовые метаданные предлагают проверять на задачах генерации и в Storybook; примеры кода должны запускаться.
Какие задачи решает
- описать пропсы, варианты и состояния компонента
- зафиксировать типовые сценарии и ошибки использования
- указать связи компонента с другими элементами
- сохранить сведения о доступности для генерации интерфейса
Примеры запросов агенту
- Создай метаданные для компонента
Button.tsx: опиши пропсы, состояния и доступность. - Разбери
FormField.tsxи добавь сценарии использования и анти-паттерны. - Составь метаданные для компонентов из дизайн-системы по шаблону.
Как установить ai-component-metadata
1Через Skills CLI (Vercel)
npx skills add thedesignproject/agent-skills --skill ai-component-metadata -a claude-code2Вручную: положить файлы
~/.claude/skills/ai-component-metadata/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/ai-component-metadata/
1Через Skills CLI (Vercel)
npx skills add thedesignproject/agent-skills --skill ai-component-metadata -a codex2Вручную: положить файлы
.agents/skills/ai-component-metadata/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add thedesignproject/agent-skills --skill ai-component-metadata -a cursor2Вручную: положить файлы
.cursor/skills/ai-component-metadata/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install thedesignproject/agent-skills skills/ai-component-metadata2Вручную: положить файлы
.github/skills/ai-component-metadata/SKILL.md1Через Skills CLI (Vercel)
npx skills add thedesignproject/agent-skills --skill ai-component-metadata -a gemini-cli2Командой платформы
gemini skills install https://github.com/thedesignproject/agent-skills --path skills/ai-component-metadataВручную: положить файлы
.devin/skills/ai-component-metadata/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add thedesignproject/agent-skills --skill ai-component-metadata -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы об ai-component-metadata
Как установить ai-component-metadata в Claude Code?
Выполни npx skills add thedesignproject/agent-skills --skill ai-component-metadata -a claude-code. Файл скилла находится по пути ~/.claude/skills/ai-component-metadata/SKILL.md.
Что делает ai-component-metadata?
Анализирует структуру компонента и создаёт метаданные о его назначении, использовании, поведении, составе и доступности. Эти сведения помогают ИИ корректно применять компоненты при генерации интерфейсов.
Можно ли использовать ai-component-metadata вместе с Figma MCP?
Да. Контекст дизайна из Figma MCP можно объединить с метаданными компонента, которые описывают его поведение.
Исходный текст
SKILL.md · MIT
---
name: ai-component-metadata
version: 1.0.0
description: 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.
---
# AI Component Metadata Generator
Generate structured, AI-consumable metadata for design system components to enable intelligent UI generation and component usage.
## Quick Start
When analyzing a component, use the metadata schema template in `scripts/generate_metadata.py` or follow the manual process below:
```bash
# 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.tsx
```
## Core Workflow
### 1. Analyze Component Structure
Identify:
- Component composition (slots, children)
- Available variants and states
- Props and their types
- Accessibility attributes
### 2. Generate Metadata
Create metadata following this schema:
```javascript
export 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"
}
}
```
### 3. Validate Metadata
- Test with AI generation tasks
- Verify in Storybook
- Ensure examples are runnable
## Component Categories
- **atoms**: Basic building blocks (Button, Text, Input)
- **molecules**: Simple combinations (Card, Chip, FormField)
- **organisms**: Complex components (Header, Table, Form)
## Advanced Features
For complex scenarios, see:
- **Nested components**: [NESTED.md](references/NESTED.md)
- **Integration patterns**: [INTEGRATION.md](references/INTEGRATION.md)
- **Testing strategies**: [TESTING.md](references/TESTING.md)
## Working with Figma
When combining with Figma MCP:
```javascript
// 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
```
## Best Practices
1. **Keep examples real** - Use actual, runnable code
2. **Focus on patterns** - Document common usage patterns
3. **Include anti-patterns** - Help AI avoid mistakes
4. **Validate through usage** - Test with actual AI generation
## Success Metrics
Your metadata is effective when:
- AI uses existing components instead of recreating
- Correct variants are selected based on context
- Accessibility is maintained in generated code
- Patterns are consistent across AI outputs
© thedesignproject · MIT · thedesignproject/agent-skills