mcpField
S
shadcn

shadcn

github.com/shipshitdevDesign & UI3892 installsUpdated today
Repository

About shadcn

A best-practice skill for teams building and refactoring shadcn/ui projects. Its prioritized rules cover setup, component composition, accessibility, styling, forms, data display, and performance.

Key features

  1. 0158 prioritized rules in 10 categories
  2. 02Setup and migration guidance
  3. 03Component and primitive composition patterns
  4. 04Accessibility and keyboard-use checks
  5. 05Form, table, and theme practices
  6. 06Performance and state guidance

Use cases

  1. 01Setting up or migrating shadcn/ui
  2. 02Reviewing component accessibility
  3. 03Implementing forms with validation
  4. 04Building tables for large datasets

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/shipshitdev/skills --skill shadcn

After installing, type/shadcnin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

AGENTS.md
plugin.json
README.md
assets/templates/
_template.md
references/
_sections.md
_setup-mode.md
ally-aria-invalid-errors.md
ally-checkbox-label-association.md
ally-dialog-title-required.md
ally-ensure-color-contrast.md
ally-focus-visible-styles.md
ally-form-field-labels.md
ally-maintain-focus-management.md
ally-preserve-aria-attributes.md
ally-preserve-keyboard-navigation.md
ally-provide-sr-only-labels.md
arch-extend-variants-with-cva.md
arch-forward-refs-for-composable-components.md
arch-isolate-component-variants.md
arch-preserve-radix-primitive-structure.md
arch-use-asChild-for-custom-triggers.md
arch-use-cn-for-class-merging.md
comp-combine-command-with-popover.md
comp-compose-with-compound-components.md
comp-create-reusable-form-fields.md
comp-nest-dialogs-correctly.md
comp-use-drawer-for-mobile-modals.md
comp-use-slot-pattern-for-flexibility.md
data-empty-states-with-guidance.md
data-paginate-server-side.md

Details

From the project README

shadcn/ui Community Best Practices

58 rules across 10 categories for shadcn/ui, prioritized by impact to guide automated refactoring and code generation.

Stack baseline

Rules target current shadcn/ui: Tailwind CSS v4 (CSS-first, no tailwind.config.*, tokens in @theme inline), React 19 (ref as a prop, data-slot attributes), the unified radix-ui package, OKLCH color tokens, tw-animate-css, Field + React Hook Form Controller forms, and Bun (bunx --bun shadcn@latest ...). Examples use the Radix base (--base radix); the CLI also supports a Base UI base (--base base), where triggers take a render prop instead of asChild. For a Tailwind v3 project, keep the existing config and follow the shadcn upgrade guide first.

Setup mode

Use when installing, repairing or migrating shadcn/ui (new project, existing project, Tailwind v3 to v4). Follow references/_setup-mode.md: pick the bunx --bun shadcn@latest init path, then wire Tailwind v4 CSS-first (@theme inline, @custom-variant dark), components.json with an empty tailwind.config, the cn() helper, and the validation checklist. Do only the requested setup and confirm before overwriting existing styles, config or components. After setup, the rules below apply.

When to Apply

  • Installing and configuring shadcn/ui in a project (see Setup mode)
  • Writing new shadcn/ui components or composing primitives
  • Implementing forms with React Hook Form and Zod validation
  • Building data tables or handling large dataset displays
  • Customizing themes or adding dark mode support
  • Reviewing code for accessibility compliance

Rule Categories by Priority

PriorityCategoryImpactPrefix
1CLI & Project SetupCRITICALsetup-
2Component ArchitectureCRITICALarch-
3Accessibility PreservationCRITICALally-
4Styling & ThemingHIGHstyle-
5Form PatternsHIGHform-
6Data DisplayMEDIUM-HIGHdata-
7Layout & NavigationMEDIUMlayout-
8Component CompositionMEDIUMcomp-
9Performance OptimizationMEDIUMperf-
10State ManagementLOW-MEDIUMstate-

Quick Reference

1. CLI & Project Setup (CRITICAL)
2. Component Architecture (CRITICAL)
3. Accessibility Preservation (CRITICAL)
4. Styling & Theming (HIGH)
5. Form Patterns (HIGH)
6. Data Display (MEDIUM-HIGH)
7. Layout & Navigation (MEDIUM)
8. Component Composition (MEDIUM)
9. Performance Optimization (MEDIUM)
10. State Management (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules

Comments

Markdown supported