create-component
БесплатноБез исполняемых скриптовНе проверенCreate a new Spark UI component with complete file structure including component, styles, tests, stories, and documentation. Use when the user wants to create…
от leboncoin★ 94 звезды на GitHubОб этом скилле
Create Component
Create a new Spark UI component following the project's standards and file structure.
When to Use
- User wants to create a new component
- User mentions "new component", "add component", or "create component"
- User is implementing a component from a design
Instructions
Determine component location: Components go in
packages/components/src/<component-name>/Create the file structure:
component-name/ ├── ComponentName.tsx # Main component ├── ComponentName.styles.tsx # Styling with CVA ├── ComponentName.test.tsx # Unit tests ├── ComponentName.stories.tsx # Storybook stories ├── ComponentName.doc.mdx # Documentation ├── index.ts # Exports └── variants/ # Style variants (if applicable)Component Implementation:
- Use TypeScript with strict typing
- Implement polymorphic behavior with
asChildprop if needed - Use CVA (Class Variance Authority) for styling variants
- Include
data-spark-componentattribute - Ensure WCAG 2.1 AA compliance
- Use proper ARIA attributes
Styling:
- Create
ComponentName.styles.tsxwith CVA - Define variants (size, variant, etc.)
- Use TailwindCSS classes
- Create
Tests:
- Create
ComponentName.test.tsxwith Vitest + React Testing Library - Test rendering, props, variants, and accessibility
- Test user interactions
- Create
Stories:
- Create
ComponentName.stories.tsxfollowing Storybook CSF format - Use
Components/*meta structure - Create stories for: Default, Uncontrolled, Controlled, and other variants
- One story per prop/feature
- Create
Documentation:
- Create
ComponentName.doc.mdxwith sections in this order:- Title (H1)
- Meta (link to stories)
- Install
- Import
- Props table (using ArgTypes component)
- Usage (Default, Uncontrolled, Controlled, others alphabetically)
- Advanced Usage
- Accessibility
- Create
Exports:
- Create
index.tswith named exports - Export component, types, and sub-components if compound
- Create
For Compound Components:
- Use Object.assign pattern
- Set display names for all sub-components
- Document sub-components in ArgTypes
Verify:
- Run
npm run lintto check code quality - Run
npm run typecheckto verify types - Run tests to ensure they pass
- Check Storybook renders correctly
- Run
Examples
Reference existing components in packages/components/src/ for patterns:
- Simple component:
badge/,button/ - Compound component:
card/,input/,accordion/ - Complex component:
combobox/,select/
Установить create-component в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл create-component?
Create a new Spark UI component with complete file structure including component, styles, tests, stories, and documentation. Use when the user wants to create a new component or add a component to the design system.
Как установить скилл create-component?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл create-component запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic