用途:在 Saleor storefront 项目中创建新 UI 组件、用 Tailwind 设置样式、判断使用 Server 还是 Client Component,以及复用 shadcn/ui 基础组件。
主要能力与约定:组件按类型放置,共享组件在 src/ui/components/,商品页在 src/ui/components/pdp/,商品列表在 src/ui/components/plp/,基础组件在 src/ui/components/ui/,导航在 src/ui/components/nav/,购物车在 src/ui/components/cart/。默认使用 Server Component,无需指令,可用 async/await;仅在需要 useState、useEffect、useContext、事件处理器或浏览器 API 时添加 "use client"。样式使用引用 src/styles/brand.css 中 CSS 变量的语义化 Tailwind 类,如 bg-background、text-foreground、border-border、bg-primary、text-primary-foreground、text-muted-foreground、bg-secondary、border、destructive 等,避免硬编码颜色。基础组件从 @/ui/components/ui/ 导入,如 Button、Badge、Sheet、DropdownMenu;子目录组件通过 index 导出。
限制与反模式:不要硬编码颜色,不要无必要添加 "use client",不要新建基础组件而应复用现有 shadcn/ui 组件,不要使用内联样式而应使用 Tailwind 类。具体安装命令与版本信息暂未提供。