Token导航 LogoToken导航TokenDH.com
前端设计external-servicegithub未标认证来源可访问clear审计提醒

moai-library-shadcnmoai library shadcn/ui 前端

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

196

周安装

8

GitHub Stars

61

下载量

63
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:moai-library-shadcn(moai library shadcn/ui 前端)
来源仓库:https://github.com/modu-ai/cc-plugins
仓库路径:skills/moai-library-shadcn
安装命令:
npx skills add https://github.com/modu-ai/cc-plugins --skill moai-library-shadcn
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/modu-ai/cc-plugins --skill moai-library-shadcn

简介

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。

  • 适合生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码。
  • 使用时需结合项目现有设计系统、路由和构建方式,避免孤立片段。
  • 涉及页面改动时应配合本地预览和构建检查确认视觉效果。
  • moai-library-shadcn 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Quick Reference

Enterprise shadcn/ui Component Library Expert

Comprehensive shadcn/ui expertise with AI-powered design system architecture, Context7 integration, and intelligent component orchestration for modern React applications.

Core Capabilities:

  • AI-Powered Component Architecture using Context7 MCP
  • Intelligent Design System with automated theme customization
  • Advanced Component Orchestration with accessibility and performance
  • Enterprise UI Framework with zero-configuration design tokens
  • Predictive Component Analytics with usage insights

When to Use:

  • shadcn/ui component library discussions
  • React component architecture planning
  • Tailwind CSS integration and design tokens
  • Accessibility implementation
  • Design system customization

Module Organization:

  • Core Concepts: This file covers shadcn/ui overview, architecture, and ecosystem
  • Components: The shadcn-components.md module covers component library and advanced patterns
  • Theming: The shadcn-theming.md module covers theme system and customization
  • Advanced Patterns: The advanced-patterns.md module covers complex implementations
  • Optimization: The optimization.md module covers performance tuning

Implementation Guide

shadcn/ui Overview

shadcn/ui is a collection of re-usable components built with Radix UI and Tailwind CSS. Unlike traditional component libraries, it is not an npm package but rather a collection of components you copy into your project.

Key Benefits include full control and ownership of components, zero dependencies beyond Radix UI primitives, complete customization with Tailwind CSS, TypeScript-first design with excellent type safety, and built-in accessibility with WCAG 2.1 AA compliance.

Architecture Philosophy: shadcn/ui components are built on top of Radix UI Primitives which provide unstyled accessible primitives. Tailwind CSS provides utility-first styling. TypeScript ensures type safety throughout. Your customization layer provides full control over the final implementation.

Core Component Categories

Form Components include Input, Select, Checkbox, Radio, and Textarea. Form validation integrates with react-hook-form and Zod. Accessibility is ensured through proper ARIA labels.

Display Components include Card, Dialog, Sheet, Drawer, and Popover. Responsive design patterns are built in. Dark mode support is included.

Navigation Components include Navigation Menu, Breadcrumb, Tabs, and Pagination. Keyboard navigation support is built in. Focus management is handled automatically.

Data Components include Table, Calendar, DatePicker, and Charts. Virtual scrolling is available for large datasets. TanStack Table integration is supported.

Feedback Components include Alert, Toast, Progress, Badge, and Avatar. Loading states and skeletons are available. Error boundaries are supported.

Installation and Setup

Step 1: Initialize shadcn/ui by running the shadcn-ui init command with npx using the latest version.

Step 2: Configure components.json with the schema URL pointing to ui.shadcn.com/schema.json. Set the style to default and enable RSC and TSX. Configure Tailwind settings including the config path, CSS path, base color, CSS variables enabled, and optional prefix. Set up aliases for components, utils, and ui paths.

Step 3: Add components individually using the shadcn-ui add command with npx, specifying component names such as button, form, or dialog.

Foundation Technologies

React 19 features include Server Components support, concurrent rendering features, automatic batching improvements, and streaming SSR enhancements.

TypeScript 5.5 provides full type safety across components, improved inference for generics, better error messages, and enhanced developer experience.

Tailwind CSS 3.4 includes JIT compilation, CSS variable support, dark mode variants, and container queries.

Radix UI provides unstyled accessible primitives, keyboard navigation, focus management, and ARIA attributes.

Integration Stack includes React Hook Form for form state management, Zod for schema validation, class-variance-authority for variant management, Framer Motion for animation library, and Lucide React for icon library.

AI-Powered Architecture Design

