用途:在 Next.js(App Router)· shadcn/ui · Tailwind v4(CSS-first)· TypeScript 项目中,统一约束所有 UI 改动,使其符合项目真实设计令牌,主题为 blue-primary(--primary = blue-600)。以 references/DESIGN.md 作为令牌、颜色、间距的唯一事实来源;该文件较大,先读 §A,需要具体数值时再读取 §B–§P。
主要能力:提供完整令牌参考(§A 明暗主题、§B–§C 颜色原语、§D 圆角、§E 字体、§F–§L 间距与尺寸、§M–§N 边框、§O 透明度、§P 原始值)、Figma 令牌源文件、可直接使用的 globals.css、components.json、lib/utils.ts 的 cn() 助手及令牌生成脚本。
使用方式:新项目先执行 npx create-next-app@latest . 与 npx shadcn@latest init(baseColor 选 Neutral,CSS 变量启用),再复制技能内 assets/globals.css、components.json、lib/utils.ts 覆盖默认;安装 tailwindcss @tailwindcss/postcss tw-animate-css clsx tailwind-merge 及 next-themes。暗色模式在 app/layout.tsx 用 ThemeProvider(attribute="class",defaultTheme="system")并加 suppressHydrationWarning。添加组件用 npx shadcn@latest add <name>。
限制:仅使用语义化令牌(如 bg-background、text-muted-foreground、bg-primary text-primary-foreground),禁止硬编码颜色类或十六进制值;不手写基础组件;不派生 components/ui/;令牌由脚本生成,不得手改 DESIGN.md 或 globals.css 颜色;需保留原语的可访问性特性(focus-visible、aria-、Label htmlFor)。