#601

Global Rank · of 601 Skills

shadcn-ui AI Agent Skill

View Source: oakoss/agent-skills

Medium

Installation

npx skills add oakoss/agent-skills --skill shadcn-ui

50

Installs

shadcn/ui

Overview

Guides building accessible, customizable UI with shadcn/ui as a code generation platform (not an npm dependency). Components are copied into your project via the CLI and fully owned. Supports Radix UI or Base UI primitives, Tailwind CSS 4 with oklch color tokens, React 19 direct ref patterns, and type-safe form validation with the Field component and Zod.

When to use: Adding shadcn/ui components, theming with CSS variables and oklch colors, building forms with React Hook Form or TanStack Form, creating custom registries, composing accessible component variants, setting up dark mode.

When NOT to use: Non-React frameworks (use shadcn-vue or shadcn-svelte instead), projects using a different component library (MUI, Chakra), projects not using Tailwind CSS.

Quick Reference

Pattern API / Approach Key Points
Init project npx shadcn@latest init Auto-detects framework, configures CSS variables
Add component npx shadcn@latest add [name] Copies source code into your project
Custom project npx shadcn@latest create Pick library (Radix/Base UI), style, theme, fonts
Check updates npx shadcn@latest diff [component] Shows upstream changes for your components
Search registry npx shadcn@latest search @registry Browse and install from namespaced registries
Build registry npx shadcn@latest build Generate registry JSON from registry.json
Theme tokens :root vars + @theme inline mapping oklch color values, dark mode via .dark class
Dark mode @custom-variant dark (&:is(.dark *)) Swaps CSS variables under .dark selector
Component variant cva() from class-variance-authority Type-safe variant definitions
Polymorphic slot asChild prop with <Slot> from Radix Merge props onto child element
Direct ref ref as a regular prop forwardRef is deprecated in React 19
Form (current) <Field /> + React Hook Form + Zod Replaces legacy <Form /> component
Form (legacy) <Form /> + <FormField /> + Zod Still works but no longer actively developed
Class merging cn() utility wrapping clsx + twMerge Safely merge Tailwind classes without conflicts
Toast / notification Sonner (npx shadcn@latest add sonner) Default notification approach; auto-dismiss, stacking
Init with blocks npx shadcn@latest init sidebar-01 Bootstrap project with pre-built page blocks
RTL support dir="rtl" on root element Built-in RTL layout support for all components
New components Spinner, Kbd, ButtonGroup Recently added utility and layout components

Common Mistakes

Mistake Correct Pattern
Installing shadcn/ui as an npm dependency Use the CLI (npx shadcn@latest add) to copy source into your project
Using forwardRef with React 19 components Pass ref directly as a prop -- forwardRef is deprecated in React 19
Using HSL values for color tokens Use oklch format: --primary: oklch(0.205 0 0)
Wrapping variables with hsl() or oklch() in utilities Reference CSS variables directly: var(--primary)
Putting tokens directly in @theme {} Use :root for values + @theme inline to map them to Tailwind
Using legacy <Form /> for new forms Use <Field /> component with React Hook Form or TanStack Form
Skipping Zod validation in form components Always pair forms with Zod schemas for type-safe validation
Using div elements for interactive controls Use Radix or Base UI primitives for semantic HTML and accessibility
Modifying components in node_modules Components live in your source tree -- own and customize directly
Using old CLI command shadcn-ui@canary Use npx shadcn@latest for all CLI operations

Delegation

  • Component discovery and primitive lookup: Use Explore agent
  • Theme migration or multi-file refactoring: Use Task agent
  • Design system architecture planning: Use Plan agent
  • Registry setup and distribution: Use Task agent

If the tanstack-form skill is available, delegate advanced form state management (array fields, linked fields, async validation) to it.
If the tailwind skill is available, delegate utility class patterns and design token architecture to it.

References

Installs

Installs 50
Global Rank #601 of 601

Security Audit

ath Safe
socket Safe
Alerts: 0 Score: 90
snyk Medium
zeroleaks Safe
Score: 93
EU EU-Hosted Inference API

Power your AI Agents with the best open-source models.

Drop-in OpenAI-compatible API. No data leaves Europe.

Explore Inference API

GLM

GLM 5

$1.00 / $3.20

per M tokens

Kimi

Kimi K2.5

$0.60 / $2.80

per M tokens

MiniMax

MiniMax M2.5

$0.30 / $1.20

per M tokens

Qwen

Qwen3.5 122B

$0.40 / $3.00

per M tokens

How to use this skill

1

Install shadcn-ui by running npx skills add oakoss/agent-skills --skill shadcn-ui in your project directory. Run the install command above in your project directory. The skill file will be downloaded from GitHub and placed in your project.

2

No configuration needed. Your AI agent (Claude Code, Cursor, Windsurf, etc.) automatically detects installed skills and uses them as context when generating code.

3

The skill enhances your agent's understanding of shadcn-ui, helping it follow established patterns, avoid common mistakes, and produce production-ready output.

What you get

Skills are plain-text instruction files — not executable code. They encode expert knowledge about frameworks, languages, or tools that your AI agent reads to improve its output. This means zero runtime overhead, no dependency conflicts, and full transparency: you can read and review every instruction before installing.

Compatibility

This skill works with any AI coding agent that supports the skills.sh format, including Claude Code (Anthropic), Cursor, Windsurf, Cline, Aider, and other tools that read project-level context files. Skills are framework-agnostic at the transport level — the content inside determines which language or framework it applies to.

Data sourced from the skills.sh registry and GitHub. Install counts and security audits are updated regularly.

EU Made in Europe

Chat with 100+ AI Models in one App.

Use Claude, ChatGPT, Gemini alongside with EU-Hosted Models like Deepseek, GLM-5, Kimi K2.5 and many more.

Customer Support