mcpField
S
shadcn

shadcn

github.com/pymodelDesign & UI40471 installsUpdated 4w ago
Repository

About shadcn

A best-practices guide for developers building shadcn/ui applications, covering component architecture, accessibility, styling, forms, and data display. It highlights checking whether project components use Radix UI or Base UI before applying primitive-specific guidance.

Key features

  1. 01Eight prioritized rule categories
  2. 02Radix UI and Base UI guidance
  3. 03Accessibility practices
  4. 04Styling and theming advice
  5. 05Form and data-display patterns

Use cases

  1. 01Building or composing shadcn/ui components
  2. 02Reviewing accessibility and styling
  3. 03Implementing forms and data displays

MCP support

The guide includes a rule for using the current CLI for component lifecycle, registries, and MCP.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pymodel/react-frontend-skills --skill shadcn

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

Bundled files

References and scripts installed along with SKILL.md.

references/
ally-ensure-color-contrast.md
ally-maintain-focus-management.md
ally-preserve-aria-attributes.md
ally-preserve-keyboard-navigation.md
ally-provide-sr-only-labels.md
arch-current-cli-registry.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-unified-radix-package.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
data-use-skeleton-loading-states.md
data-use-tanstack-table-for-complex-tables.md
data-virtualize-large-lists.md
form-handle-async-validation.md
form-reset-form-state-correctly.md
form-show-validation-errors-correctly.md
form-use-react-hook-form-integration.md
form-use-zod-for-schema-validation.md
perf-avoid-unnecessary-rerenders-in-forms.md

Details

From the project README

shadcn/ui Community Best Practices

Current best-practices guide for shadcn/ui applications. Before applying primitive-specific guidance, inspect whether the checked-in components use Radix UI or Base UI; current shadcn supports both (Base UI is the default for new projects) and their composition APIs differ. Component installs and upgrades go through the current CLI (v4), which resolves namespaced registries.

When to Apply

Reference these guidelines when:

  • 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
1Component ArchitectureCRITICALarch-
2Accessibility PreservationCRITICALally-
3Styling & ThemingHIGHstyle-
4Form PatternsHIGHform-
5Data DisplayMEDIUM-HIGHdata-
6Component CompositionMEDIUMcomp-
7Performance OptimizationMEDIUMperf-
8State ManagementLOW-MEDIUMstate-

Quick Reference

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

How to Use

Run in the project root first:

npx -y @pymodel/react-frontend-skills detect  # installed vs. targeted versions

Read references/<rule-id>.md for each rule above that matches the task: why it matters, then incorrect vs. correct code.

Comments

Markdown supported