ui-skills

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

UI Skills

UI 技能

When invoked, apply these opinionated constraints for building better interfaces.
调用时,请应用这些约束性规范来构建更优质的界面。

MANDATORY: Kimi Delegation for UI Implementation

强制要求:UI实现的Kimi代理机制

All UI implementation work MUST be delegated to Kimi K2.5 via MCP.
Kimi excels at frontend development. Claude reviews, Kimi builds:
javascript
// Delegate UI implementation to Kimi
mcp__kimi__spawn_agent({
  prompt: `Implement [component/feature].
Apply ui-skills constraints:
- Tailwind CSS defaults, cn() utility
- Accessible primitives (Base UI/Radix/React Aria)
- No h-screen (use h-dvh), respect safe-area-inset
- Animator only transform/opacity, max 200ms feedback
- text-balance for headings, tabular-nums for data
Existing patterns: [reference files]
Output: ${targetPath}`,
  thinking: true
})
Workflow:
  1. Define constraints → Claude (this skill)
  2. Implement UI → Kimi (Agent Swarm)
  3. Review quality → Claude (expert panel review)
Anti-pattern: Implementing UI yourself instead of delegating to Kimi.
所有UI实现工作必须通过MCP委托给Kimi K2.5完成。
Kimi擅长前端开发,Claude负责评审,Kimi负责实现:
javascript
// Delegate UI implementation to Kimi
mcp__kimi__spawn_agent({
  prompt: `Implement [component/feature].
Apply ui-skills constraints:
- Tailwind CSS defaults, cn() utility
- Accessible primitives (Base UI/Radix/React Aria)
- No h-screen (use h-dvh), respect safe-area-inset
- Animator only transform/opacity, max 200ms feedback
- text-balance for headings, tabular-nums for data
Existing patterns: [reference files]
Output: ${targetPath}`,
  thinking: true
})
工作流程:
  1. 定义约束 → Claude(本技能)
  2. 实现UI → Kimi(Agent集群)
  3. 质量评审 → Claude(专家小组评审)
反模式: 自行实现UI而非委托给Kimi。

How to use

使用方法

  • /ui-skills
    Apply these constraints to any UI work in this conversation.
  • /ui-skills <file>
    Review the file against all constraints below and output:
    • violations (quote the exact line/snippet)
    • why it matters (1 short sentence)
    • a concrete fix (code-level suggestion)
  • /ui-skills
    将这些约束应用于本次对话中的所有UI工作。
  • /ui-skills <文件>
    根据以下所有约束评审文件并输出:
    • 违规内容(引用确切代码行/片段)
    • 违规影响(一句话说明)
    • 具体修复方案(代码级建议)

Stack

