ajyadav013/claude-kit/component-design
Claude Code and agent skill by ajyadav013/claude-kit
- community
Checking that the SKILL.md file is still in the repository.
Create or restructure a UI component — architecture, component patterns, accessibility, design-system rules. Use when adding a new component, splitting a large one, or making one reusable. App-level work belongs to frontend-ui-engineering.
Install
npx vskill@latest install ajyadav013/claude-kit/component-designSKILL.md
The same SKILL.md was published earlier as ajyadav013/claude-kit/component-design.
Design and implement the component: $ARGUMENTS.
Steps
- Read the design system: Read
.claude/rules/ui-design-system.md(foundations & index) and.claude/rules/ui-components.md(component standards — cards, badges, buttons, form controls, compound components), both installed as React overlay rules — or a project'sdocs/references/ui/ui-design-system.mdequivalent. Read whichever is present.
- Check existing components: Check the project's component directory for available UI primitives and established patterns. Search for similar components to follow the project's conventions.
- Determine component type:
| Type | Location | Naming | Export | |
|---|---|---|---|---|
| UI primitive | Project's UI primitives directory | Follow project naming convention | Add to barrel export if applicable | |
| Compound component | Project's UI primitives directory | Follow project naming convention | Add to barrel export if applicable | |
| Feature component | Project's feature directory | Follow project naming convention | Named export | |
| Page sub-component | Same file as page or shared directory | Follow project naming convention | Not exported |
- Design the component API:
### Props/Interface Design Checklist
- Use the project's type system for component interfaces
- Required props first, optional props after
- Use the project's composition pattern (children prop, slots, etc.)
- Support style extension (className, style, css prop, etc.)
- Event handlers: consistent naming convention (
on<Event>,handle<Event>, etc.) - Use discriminated unions or enums for variant props
- No boolean prop overload — use string union types or enums for variants
### Example (TypeScript/React-style) ``tsx interface MetricCardProps { title: string; value: string | number; trend?: { direction: 'up' | 'down' | 'flat'; percentage: number }; status?: 'green' | 'amber' | 'red'; className?: string; onClick?: () => void; } ``
### Example (Template-based framework style) ``vue interface Props { title: string value: string | number trend?: { direction: 'up' | 'down' | 'flat'; percentage: number } status?: 'green' | 'amber' | 'red' } ``
- Implement following these rules:
### Structure
- Follow the project's import ordering conventions
- Type definitions near the top
- Hooks/lifecycle methods in consistent order
- Derived values and computed properties
- Event handlers
- Early returns for loading, empty, and error states
- Main render/template
### Compound Component Pattern When building a compound component (e.g., Card, DetailPanel):
- Parent component provides shared context
- Sub-components consume context or accept explicit props
- Usage: compose sub-components within parent wrapper
Example: `` <Card> <CardHeader>Title</CardHeader> <CardContent>Body</CardContent> </Card> ``
### Accessibility Requirements
- All interactive elements are keyboard-accessible
- Icon-only buttons have accessible labels (aria-label, title, etc.)
- Form inputs have associated labels
- Use semantic HTML or equivalent (
nav,main,section,article,button, etc.) - Focus management: visible focus indicators
- Use the project's UI library for complex interactions (dialogs, selects, dropdowns, tabs)
- Register the component: If it's a UI primitive or compound component, add it to the project's barrel export or component registry.
- Verify: Run the project's linter, type checker, and build to confirm all checks pass.
References
- UI primitives: Project's UI primitives directory/barrel export
- Design system:
.claude/rules/ui-design-system.md(foundations) +.claude/rules/ui-components.md+.claude/rules/ui-layout-and-motion.md(React overlay) ordocs/references/ui/ui-design-system.md(if present) - UX patterns:
.claude/rules/ux-patterns.md+.claude/rules/ux-dashboard-patterns.md(React overlay) ordocs/references/ui/ux-patterns.md(if present) - Rules:
.claude/rules/frontend-best-practices.md,.claude/rules/responsive-and-accessibility.md
Examples
The following examples use React/TypeScript syntax, but the principles apply to any component-based framework. Adapt patterns to your project's stack (Vue, Svelte, Angular, etc.).
Simple presentational component
Interactive component with UI library
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/component-design/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ajyadav013/claude-kit/component-design)