Review UI code for alignment with the emcn design system — components, tokens, patterns, and conventions
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-emcn-design-review-9b6eb7f162da ,按照其中的说明把「emcn-design-review」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Arguments:
User arguments: $ARGUMENTS
This codebase uses emcn, a custom component library built on Radix UI primitives with CVA variants and CSS variable design tokens. All UI must use emcn components and tokens.
packages/emcn/src/index.ts (re-exports components, Calendar, Table*, and icons) to know what's available; for the full icon set read packages/emcn/src/icons/index.tsapps/sim/app/_styles/globals.css for CSS variable tokenscn, and tokens from the @sim/emcn barrel, never component subpaths@sim/emcn/iconsUse CSS variable pattern (text-[var(--text-primary)]), never Tailwind semantics (text-muted-foreground) or hardcoded colors (text-gray-500, #333).
Text: --text-primary, --text-secondary, --text-tertiary, --text-muted, --text-body (canonical value text), --text-icon, --text-placeholder, --text-subtle, --text-inverse, --text-error
Surfaces: --bg, --surface-1 through --surface-7, --surface-hover, --surface-active
Borders: --border (--border-1/--border-muted are legacy aliases resolving to it — flag new uses)
Brand/accent: --brand-secondary, --brand-accent
Z-Index: --z-dropdown (100), --z-toast (150), --z-modal (200), --z-popover (300), --z-tooltip (400), --z-takeover (500), --z-shell-gate (600)
Shadows: shadow-subtle, shadow-medium, shadow-overlay, shadow-card
Badges: --badge-* semantic families (success/error/gray/blue/purple/orange/amber/teal/cyan/pink, each with -bg/-text)
Intent-to-variant mapping (read the actual buttonVariants in packages/emcn/src/components/button/button.tsx for the full variant set — it exposes more than listed here):
| Action | Variant |
|---|---|
| Toolbar, icon-only | ghost |
| Create, save, submit | primary |
| Cancel, close | default |
| Delete, remove | destructive |
| Selected state | active |
| Toggle | outline |
ChipModal size='sm', title "Delete/Remove {ItemType}", destructive confirm button, plain Cancel (follow the chip footer layout in .claude/rules/emcn-components.md). Use text-[var(--text-error)] for irreversible warnings.
toast.success(), toast.error(), toast() from @sim/emcn. Never custom notification UI.
red=error/failed, gray-secondary=metadata/roles, type=type annotations, green=success/active, gray=neutral, amber=processing, orange=paused, blue=info. Use dot prop for status indicators.
Default: size-[14px]. Color: text-[var(--text-icon)]. Scale: 14px > 16px > 12px > 20px. Use the size-* shorthand — flag h-[Npx] w-[Npx] and h-N w-N pairs as refactor targets.
<button>/<input>, or legacy Input/Textarea/Modal, instead of the canonical chip components (ChipInput/ChipTextarea/ChipModal)ChipModalBody instead of ChipModalFieldtext-gray-*, #hex, rgb())text-muted-foreground) instead of CSS variablescn()