技术栈

  • MUST use Tailwind CSS defaults unless custom values already exist or are explicitly requested
  • MUST use
    motion/react
    (formerly
    framer-motion
    ) when JavaScript animation is required
  • SHOULD use
    tw-animate-css
    for entrance and micro-animations in Tailwind CSS
  • MUST use
    cn
    utility (
    clsx
    +
    tailwind-merge
    ) for class logic
  • 除非已有自定义值或被明确要求,否则必须使用Tailwind CSS默认配置
  • 当需要JavaScript动画时,必须使用
    motion/react
    (原
    framer-motion
  • 在Tailwind CSS中,入场动画和微动画应使用
    tw-animate-css
  • 类逻辑必须使用
    cn
    工具(
    clsx
    +
    tailwind-merge

Components

组件

  • MUST use accessible component primitives for anything with keyboard or focus behavior (
    Base UI
    ,
    React Aria
    ,
    Radix
    )
  • MUST use the project’s existing component primitives first
  • NEVER mix primitive systems within the same interaction surface
  • SHOULD prefer
    Base UI
    for new primitives if compatible with the stack
  • MUST add an
    aria-label
    to icon-only buttons
  • NEVER rebuild keyboard or focus behavior by hand unless explicitly requested
  • 任何涉及键盘或焦点交互的元素,必须使用可访问的组件基础库(
    Base UI
    React Aria
    Radix
  • 必须优先使用项目中已有的组件基础库
  • 同一交互界面内不得混合使用不同的组件基础库
  • 如果与技术栈兼容,新组件基础库应优先选择
    Base UI
  • 纯图标按钮必须添加
    aria-label
    属性
  • 除非被明确要求,否则不得手动重写键盘或焦点交互逻辑

Interaction

交互设计

  • MUST use an
    AlertDialog
    for destructive or irreversible actions
  • SHOULD use structural skeletons for loading states
  • NEVER use
    h-screen
    , use
    h-dvh
  • MUST respect
    safe-area-inset
    for fixed elements
  • MUST show errors next to where the action happens
  • NEVER block paste in
    input
    or
    textarea
    elements
  • 破坏性或不可逆操作必须使用
    AlertDialog
    组件
  • 加载状态应使用结构化骨架屏
  • 禁止使用
    h-screen
    ,应使用
    h-dvh
  • 固定定位元素必须遵循
    safe-area-inset
    规范
  • 错误提示必须显示在操作发生的位置附近
  • 禁止阻止
    input
    textarea
    元素的粘贴功能

Animation

动画设计

  • NEVER add animation unless it is explicitly requested
  • MUST animate only compositor props (
    transform
    ,
    opacity
    )
  • NEVER animate layout properties (
    width
    ,
    height
    ,
    top
    ,
    left
    ,
    margin
    ,
    padding
    )
  • SHOULD avoid animating paint properties (
    background
    ,
    color
    ) except for small, local UI (text, icons)
  • SHOULD use
    ease-out
    on entrance
  • NEVER exceed
    200ms
    for interaction feedback
  • MUST pause looping animations when off-screen
  • SHOULD respect
    prefers-reduced-motion
  • NEVER introduce custom easing curves unless explicitly requested
  • SHOULD avoid animating large images or full-screen surfaces
  • 除非被明确要求,否则不得添加动画
  • 仅允许对合成器属性(
    transform
    opacity
    )添加动画
  • 禁止对布局属性(
    width
    height
    top
    left
    margin
    padding
    )添加动画
  • 除小型局部UI(文本、图标)外,应避免对绘制属性(
    background
    color
    )添加动画
  • 入场动画应使用
    ease-out
    缓动函数
  • 交互反馈动画时长不得超过
    200ms
  • 循环动画在元素离开屏幕时必须暂停
  • 应遵循
    prefers-reduced-motion
    系统设置
  • 除非被明确要求,否则不得使用自定义缓动曲线
  • 应避免对大型图片或全屏元素添加动画

Typography

排版设计

  • MUST use
    text-balance
    for headings and
    text-pretty
    for body/paragraphs
  • MUST use
    tabular-nums
    for data
  • SHOULD use
    truncate
    or
    line-clamp
    for dense UI
  • NEVER modify
    letter-spacing
    (
    tracking-*
    ) unless explicitly requested
  • 标题必须使用
    text-balance
    ,正文/段落必须使用
    text-pretty
  • 数据内容必须使用
    tabular-nums
  • 密集型UI应使用
    truncate
    line-clamp
    处理文本溢出
  • 除非被明确要求,否则不得修改
    letter-spacing
    tracking-*

Layout

布局设计

  • MUST use a fixed
    z-index
    scale (no arbitrary
    z-*
    )
  • SHOULD use
    size-*
    for square elements instead of
    w-*
    +
    h-*
  • 必须使用固定的
    z-index
    层级规范(不得使用任意
    z-*
    值)
  • 方形元素应使用
    size-*
    替代
    w-*
    +
    h-*

Performance

性能优化

  • NEVER animate large
    blur()
    or
    backdrop-filter
    surfaces
  • NEVER apply
    will-change
    outside an active animation
  • NEVER use
    useEffect
    for anything that can be expressed as render logic
  • 禁止对大型区域的
    blur()
    backdrop-filter
    添加动画
  • 仅在动画活跃时才能使用
    will-change
    属性
  • 任何可通过渲染逻辑实现的功能,不得使用
    useEffect

Design

设计规范

  • NEVER use gradients unless explicitly requested
  • NEVER use purple or multicolor gradients
  • NEVER use glow effects as primary affordances
  • SHOULD use Tailwind CSS default shadow scale unless explicitly requested
  • MUST give empty states one clear next action
  • SHOULD limit accent color usage to one per view
  • SHOULD use existing theme or Tailwind CSS color tokens before introducing new ones
  • 除非被明确要求,否则不得使用渐变效果
  • 禁止使用紫色或多色渐变
  • 禁止将发光效果作为主要交互提示
  • 除非被明确要求,否则应使用Tailwind CSS默认阴影层级
  • 空状态必须提供明确的下一步操作指引
  • 每个视图中强调色的使用应限制为一种
  • 引入新颜色前,应优先使用现有主题或Tailwind CSS颜色变量

Expert Panel Review (MANDATORY)

专家小组评审(强制要求)

Before returning ANY design output to the user, it MUST pass expert panel review.
See full details:
references/expert-panel-review.md
向用户交付任何设计输出前,必须通过专家小组评审。
详细说明请见:
references/expert-panel-review.md

Quick Reference

快速参考

  1. Simulate 10 world-class advertorial experts:
    • Ogilvy (advertising), Rams (industrial design), Scher (typography)
    • Wiebe (conversion copy), Laja (CRO), Walter (UX)
    • Cialdini (persuasion), Ive (product design), Wroblewski (mobile)
    • Millman (brand strategy)
  2. Each expert scores 0-100 with specific improvement feedback
  3. Threshold: 90+ average required
  4. If below 90: implement feedback, iterate, re-review
  5. Only return design to user when 90+ achieved
  1. 模拟10位世界级广告与设计专家:
    • Ogilvy(广告)、Rams(工业设计)、Scher(排版设计)
    • Wiebe(转化文案)、Laja(转化率优化)、Walter(用户体验)
    • Cialdini(说服心理学)、Ive(产品设计)、Wroblewski(移动设计)
    • Millman(品牌策略)
  2. 每位专家给出0-100分的评分,并提供具体的改进意见
  3. 评分阈值:平均得分需达到90分以上
  4. 若低于90分:落实改进意见、迭代优化、重新评审
  5. 仅当平均得分达到90分以上时,方可向用户交付设计

Example Output

输出示例

markdown
Expert Panel Review: Hero Section

| Expert | Score | Critical Improvement |
|--------|-------|---------------------|
| Ogilvy | 88 | Lead with benefit, not feature |
| Rams | 94 | Clean, focused |
| Scher | 86 | H2 needs more weight contrast |
| Wiebe | 81 | "Get Started" → "Start Free Trial" |
| Laja | 77 | No social proof above fold |
| Walter | 90 | Good emotional resonance |
| Cialdini | 83 | Add urgency element |
| Ive | 92 | Refined execution |
| Wroblewski | 88 | Touch targets good |
| Millman | 85 | Voice slightly inconsistent |

**Average: 86.4** ❌ Below threshold

Implementing: Laja (social proof), Wiebe (CTA), Cialdini (urgency)...
markdown
Expert Panel Review: Hero Section

| Expert | Score | Critical Improvement |
|--------|-------|---------------------|
| Ogilvy | 88 | Lead with benefit, not feature |
| Rams | 94 | Clean, focused |
| Scher | 86 | H2 needs more weight contrast |
| Wiebe | 81 | "Get Started" → "Start Free Trial" |
| Laja | 77 | No social proof above fold |
| Walter | 90 | Good emotional resonance |
| Cialdini | 83 | Add urgency element |
| Ive | 92 | Refined execution |
| Wroblewski | 88 | Touch targets good |
| Millman | 85 | Voice slightly inconsistent |

**Average: 86.4** ❌ Below threshold

Implementing: Laja (social proof), Wiebe (CTA), Cialdini (urgency)...

Anti-Patterns

反模式

  • ❌ Skipping review for "quick fixes"
  • ❌ Accepting 85+ as "close enough"
  • ❌ Generic feedback ("make it better")
  • ❌ Returning design without 90+ score
  • ❌ 为“快速修复”跳过评审
  • ❌ 将85分以上视为“足够接近”
  • ❌ 给出泛泛的反馈(如“做得更好”)
  • ❌ 未达到90分以上就交付设计