← Back to list

component-building
by shadcraft
Free and open-source premium quality shadcn/ui components and blocks.
⭐ 23🍴 2📅 Jan 21, 2026
SKILL.md
name: component-building description: Component building guidelines for creating high-quality, accessible, and composable registry components. Triggers on tasks involving building a component, adding or building a block, new block, registry component. Use when working in src/registry/. license: MIT metadata: author: shadcraft version: "1.0.0"
Component Building Guidelines
Comprehensive component authoring guide for building registry components that follow shadcn/ui patterns, emphasizing composition, accessibility, type safety, and maintainability.
When to Apply
Reference these guidelines when:
- Creating new components in
src/registry/ - Building blocks that compose shadcn/ui primitives
- Reviewing component code for patterns and best practices
- Refactoring existing registry components
Rule Categories
| Category | Description | File |
|---|---|---|
| Composition | Component composition patterns | composition.md |
| Accessibility | Inclusive, usable components | accessibility.md |
| State Management | Controlled/uncontrolled patterns | state-management.md |
| Design Tokens | Semantic theming architecture | design-tokens.md |
| Styling Patterns | Tailwind CSS and class management | styling-patterns.md |
| TypeScript Patterns | Type-safe, flexible components | typescript-patterns.md |
| Polymorphism | The as prop pattern | polymorphism.md |
| asChild Pattern | Radix Slot composition | as-child-pattern.md |
| Data Attributes | State and structure via data-* | data-attributes.md |
| Documentation | Component docs standards | component-documentation.md |
Quick Reference
Core Principles
- Default to shadcn/ui + Radix primitives - Don't rebuild what exists
- Composition over configuration - Split into focused parts (Root, Trigger, Content)
- Semantic HTML first - Use appropriate elements, add ARIA only when needed
- Single element wrapping - Each component wraps one element for composability
- Extend native attributes - Use
React.ComponentProps<'element'>patterns - Data attributes for state - Use
data-state,data-slotinstead of prop explosion - Semantic tokens - Never hardcode colors; use design tokens
Naming Conventions
Follow established patterns from shadcn/ui and Radix UI:
- Root, Trigger, Content - For interactive compositions
- Header, Body, Footer - For structural layouts
- Title, Description - For text content areas
Key Patterns
- Controlled + Uncontrolled: Support both via
useControllableState - asChild + Slot: Merge props onto child elements without wrapper DOM
- CVA: Use Class Variance Authority for variant-heavy components
- cn(): Merge classes with Tailwind conflict resolution
How to Use
Read individual rule files for detailed explanations and examples:
rules/composition.md
rules/accessibility.md
rules/typescript-patterns.md
Each rule file contains:
- DO patterns with references to components.build guides
- DON'T anti-patterns to avoid
- Links to source documentation
Full Compiled Document
For the complete guide with all rules expanded: AGENTS.md
Score
Total Score
65/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
✓最近の活動
1ヶ月以内に更新
+10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
Reviews
💬
Reviews coming soon


