Agent Skillssimstudioai/sim › emcn-design-review

emcn-design-review

GitHub

审查UI代码是否符合emcn设计系统规范,包括组件引用、CSS变量令牌及按钮变体等约定,支持自动修复或仅提出建议。

.agents/skills/emcn-design-review/SKILL.md simstudioai/sim

Trigger Scenarios

需要检查UI代码与设计系统一致性时 审查PR中的前端样式和组件用法时

Install

npx skills add simstudioai/sim --skill emcn-design-review -g -y
More Options

Non-standard path

npx skills add https://github.com/simstudioai/sim/tree/main/.agents/skills/emcn-design-review -g -y

Use without installing

npx skills use simstudioai/sim@emcn-design-review

指定 Agent (Claude Code)

npx skills add simstudioai/sim --skill emcn-design-review -a claude-code -g -y

安装 repo 全部 skill

npx skills add simstudioai/sim --all -g -y

预览 repo 内 skill

npx skills add simstudioai/sim --list

SKILL.md

Frontmatter
{
    "name": "emcn-design-review",
    "description": "Review UI code for alignment with the emcn design system — components, tokens, patterns, and conventions",
    "argument-hint": "[scope] [fix=true|false]"
}

EMCN Design Review

Arguments:

  • scope: what to review (default: your current changes). Examples: "diff to main", "PR #123", "src/components/", "whole codebase"
  • fix: whether to apply fixes (default: true). Set to false to only propose changes.

User arguments: $ARGUMENTS

Context

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.

Steps

  1. Read the emcn public barrel at 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.ts
  2. Read apps/sim/app/_styles/globals.css for CSS variable tokens
  3. Analyze the specified scope against every rule below
  4. If fix=true, apply the fixes. If fix=false, propose the fixes without applying.

Imports

  • Import from @/components/emcn barrel, never subpaths
  • Icons from @sim/emcn/icons
  • Use cn from @/lib/core/utils/cn for conditional classes

Design Tokens

Use 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 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)

Buttons

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

Delete/Remove Confirmations

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

toast.success(), toast.error(), toast() from @/components/emcn. Never custom notification UI.

Badges

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.

Icons

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.

Anti-patterns to flag

  • Raw <button>/<input>, or legacy Input/Textarea/Modal, instead of the canonical chip components (ChipInput/ChipTextarea/ChipModal)
  • Hand-rolled field rows inside a ChipModalBody instead of ChipModalField
  • Hardcoded colors (text-gray-*, #hex, rgb())
  • Tailwind semantics (text-muted-foreground) instead of CSS variables
  • Template literal className instead of cn()
  • Inline styles for colors/static values (dynamic values OK)
  • Importing from emcn subpaths instead of barrel
  • Arbitrary z-index instead of tokens
  • Wrong button variant for action type

Version History

  • ceda457 Current 2026-08-20 15:29

Same Skill Collection

.agents/skills/add-block-preview/SKILL.md
.agents/skills/add-block/SKILL.md
.agents/skills/add-column-type/SKILL.md
.agents/skills/add-connector/SKILL.md
.agents/skills/add-enrichment/SKILL.md
.agents/skills/add-feature-flag/SKILL.md
.agents/skills/add-hosted-key/SKILL.md
.agents/skills/add-integration/SKILL.md
.agents/skills/add-managed-cli/SKILL.md
.agents/skills/add-model/SKILL.md
.agents/skills/add-tools/SKILL.md
.agents/skills/add-trigger/SKILL.md
.agents/skills/babysit/SKILL.md
.agents/skills/cleanup/SKILL.md
.agents/skills/council/SKILL.md
.agents/skills/db-migrate/SKILL.md
.agents/skills/design-taste-frontend/SKILL.md
.agents/skills/emil-design-eng/SKILL.md
.agents/skills/make-interfaces-feel-better/SKILL.md
.agents/skills/memory-load-check/SKILL.md
.agents/skills/react-query-best-practices/SKILL.md
.agents/skills/ship/SKILL.md
.agents/skills/tool-registry-boundary/SKILL.md
.agents/skills/v2-api-conventions/SKILL.md
.agents/skills/validate-connector/SKILL.md
.agents/skills/validate-integration/SKILL.md
.agents/skills/validate-model/SKILL.md
.agents/skills/validate-trigger/SKILL.md
.agents/skills/you-might-not-need-a-callback/SKILL.md
.agents/skills/you-might-not-need-a-comment/SKILL.md
.agents/skills/you-might-not-need-a-memo/SKILL.md
.agents/skills/you-might-not-need-an-effect/SKILL.md
.agents/skills/you-might-not-need-state/SKILL.md
.agents/skills/you-might-not-need-url-state/SKILL.md
.claude/skills/add-settings-page/SKILL.md
helm/sim/.claude/skills/sim-helm/SKILL.md
.agents/skills/migrate-application-operation/SKILL.md

Metadata

Files
0
Version
ceda457
Hash
53a71408
Indexed
2026-08-20 15:29

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-24 18:52
浙ICP备14020137号-1 $방문자$