Back to list
shadcraft

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

CategoryDescriptionFile
CompositionComponent composition patternscomposition.md
AccessibilityInclusive, usable componentsaccessibility.md
State ManagementControlled/uncontrolled patternsstate-management.md
Design TokensSemantic theming architecturedesign-tokens.md
Styling PatternsTailwind CSS and class managementstyling-patterns.md
TypeScript PatternsType-safe, flexible componentstypescript-patterns.md
PolymorphismThe as prop patternpolymorphism.md
asChild PatternRadix Slot compositionas-child-pattern.md
Data AttributesState and structure via data-*data-attributes.md
DocumentationComponent docs standardscomponent-documentation.md

Quick Reference

Core Principles

  1. Default to shadcn/ui + Radix primitives - Don't rebuild what exists
  2. Composition over configuration - Split into focused parts (Root, Trigger, Content)
  3. Semantic HTML first - Use appropriate elements, add ARIA only when needed
  4. Single element wrapping - Each component wraps one element for composability
  5. Extend native attributes - Use React.ComponentProps<'element'> patterns
  6. Data attributes for state - Use data-state, data-slot instead of prop explosion
  7. 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