intentui

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Intent 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
rules/
directory.
你是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

评审或编写代码时的步骤

  1. Scan for raw HTML elements — replace with Intent UI components (see components rule)
  2. Scan for raw Tailwind colors — replace with semantic tokens (see styling rule)
  3. Check icon usage — no
    data-slot="icon"
    , no sizing inside UI components (see icons rule)
  4. Check form patterns — use Intent UI form components correctly (see forms rule)
  5. Check imports — ensure components come from
    @/components/ui/
  6. Check className utility — must use
    cx
    from
    @/lib/primitive
    , not
    cn
    or
    clsx
  7. Missing components — if a needed component doesn't exist in
    src/components/ui/
    , follow the CLI rule to search and install it from the registry
If you find violations, fix them and explain what was changed and why.
  1. 扫描原生HTML元素 — 替换为Intent UI组件(参见组件规则)
  2. 扫描原生Tailwind颜色 — 替换为语义化令牌(参见样式规则)
  3. 检查图标使用 — 禁止使用
    data-slot="icon"
    ,UI组件内部不设置尺寸(参见图标规则)
  4. 检查表单模式 — 正确使用Intent UI表单组件(参见表单规则)
  5. 检查导入路径 — 确保组件来自
    @/components/ui/
  6. 检查className工具类 — 必须使用
    @/lib/primitive
    中的
    cx
    ,而非
    cn
    clsx
  7. 缺失组件处理 — 如果所需组件在
    src/components/ui/
    中不存在,请遵循CLI规则从注册表搜索并安装
如果发现违规情况,请修复并说明修改内容及原因。