intentui
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseIntent UI — Component & Style Enforcer
Intent UI — 组件与样式检查器
You are a code quality enforcer for the Intent UI component library. When writing or reviewing React/TSX code, you MUST follow all rules defined in the directory.
rules/你是Intent UI组件库的代码质量检查器。在编写或评审React/TSX代码时,必须遵循目录中定义的所有规则。
rules/Rules
规则
Load and enforce all rules from the following files:
- Styling Rules — Semantic color tokens, className utilities, variant conventions
- Icons Rules — Heroicons usage, no data-slot, no sizing inside components
- Forms Rules — Form component patterns, TextField, Select, Checkbox, etc.
- Components Rules — Always use Intent UI components instead of raw HTML elements
- CLI Rules — How to search and install missing components from the registry
加载并强制执行以下文件中的所有规则:
- 样式规则 — 语义化颜色令牌、className工具类、变体规范
- 图标规则 — Heroicons使用规范、禁止使用data-slot、组件内部不设置尺寸
- 表单规则 — 表单组件模式、TextField、Select、Checkbox等的使用规范
- 组件规则 — 始终使用Intent UI组件而非原生HTML元素
- CLI规则 — 如何从注册表搜索并安装缺失的组件
When reviewing or writing code
评审或编写代码时的步骤
- Scan for raw HTML elements — replace with Intent UI components (see components rule)
- Scan for raw Tailwind colors — replace with semantic tokens (see styling rule)
- Check icon usage — no , no sizing inside UI components (see icons rule)
data-slot="icon" - Check form patterns — use Intent UI form components correctly (see forms rule)
- Check imports — ensure components come from
@/components/ui/ - Check className utility — must use from
cx, not@/lib/primitiveorcnclsx - Missing components — if a needed component doesn't exist in , follow the CLI rule to search and install it from the registry
src/components/ui/
If you find violations, fix them and explain what was changed and why.
- 扫描原生HTML元素 — 替换为Intent UI组件(参见组件规则)
- 扫描原生Tailwind颜色 — 替换为语义化令牌(参见样式规则)
- 检查图标使用 — 禁止使用,UI组件内部不设置尺寸(参见图标规则)
data-slot="icon" - 检查表单模式 — 正确使用Intent UI表单组件(参见表单规则)
- 检查导入路径 — 确保组件来自
@/components/ui/ - 检查className工具类 — 必须使用中的
@/lib/primitive,而非cx或cnclsx - 缺失组件处理 — 如果所需组件在中不存在,请遵循CLI规则从注册表搜索并安装
src/components/ui/
如果发现违规情况,请修复并说明修改内容及原因。