The ShadcnUIArchitectOptimizer class uses Context7 MCP integration to design optimal shadcn/ui architectures. It initializes a Context7 client, component analyzer, and theme optimizer. The design_optimal_shadcn_architecture method takes design system requirements and fetches latest shadcn/ui and React documentation via Context7. It then optimizes component selection based on UI components and user needs, optimizes theme configuration based on brand guidelines and accessibility requirements, and returns a complete ShadcnUIArchitecture including component library, theme system, accessibility compliance, performance optimization, integration patterns, and customization strategy.

Best Practices

Requirements include using CSS variables for theme customization, implementing proper TypeScript types, following accessibility guidelines for WCAG 2.1 AA compliance, using Radix UI primitives for complex interactions, testing components with React Testing Library, optimizing bundle size with tree-shaking, and implementing responsive design patterns.

Critical Implementation Standards:

[HARD] Use CSS variables exclusively for color values. This enables dynamic theming, supports dark mode transitions, and maintains design system consistency across all components. Without CSS variables, theme changes require code modifications, dark mode fails, and brand customization becomes unmaintainable.

[HARD] Include accessibility attributes on all interactive elements. This ensures WCAG 2.1 AA compliance, screen reader compatibility, and inclusive user experience for users with disabilities. Missing accessibility attributes excludes users with disabilities, violates legal compliance requirements, and reduces application usability.

[HARD] Implement keyboard navigation for all interactive components. This provides essential navigation method for keyboard users, supports assistive technologies, and improves overall user experience efficiency. Without keyboard navigation, power users cannot efficiently use the application and accessibility compliance fails.

[SOFT] Provide loading states for asynchronous operations. This communicates operation progress to users, reduces perceived latency, and improves user confidence in application responsiveness.

[HARD] Implement error boundaries around component trees. This prevents entire application crashes from isolated component failures, enables graceful error recovery, and maintains application stability.

[HARD] Apply Tailwind CSS classes instead of inline styles. This maintains consistency with design system, enables JIT compilation benefits, supports responsive design variants, and improves bundle size optimization.

[SOFT] Implement dark mode support across all components. This provides user preference respect, reduces eye strain in low-light environments, and aligns with modern UI expectations.

Performance Optimization

Bundle Size optimization includes tree-shaking to remove unused components, code splitting for large components, lazy loading with React.lazy, and dynamic imports for heavy dependencies.

Runtime Performance optimization includes React.memo for expensive components, useMemo and useCallback for computations, virtual scrolling for large lists, and debouncing user interactions.

Accessibility includes ARIA attributes for all interactive elements, keyboard navigation support, focus management, and screen reader testing.


Advanced Patterns

Component Composition

The composable pattern involves importing Card, CardHeader, CardTitle, and CardContent from the ui/card components. A DashboardCard component accepts a title and children props, wrapping them in the Card structure with CardHeader containing CardTitle and CardContent containing the children.

Form Validation

The Zod and React Hook Form integration pattern involves importing useForm from react-hook-form, zodResolver from hookform/resolvers/zod, and z from zod. Define a formSchema with z.object containing field validations such as z.string().email() for email and z.string().min(8) for password. Infer the FormValues type from the schema. The form component uses useForm with zodResolver passing the formSchema. The form element uses form.handleSubmit with an onSubmit handler.


Works Well With

  • shadcn-components.md module for advanced component patterns and implementation
  • shadcn-theming.md module for theme system and customization strategies
  • moai-domain-uiux for design system architecture and principles
  • moai-lang-typescript for TypeScript best practices
  • code-frontend for frontend development patterns

Context7 Integration

Related Libraries:

  • shadcn/ui at /shadcn-ui/ui provides re-usable components built with Radix UI and Tailwind
  • Radix UI at /radix-ui/primitives provides unstyled accessible component primitives
  • Tailwind CSS at /tailwindlabs/tailwindcss provides utility-first CSS framework

Official Documentation:

  • shadcn/ui Documentation at ui.shadcn.com/docs
  • API Reference at ui.shadcn.com/docs/components
  • Radix UI Documentation at radix-ui.com
  • Tailwind CSS Documentation at tailwindcss.com

Latest Versions as of November 2025:

  • React 19
  • TypeScript 5.5
  • Tailwind CSS 3.4
  • Radix UI Latest

Last Updated: 2026-01-11 Status: Production Ready

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

27.59%
按下载量换算17

windsurf

23.92%
按下载量换算15

trae

17.98%
按下载量换算11

OpenCode

11.83%
按下载量换算7

weavefox

7.23%
按下载量换算5

Codex

3.89%
按下载量换算2

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills