用途:该技能是 Mastra Playground UI 的 Tailwind 样式路由与优先级指南,包含 3 个类别共 5 条规则,用于在编写、审查或重构样式代码时保持设计系统一致、防止 token 漂移并维护组件库完整性。作用范围为 packages/playground-ui 与 packages/playground。
适用时机:编写带 Tailwind 样式的新 React 组件、审查样式一致性、重构已有样式组件、添加或修改 UI 元素时参考。
规则按影响优先级排序(Priority / Category / Impact):1 组件使用,CRITICAL;2 设计令牌,CRITICAL;3 ClassName 使用,HIGH。
关键模式:组件使用方面,使用 @playground-ui/ds/components/ 中的现有组件(component-use-existing),不要在 ds/ 文件夹中创建新组件。设计令牌方面,只使用 @playground-ui 中 tailwind.config.ts 里的 token(tokens-use-existing),不要修改设计令牌或 tailwind.config.ts(tokens-no-modification)。ClassName 方面,除高度和宽度外不得使用任意 Tailwind 值(classname-no-arbitrary);除 DialogContent 和 Popover 上的 h-/w- 外,DS 组件不得使用 className 属性(classname-no-ds-override)。
规则文件是详细说明与示例的权威来源:references/tailwind-best-practices-reference.md 为规则目录,含类别顺序与规则文件路径;references/rules/ 为按类别组织的单条规则文件。实现或审查具体规则时只加载相关文件,避免加载全部示例。可用 grep 查找模式:grep -l "component" references/rules/、grep -l "token" references/rules/、grep -l "className" references/rules/。规则类别:component-(1 条)、tokens-(2 条)、classname-*(2 条)。
限制:资料未提供具体规则正文、tailwind.config.ts 的 token 清单、安装方式与收费信息。