design-better
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDesign Better
优化设计
A craft layer for any coding agent generating or reviewing UI. Style is owned by ; this skill owns the timeless UX/UI craft heuristics — drawn from Nielsen Norman Group, the Laws of UX, Shneiderman, Refactoring UI, WCAG 2.2, Don Norman, Apple HIG, Material 3, and 2025–2026 AI-product patterns — that separate "shipped" from "designed."
docs/design.mdBoundary. When a heuristic implies a visual property, reference atoken by name (docs/design.md,{colors.primary}). If{rounded.md}doesn't have the token, flag it as a New Pattern to add via the Design System skill — never inline hex, font names, or arbitrary px. Ifdocs/design.mddoesn't exist at all, follow the codebase's existing convention for that property (theme config, CSS custom properties, component library) and note it.docs/design.md
这是为任何生成或审查UI的编码Agent打造的工艺层。样式由负责;此技能则聚焦于永恒的UX/UI工艺启发式规则——这些规则源自Nielsen Norman Group、Laws of UX、Shneiderman、《重构UI》、WCAG 2.2、Don Norman、Apple HIG、Material 3以及2025–2026年AI产品模式——正是这些规则区分了“可用”与“精心设计”的UI。
docs/design.md边界规则:当某条启发式规则涉及视觉属性时,需通过名称引用中的令牌(如docs/design.md、{colors.primary})。若{rounded.md}中无对应令牌,需将其标记为需通过Design System技能添加的「新模式」——切勿直接内联十六进制颜色值、字体名称或任意px值。若docs/design.md完全不存在,则遵循代码库中该属性的现有规范(主题配置、CSS自定义属性、组件库),并予以说明。docs/design.md
Inputs
输入项
- — the style layer (recommended, not required). When present, reference its tokens by name for every visual decision. When absent, this skill still applies: fall back to the codebase's existing design conventions (theme config, CSS custom properties, existing components) as the style source, and recommend running the Design System skill to establish a single token source of truth (part of BuilderOS: https://github.com/BuildGreatProducts/builder-os).
docs/design.md - The thing being built or refactored — a brief, a file, or uncommitted diff.
- — optional. Its strategy and brand inform microcopy tone and help weight which heuristic categories dominate.
docs/product-vision.md
- —— 样式层(推荐但非必需)。若存在,所有视觉决策均需通过名称引用其中的令牌。若不存在,此技能仍可使用:以代码库现有设计规范(主题配置、CSS自定义属性、现有组件)作为样式来源,并推荐运行Design System技能以建立单一的令牌可信来源(属于BuilderOS:https://github.com/BuildGreatProducts/builder-os)。
docs/design.md - 待构建或重构的内容 —— 需求简述、文件或未提交的差异代码。
- —— 可选。其战略和品牌信息可指导微文案的语气,并帮助确定哪些启发式规则类别需重点应用。
docs/product-vision.md
Workflow
工作流程
-
Establish the style source. Ifexists, parse its token catalogue (colors, typography, rounded, spacing, components) and the markdown rules (elevation, shape, Do's and Don'ts). If it doesn't, identify the codebase's existing design conventions — theme config (e.g. Tailwind/
docs/design.md), CSS custom properties, the component library in use — and treat those as the style source, then recommend the Design System skill so future work has a documented source of truth.tokens -
Confirm scope and weight. Restate the surface (signup / dashboard / chat / settings / detail / marketing) and which heuristic categories will dominate — a signup leans on Forms + States + Accessibility + Microcopy; a data dashboard leans on Hierarchy + IA + Cognitive Load; an AI chat leans on the AI-product subset.
-
Generate or review using both layers. The style source (tokens, or the codebase conventions) for every visual decision; the heuristics catalogue and the Laws of UX for every craft decision. Cite heuristics by number and laws by name in reviews ("H22 — disabled instead of erroring after submit"; "Hick's Law — too many options in one step").
docs/design.md -
Pre-flight checklist before delivering:
- Every interactive element has default, hover/focus-visible, active, disabled, and loading (where async) states.
- Every async surface designs and codes all four states: empty, loading, error, success.
- Every form input has a programmatically associated , the correct
<label>/inputmode, antypeattribute, andautocompletevalidation.onBlur - Every motion is 150–400 ms, eases by direction (out entering / in exiting / in-out moving), animates /
transformonly, and honorsopacity.prefers-reduced-motion - Body text contrast ≥ 4.5:1, UI components ≥ 3:1, focus rings ≥ 3:1 at ≥ 2 px.
- Pointer targets ≥ 24×24 CSS px (≥ 44×44 on touch).
- Layout works at 320 CSS px wide with no horizontal scroll.
- The primary action is the single visually dominant element on the view.
- Every visual decision references a token (or a codebase convention when no design system exists). Missing tokens flagged as New Patterns, not invented inline.
docs/design.md
-
Deliver. Note which heuristic categories and Laws of UX dominated and surface any trade-off where a heuristic or law was knowingly skipped.
-
确定样式来源:若存在,解析其令牌目录(颜色、排版、圆角、间距、组件)及Markdown规则(阴影、形状、注意事项)。若不存在,识别代码库现有设计规范——主题配置(如Tailwind/
docs/design.md)、CSS自定义属性、所使用的组件库——并将其作为样式来源,随后推荐使用Design System技能,以便后续工作拥有文档化的可信来源。tokens -
确认范围与权重:明确界面类型(注册页/仪表盘/聊天界面/设置页/详情页/营销页),以及需重点应用的启发式规则类别——注册页侧重表单+状态+无障碍+微文案;数据仪表盘侧重层级+信息架构+认知负荷;AI聊天界面侧重AI产品专属规则子集。
-
结合两层规则生成或审查代码:所有视觉决策遵循样式来源(令牌或代码库规范);所有工艺决策遵循启发式规则目录和UX法则。审查时需标注启发式规则编号和法则名称(例如:“H22 —— 提交后禁用而非报错”;“希克定律——单步骤选项过多”)。
docs/design.md -
交付前的预检查清单:
- 每个交互元素均具备默认、悬浮/聚焦可见、激活、禁用状态,异步元素需额外具备加载状态。
- 每个异步界面均设计并编码四种状态:空状态、加载、错误、成功。
- 每个表单输入框均有程序关联的、正确的
<label>/inputmode、type属性,以及autocomplete验证。onBlur - 所有动效时长为150–400 ms,根据方向设置缓动效果(进入时ease-out / 退出时ease-in / 屏幕内移动时ease-in-out),仅对/
transform设置动画,并尊重opacity。prefers-reduced-motion - 正文文本对比度≥4.5:1,UI组件对比度≥3:1,聚焦环对比度≥3:1且宽度≥2 px。
- 指针目标区域≥24×24 CSS px(触屏端≥44×44)。
- 布局在320 CSS px宽度下可正常显示,无横向滚动。
- 主操作是视图中唯一视觉突出的元素。
- 所有视觉决策均引用中的令牌(无设计系统时则引用代码库规范)。缺失的令牌需标记为新模式,切勿直接自定义值。
docs/design.md
-
交付成果:说明重点应用的启发式规则类别和UX法则,并指出任何明知需跳过某条启发式规则或法则的权衡场景。
The heuristics catalogue (50 items)
启发式规则目录(50项)
Each entry: number (cite in reviews) + short name + one-line rule + code action. Style-neutral throughout — defer every visual property to (or the codebase's design conventions when it's absent).
docs/design.md每条规则包含:编号(审查时引用)+ 简称 + 单行规则 + 代码操作。全程保持样式中立——所有视觉属性均遵循(无设计系统时遵循代码库设计规范)。
docs/design.mdVisual hierarchy & emphasis
视觉层级与强调
H1. One primary action per view (Von Restorff). Make the primary CTA the single visually distinct element — use the most prominent design token color and largest button size. Secondary actions use quieter tokens.
H2. Hierarchy from size + weight + color, not size alone (Refactoring UI). De-emphasize secondary text by reducing weight or shifting to a secondary text color token before reducing font size.
H3. Proximity groups, white space separates (Gestalt). Stack related fields with a small ; separate unrelated groups with a larger spacing token.
gapH4. Common Region bounds groups (Gestalt). When proximity isn't enough, bound with a card, divider, or tinted surface — using the design system's elevation/surface tokens.
H5. White space is a tool — default to too much (Refactoring UI). Generous padding reads as confident. Tightening should be deliberate, not default.
H6. Snap to the spacing scale; nothing one pixel off (Polish). Every margin/padding/gap is a design token. Alignment to the grid is the difference between "designed" and "drafted."
H1. 每个视图仅设一个主操作(冯·雷斯托夫效应)。让主CTA成为唯一视觉突出的元素——使用最显眼的设计令牌颜色和最大的按钮尺寸。次要操作使用更低调的令牌。
H2. 通过尺寸+字重+颜色构建层级,而非仅依赖尺寸(《重构UI》)。先通过降低字重或切换至次要文本颜色令牌来弱化次要文本,再考虑缩小字号。
H3. 相近元素归组,留白分隔(格式塔原则)。相关字段使用小堆叠;不相关组使用较大的间距令牌分隔。
gapH4. 共用边界界定组(格式塔原则)。当仅靠相近性不足时,使用卡片、分隔线或着色区域界定组——使用设计系统的阴影/表面令牌。
H5. 留白是工具——默认留足(《重构UI》)。充足的内边距显得更专业。收紧留白需刻意为之,而非默认操作。
H6. 对齐间距刻度;避免1像素偏差(细节打磨)。所有外边距/内边距/间隙均使用设计令牌。对齐网格是“精心设计”与“草稿”的区别所在。
Layout & alignment
布局与对齐
H7. Semantic HTML before divs + ARIA (WCAG 1.3.1). Use , , , , , , . Reach for only when no native element fits.
<main><nav><header><section><article><button><label>role=H8. Reading line length 50–75ch. Cap prose containers with (or analogous).
max-width: 65chH9. Reflow at 320 CSS px (WCAG 1.4.10). Every view works at 320 px wide with no horizontal scroll.
H10. Text spacing tolerance (WCAG 1.4.12). Layout survives user overrides of line-height (≥ 1.5×), letter-spacing (≥ 0.12em), word-spacing (≥ 0.16em).
H7. 优先使用语义化HTML而非div+ARIA(WCAG 1.3.1)。使用、、、、、、。仅当无原生元素适用时才使用。
<main><nav><header><section><article><button><label>role=H8. 文本行长度为50–75ch。使用(或类似样式)限制正文容器宽度。
max-width: 65chH9. 320 CSS px宽度下可重排(WCAG 1.4.10)。每个视图在320 px宽度下均可正常显示,无横向滚动。
H10. 文本间距容错(WCAG 1.4.12)。布局需能承受用户对行高(≥1.5倍)、字间距(≥0.12em)、词间距(≥0.16em)的自定义设置。
Typography craft
排版工艺
H11. Use only documented type levels. Every / references a typography token.
font-sizefont-weightH12. Tabular figures in data (). Numbers in tables, dashboards, and ledgers align vertically.
font-variant-numeric: tabular-numsH13. Modern text-wrap ( on headlines, on prose). Headlines read more deliberately with ; body paragraphs avoid orphans with .
balanceprettytext-wrap: balancetext-wrap: prettyH11. 仅使用已文档化的层级。所有/均引用排版令牌。
font-sizefont-weightH12. 数据中使用表格数字()。表格、仪表盘和分类账中的数字需垂直对齐。
font-variant-numeric: tabular-numsH13. 现代文本换行(标题用,正文用)。标题使用更易阅读;正文使用避免孤行。
balanceprettytext-wrap: balancetext-wrap: prettyColor & contrast (non-stylistic)
颜色与对比度(非样式化)
H14. Body text contrast ≥ 4.5:1 (WCAG 1.4.3 AA). Verify every body/background token pair. Large text (≥18.66 px bold or ≥24 px) needs ≥ 3:1.
H15. UI component contrast ≥ 3:1 (WCAG 1.4.11). Form borders, icon-only buttons, focus rings, chart strokes all need ≥ 3:1 vs adjacent color.
H16. Color is never the sole signal. Pair every color-encoded state with an icon, label, or pattern.
H14. 正文文本对比度≥4.5:1(WCAG 1.4.3 AA级)。验证所有正文/背景令牌组合。大文本(≥18.66 px粗体或≥24 px)对比度≥3:1即可。
H15. UI组件对比度≥3:1(WCAG 1.4.11)。表单边框、纯图标按钮、聚焦环、图表线条与相邻颜色的对比度均需≥3:1。
H16. 颜色绝非唯一信号。每个颜色编码的状态均需搭配图标、标签或图案。
Interaction & feedback
交互与反馈
H17. Feedback within 100 ms (Doherty / Norman). Every action that triggers logic confirms visually within 100 ms (press state, ripple, optimistic update, skeleton).
H18. Three-state minimum for interactive elements. Default, hover or focus-visible, active, disabled. Loading is a fifth where async.
H19. Affordances signal interactivity. Buttons look pressable; links visibly differ from body text — use design tokens for the visual treatment.
H20. Discoverability over hidden interactions (Norman). Critical actions are visible by default — never hidden behind hover, long-press, or undisclosed gestures.
H21. Easy reversal (Shneiderman). Undo on destructive actions; Cancel on every modal; Back without data loss; soft-delete with restore.
H22. Constraints prevent errors (Norman). Disable invalid options; use , , , , on inputs; gate submit on validity.
minmaxsteppatterntypeH17. 100 ms内给出反馈(Doherty / Norman)。所有触发逻辑的操作均需在100 ms内给出视觉确认(按压状态、波纹效果、乐观更新、骨架屏)。
H18. 交互元素至少具备三种状态。默认、悬浮或聚焦可见、激活、禁用。异步元素需额外具备加载状态。
H19. 可感知性提示交互性。按钮需看起来可按压;链接需与正文文本有明显视觉差异——使用设计令牌进行视觉处理。
H20. 优先可发现性而非隐藏交互(Norman)。关键操作默认可见——切勿隐藏在悬浮、长按或未披露的手势之后。
H21. 轻松撤销(Shneiderman)。破坏性操作支持撤销;每个模态框均有取消按钮;返回操作不丢失数据;软删除支持恢复。
H22. 约束条件防止错误(Norman)。禁用无效选项;对输入框使用、、、、;仅在验证通过后允许提交。
minmaxsteppatterntypeForms
表单
H23. Single-column layout, top-aligned labels. Stack vertically; labels above inputs; never placeholder-as-label.
H24. + for mobile keyboards. , /, , .
inputmodetypetype="email"inputmode="numeric""decimal"type="tel"type="url"H25. attributes. , , , , , etc. Saves users 30 seconds and respects password managers.
autocompleteemailnamenew-passwordone-time-codepostal-codeH26. Inline validation on blur, clear on change. Validate ; clear errors once valid. Validating every keystroke punishes typos.
onBluronChangeH27. Smart defaults absorb complexity (Tesler). Detect timezone, locale, currency; pre-select the safe option; parse natural language ("tomorrow 3 pm"); pre-fill from previous inputs.
H23. 单列布局,标签顶对齐。垂直堆叠;标签位于输入框上方;切勿用占位符替代标签。
H24. + 适配移动端键盘。使用、/、、。
inputmodetypetype="email"inputmode="numeric""decimal"type="tel"type="url"H25. 属性。使用、、、、等。可为用户节省30秒,并兼容密码管理器。
autocompleteemailnamenew-passwordone-time-codepostal-codeH26. 失焦时内联验证,有效时清除错误。在时验证;有效时在清除错误。逐键验证会惩罚输入错误。
onBluronChangeH27. 智能默认值简化复杂度(Tesler定律)。检测时区、区域设置、货币;预选择安全选项;解析自然语言(如“明天下午3点”);从之前的输入框预填充内容。
States: empty, loading, error, success
状态:空、加载、错误、成功
H28. Four states, every data view. Empty, loading, error, success — each designed and coded using design tokens.
H29. Skeleton over spinner for content (NN/g). Use shape-matching placeholders that match final layout dimensions (prevents CLS).
H30. Optimistic UI for low-risk actions. Likes, toggles, follows update immediately; reconcile silently; rollback with a toast on failure.
H31. Empty states are first impressions. Every empty list has a one-line explanation of what should be there + a primary CTA.
H32. Errors say what / why / how to fix. Never just "Something went wrong." Always offer a retry or recovery path.
H28. 每个数据视图均具备四种状态。空状态、加载、错误、成功——均使用设计令牌设计并编码。
H29. 内容使用骨架屏而非加载 spinner(NN/g)。使用与最终布局尺寸匹配的形状占位符(避免CLS)。
H30. 低风险操作使用乐观UI。点赞、切换、关注操作立即更新;静默同步;失败时用提示框回滚。
H31. 空状态是第一印象。每个空列表均需包含一行说明文字(解释应显示内容)+ 主CTA。
H32. 错误提示需说明问题/原因/解决方法。切勿仅显示“出错了”。始终提供重试或恢复路径。
Motion
动效
H33. UI motion in the 150–400 ms band (NN/g, Material 3). Micro 100–150 ms (hover, toggle); standard 200–300 ms (menu, modal); large 300–400 ms (page transition). Repeated UI never animates over 500 ms.
H34. Easing matches direction. Ease-out entering (); ease-in exiting; ease-in-out for moves between two on-screen states.
cubic-bezier(0, 0, 0.2, 1)H35. Animate and only. GPU-accelerated. Never animate ///.
transformopacitywidthheighttopleftH36. Honor . Wrap non-essential motion in . Replace transforms with instant changes or short opacity fades — never remove the feedback signal entirely.
prefers-reduced-motion@media (prefers-reduced-motion: reduce)H33. UI动效时长为150–400 ms(NN/g、Material 3)。微动效100–150 ms(悬浮、切换);标准动效200–300 ms(菜单、模态框);大型动效300–400 ms(页面过渡)。重复的UI动效时长切勿超过500 ms。
H34. 缓动效果匹配方向。进入时ease-out();退出时ease-in;屏幕内移动时ease-in-out。
cubic-bezier(0, 0, 0.2, 1)H35. 仅对和设置动画。利用GPU加速。切勿对///设置动画。
transformopacitywidthheighttopleftH36. 尊重。将非必需动效包裹在中。用即时变化或短时长透明度淡入淡出替代变换——切勿完全移除反馈信号。
prefers-reduced-motion@media (prefers-reduced-motion: reduce)Accessibility (WCAG 2.2 AA)
无障碍(WCAG 2.2 AA级)
H37. Keyboard operability for everything (WCAG 2.1.1). Every interactive element reachable via Tab / Shift+Tab / Enter / Space / Arrow. Focus traps in modals work.
H38. Visible focus rings (WCAG 2.4.7). Never without a equivalent — ≥ 2 px, ≥ 3:1 contrast. Use a design system focus token if defined.
outline: none:focus-visibleH39. Pointer target size ≥ 24×24 (WCAG 2.5.8). Every clickable element ≥ 24×24 CSS px. On touch, aim for 44×44 (Apple HIG) or 48×48 (Material 3).
H40. Programmatically associated labels (WCAG 3.3.2). Every input has a or wraps the input. only when the input is genuinely unlabeled visually.
<label htmlFor=id>aria-labelH41. Focus not obscured (WCAG 2.4.11). Sticky headers/footers must not cover the focused element. Set / equal to sticky heights.
scroll-padding-top-bottomH42. Accessible authentication (WCAG 3.3.8). No cognitive puzzles for login. Allow paste in password fields. Pair OTP with .
autocomplete="one-time-code"H37. 所有元素均可通过键盘操作(WCAG 2.1.1)。每个交互元素均可通过Tab / Shift+Tab / Enter / Space / Arrow键访问。模态框中的焦点陷阱需正常工作。
H38. 可见的聚焦环(WCAG 2.4.7)。切勿在未设置等效样式的情况下使用——聚焦环宽度≥2 px,对比度≥3:1。若设计系统定义了聚焦令牌,则使用该令牌。
:focus-visibleoutline: noneH39. 指针目标尺寸≥24×24(WCAG 2.5.8)。每个可点击元素尺寸≥24×24 CSS px。触屏端目标尺寸建议为44×44(Apple HIG)或48×48(Material 3)。
H40. 程序关联的标签(WCAG 3.3.2)。每个输入框均有或包裹输入框。仅当输入框确实无视觉标签时才使用。
<label htmlFor=id>aria-labelH41. 聚焦元素不被遮挡(WCAG 2.4.11)。粘性页眉/页脚不得覆盖聚焦元素。设置/等于粘性元素的高度。
scroll-padding-top-bottomH42. 无障碍身份验证(WCAG 3.3.8)。登录流程不得包含认知谜题。允许在密码框中粘贴内容。OTP需搭配。
autocomplete="one-time-code"Mobile & touch
移动端与触屏
H43. Thumb-zone primary CTAs. On mobile, primary actions land in the bottom half. Avoid top corners for high-frequency actions.
H44. Respect safe-area insets. Use on fixed/sticky bottom bars and full-bleed headers.
env(safe-area-inset-*)H45. No hover-only critical info. Tooltips shown only on are invisible on touch. Show critical content by default.
:hoverH46. Drag has a tap alternative (WCAG 2.5.7). Every drag-to-sort/delete/resize has a button or menu equivalent.
H43. 主CTA位于拇指操作区。移动端主操作需位于下半部分。高频操作避免放置在顶部角落。
H44. 尊重安全区域内边距。固定/粘性底部栏和全屏页眉需使用。
env(safe-area-inset-*)H45. 关键信息不得仅通过悬浮显示。仅在时显示的提示框在触屏端不可见。关键内容需默认显示。
:hoverH46. 拖拽操作需有点击替代方案(WCAG 2.5.7)。每个拖拽排序/删除/调整尺寸操作均需有按钮或菜单替代方案。
Cognitive load & navigation
认知负荷与导航
H47. Navigation ≤ 5–9 items (Miller). Top-level nav stays inside the magic number; push the rest into a menu, command palette, or settings.
H48. Recognition over Recall (NN/g #6). Surface selected filters, current page (active nav state), breadcrumbs, recent items. Never make the user remember a value from a previous screen.
H47. 导航项≤5–9个(米勒定律)。顶级导航项数量需在“神奇数字”范围内;其余项放入菜单、命令面板或设置中。
H48. 识别优于回忆(NN/g第6条)。显示已选过滤器、当前页面(导航激活状态)、面包屑、最近项。切勿让用户回忆上一屏幕的值。
AI-product specifics (2025–2026)
AI产品专属规则(2025–2026)
H49. Stream + Stop is a primary control. AI responses stream as they generate; a visible Stop button at primary affordance weight while streaming aborts the underlying request, not just the UI. Tool calls / thinking / searching surface as labeled steps.
H50. AI output is an editable draft. Treat model responses as drafts users can edit, accept partially, regenerate, or reject. Cite sources inline with one-click open. Distinguish error categories (network, rate limit, content filter, model error) so each has its own recovery path.
H49. 流式输出+停止是主控制。AI响应生成时实时流式输出;流式输出期间,可见的停止按钮需具备主操作级别的可感知性,可终止底层请求(而非仅停止UI显示)。工具调用/思考/搜索需显示为带标签的步骤。
H50. AI输出为可编辑草稿。将模型响应视为用户可编辑、部分接受、重新生成或拒绝的草稿。内联引用来源,支持一键打开。区分错误类别(网络错误、速率限制、内容过滤、模型错误),以便为每个类别提供专属恢复路径。
The Laws of UX
UX法则
The 50 heuristics above are the actionable checklist; the Laws of UX below are the psychological principles behind them — drawn from lawsofux.com. Apply them where relevant, especially the ones with no direct heuristic. Cite them by name in reviews ("Hick's Law — too many options in one step"). Where a heuristic already operationalizes a law, the cross-reference points to it — treat the two as one rule seen from two angles: the law is the why, the heuristic is the check.
↔ H#上文的50项启发式规则是可操作的检查清单;下文的UX法则是其背后的心理学原理——源自lawsofux.com。相关场景下需应用这些法则,尤其是无直接对应启发式规则的法则。审查时需标注法则名称(例如:“希克定律——单步骤选项过多”)。若某条启发式规则已将某条法则落地,则交叉引用指向该启发式规则——可将两者视为从不同角度呈现的同一规则:法则是“原因”,启发式规则是“检查项”。
↔ H#Perception & grouping — how users visually parse a layout
感知与分组——用户如何视觉解析布局
Law of Proximity. Objects placed near each other are perceived as a group. Stack related fields and controls with a small ; separate unrelated groups with a larger spacing token. ↔ H3
gapLaw of Common Region. Elements inside a shared, clearly bounded area read as one group. When proximity isn't enough, bound related items with a card, divider, or tinted surface using elevation/surface tokens. ↔ H4
Law of Similarity. Elements that share visual characteristics are perceived as related. Give same-function elements the same treatment (all primary actions one button token, all links one style) and make genuinely different things look different. ↔ H16, H19
Law of Uniform Connectedness. Visually connected elements read as more related than merely nearby ones. Connect related controls with a shared container, background, or connecting line (a segmented control, a labelled field group) rather than relying on proximity alone.
Law of Prägnanz. People read ambiguous or complex forms as the simplest interpretation possible. Favor simple, regular shapes and clean layouts; reduce visual complexity so the underlying structure is obvious at a glance.
Aesthetic-Usability Effect. Users perceive aesthetically pleasing design as more usable and forgive minor issues. Invest in visual craft (spacing, type, polish per the heuristics) — but never let surface polish mask a real usability problem that testing surfaces.
接近法则。放置在相近位置的物体被视为一组。相关字段和控件使用小堆叠;不相关组使用较大的间距令牌分隔。↔ H3
gap共同区域法则。位于共享、清晰边界内的元素被视为一组。当仅靠相近性不足时,使用卡片、分隔线或着色区域界定相关项,使用阴影/表面令牌。↔ H4
相似法则。具备相同视觉特征的元素被视为相关。为功能相同的元素赋予相同处理方式(所有主操作使用同一按钮令牌,所有链接使用同一样式),并让功能不同的元素具备明显视觉差异。↔ H16, H19
统一连接法则。视觉上连接的元素比仅靠相近的元素更具相关性。使用共享容器、背景或连接线(分段控件、带标签的字段组)连接相关控件,而非仅依赖相近性。
简洁法则。人们会将模糊或复杂的形式解读为最简单的版本。偏好简单、规则的形状和简洁的布局;降低视觉复杂度,让底层结构一目了然。
美学-可用性效应。用户会将美观的设计视为更易用的设计,并原谅小问题。投入精力打磨视觉工艺(遵循启发式规则处理间距、排版、细节)——但切勿让表面打磨掩盖测试发现的真实可用性问题。
Choice & cognitive load — reduce the effort to decide and act
选择与认知负荷——降低决策和操作的难度
Hick's Law. Decision time grows with the number and complexity of choices. Reduce options per step, use progressive disclosure, pre-select a safe default, and break long flows into steps. ↔ H47
Choice Overload. Too many options overwhelm and stall users. Curate and rank choices, offer a recommended default, and filter or collapse the long tail instead of showing everything at once.
Miller's Law. Working memory holds ~7±2 items. Chunk content and navigation into small groups; keep top-level nav inside the magic number and push the rest into a menu or command palette. ↔ H47
Chunking. Information is easier to process when grouped into meaningful units. Format long strings (phone numbers, card numbers, IDs) and group form fields, nav, and content into digestible sets. ↔ H3
Cognitive Load. Every extra element, label, and step consumes mental resources. Cut extraneous load — offload memory to the interface (show, don't make users recall), remove decorative noise, and keep each screen to one primary job.
Working Memory. Users can't reliably hold values from a previous screen. Carry context forward for them — surface selected filters, prior inputs, and the current step — never require re-entering or remembering across screens. ↔ H48
Selective Attention. Users focus on the subset of the screen tied to their goal and filter out the rest (banner-blindness). Put critical info and actions in the goal path; don't hide them in ad-like regions or easily dismissed chrome.
Occam's Razor. Among equivalent solutions, the one with the fewest elements wins. Remove any element, option, or step that doesn't earn its place; the best interface is the simplest one that still does the job.
Tesler's Law (Conservation of Complexity). Every system has irreducible complexity — the only question is who absorbs it. Push it into the system, not the user: smart defaults, inference, and sensible automation over extra fields and choices. ↔ H27
Cognitive Bias. Users' judgments are shaped by systematic biases (anchoring, framing, defaults). Design around them honestly to help users decide well — never to manipulate. No dark patterns, forced continuity, or misleading framing.
Pareto Principle. Roughly 80% of use comes from 20% of features. Identify the high-frequency paths and make them fast and obvious; don't let rarely-used features crowd the common ones.
希克定律。决策时间随选项数量和复杂度增加而增长。减少单步骤选项数量,使用渐进式披露,预选择安全默认值,将长流程拆分为多个步骤。↔ H47
选择过载。过多选项会让用户不知所措、停滞不前。筛选并排序选项,提供推荐默认值,过滤或折叠长尾选项,而非一次性展示所有内容。
米勒定律。工作记忆可容纳约7±2个项目。将内容和导航划分为小组;顶级导航项数量控制在“神奇数字”范围内,其余项放入菜单或命令面板。↔ H47
分块法则。信息分组为有意义的单元后更易处理。格式化长字符串(电话号码、卡号、ID),将表单字段、导航和内容划分为易于消化的组。↔ H3
认知负荷。每个额外元素、标签和步骤都会消耗心理资源。减少无关负荷——将记忆任务转移到界面(展示而非让用户回忆),移除装饰性噪音,让每个页面仅聚焦一个核心任务。
工作记忆。用户无法可靠记住上一屏幕的值。为用户保留上下文——显示已选过滤器、之前的输入内容和当前步骤——切勿要求跨屏幕重新输入或回忆信息。↔ H48
选择性注意。用户会聚焦于与目标相关的屏幕区域,过滤其余内容(横幅盲视)。将关键信息和操作放在目标路径上;切勿将其隐藏在类似广告的区域或易被忽略的界面元素中。
奥卡姆剃刀原则。在等效解决方案中,元素最少的方案最优。移除任何非必需的元素、选项或步骤;最佳界面是能完成任务的最简单界面。
Tesler定律(复杂度守恒定律)。每个系统都有不可简化的复杂度——区别在于由谁承担。将复杂度转移到系统而非用户身上:使用智能默认值、推断和合理自动化,而非额外字段和选项。↔ H27
认知偏差。用户的判断会受到系统性偏差(锚定效应、框架效应、默认效应)的影响。诚实地围绕这些偏差设计,帮助用户做出明智决策——切勿操纵用户。禁止使用暗黑模式、强制连续性或误导性框架。
帕累托法则。约80%的使用场景来自20%的功能。识别高频路径并使其快速、明显;切勿让低频功能挤占常用功能的空间。
Memory & attention — what users remember and are drawn to
记忆与注意力——用户记住什么和关注什么
Von Restorff Effect (Isolation Effect). Among similar items, the one that differs is remembered. Make the single primary action visually distinct; use emphasis sparingly so it keeps its meaning. ↔ H1
Serial Position Effect. People best remember the first and last items in a series. Place the most important nav items and actions at the start and end of a list, menu, or bar; let the least important sit in the middle.
Zeigarnik Effect. Uncompleted tasks are remembered better and create a pull to finish. Use progress indicators, checklists, and "X of Y complete" cues to nudge completion of onboarding, setup, and multi-step flows.
Goal-Gradient Effect. Motivation increases as a goal gets closer. Show progress and make the remaining steps feel small — progress bars, step counters, and a pre-filled first step so momentum starts above zero.
Peak-End Rule. People judge an experience by its most intense moment and its ending. Invest in the peak (the magic moment) and the end (success, first-win, sign-off states) — the success moment deserves real design, not a bare toast.
冯·雷斯托夫效应(隔离效应)。在相似物品中,与众不同的物品更易被记住。让唯一的主操作具备视觉独特性;谨慎使用强调效果,以保持其意义。↔ H1
系列位置效应。人们最容易记住系列中的第一个和最后一个项目。将最重要的导航项和操作放在列表、菜单或栏目的开头和结尾;最不重要的项放在中间。
蔡格尼克效应。未完成的任务更易被记住,并产生完成的动力。使用进度指示器、检查清单和“已完成X/Y”提示,推动用户完成引导流程、设置和多步骤任务。
目标梯度效应。越接近目标,动力越强。展示进度,让剩余步骤看起来更少——使用进度条、步骤计数器和预填充的第一步,让初始动力大于零。
峰终定律。人们根据体验中最强烈的时刻和结尾来判断整体体验。投入精力打造峰值(神奇时刻)和结尾(成功、首次胜利、签退状态)——成功时刻值得精心设计,而非仅显示简单提示框。
Expectation & behavior — match how users actually behave
预期与行为——匹配用户实际行为
Jakob's Law. Users spend most of their time on other products and expect yours to work the same way. Follow established conventions and platform patterns for common UI (nav, forms, icons, gestures); reserve novelty for where it genuinely pays off. ↔ H20
Mental Model. Users act on what they believe your system is and how it works. Match their expected model — familiar labels, metaphors, and flows — and close the gap between their model and yours instead of forcing them to learn a new one. ↔ H48
Paradox of the Active User. Users skip manuals and start immediately, even when reading would be faster. Make the happy path self-evident, put guidance inline and in context (not in docs), and design so users succeed without instructions.
Postel's Law. Be liberal in what you accept, conservative in what you produce. Accept messy, varied input (trim whitespace, parse date and phone formats, stay case-insensitive) and respond with clear, consistent, well-formed output. ↔ H26, H27
Parkinson's Law. A task expands to fill the time available. Shorten time-to-complete with autofill, smart defaults, and sensible constraints so users finish faster than they otherwise would. ↔ H27
Flow. Users perform best when fully immersed in a task. Protect focus — minimize interruptions, avoid gratuitous modals and confirmations mid-task, preserve state, and keep the path to done unbroken.
雅各布定律。用户大部分时间都在使用其他产品,因此期望你的产品以相同方式工作。遵循常见UI的既定规范和平台模式(导航、表单、图标、手势);仅在能带来真正价值的场景下使用创新设计。↔ H20
心智模型。用户根据他们对系统的认知和工作方式采取行动。匹配他们的预期模型——使用熟悉的标签、隐喻和流程;缩小他们的模型与实际系统之间的差距,而非强迫他们学习新模型。↔ H48
活跃用户悖论。用户会跳过手册直接操作,即使阅读手册会更快。让常用路径一目了然,将指导内容内联在上下文(而非文档)中,设计无需说明即可让用户成功的界面。
Postel定律。宽进严出。接受杂乱、多样的输入(修剪空格、解析日期和电话号码格式、不区分大小写),输出清晰、一致、格式规范的内容。↔ H26, H27
帕金森定律。任务会自动膨胀至填满可用时间。通过自动填充、智能默认值和合理约束缩短完成时间,让用户比预期更快完成任务。↔ H27
心流状态。用户完全沉浸在任务中时表现最佳。保护用户注意力——尽量减少干扰,避免在任务中途弹出不必要的模态框和确认框,保留状态,保持完成路径的连贯性。
Performance & responsiveness — respect the user's time
性能与响应性——尊重用户时间
Doherty Threshold. Productivity soars when system and user respond to each other in under 400 ms. Confirm actions fast — optimistic UI, skeletons, and immediate press feedback — so users never wait on the interface. ↔ H17
Fitts's Law. Time to hit a target depends on its distance and size. Make frequent and primary targets large and close to where the user already is; keep tap targets generous and place mobile primary actions in the thumb zone. ↔ H39, H43
Doherty阈值。当系统和用户的响应时间低于400 ms时,生产力会大幅提升。快速确认操作——使用乐观UI、骨架屏和即时按压反馈——让用户无需等待界面响应。↔ H17
费茨定律。点击目标的时间取决于目标的距离和大小。让高频和主操作目标更大、更靠近用户当前位置;保持点击目标尺寸充足,并将移动端主操作放在拇指操作区。↔ H39, H43
Handling New Patterns
新模式处理
When a heuristic needs a visual property that doesn't yet define (a new color role, a missing spacing step, an undocumented component variant), never invent the value inline. Instead:
docs/design.md- If exists — flag the gap as a New Pattern in your delivery notes (what property, what value the heuristic implies, and where it's needed), and recommend adding it to
docs/design.mdvia the Design System skill, which owns editing the token catalogue and keepsdocs/design.mdin sync. Use the closest existing token in the meantime.docs/design.html - If doesn't exist — follow the codebase's existing convention for that property (theme config, CSS custom property, the component library), note that you did, and recommend running the Design System skill so the project gains a documented source of truth.
docs/design.md
当某条启发式规则需要尚未定义的视觉属性(新颜色角色、缺失的间距步骤、未文档化的组件变体)时,切勿在代码中直接自定义值。反之:
docs/design.md- 若存在——在交付说明中将该缺口标记为新模式(说明所需属性、启发式规则暗示的值以及使用场景),并推荐通过Design System技能将其添加到
docs/design.md中(该技能负责编辑令牌目录并保持docs/design.md同步)。同时使用最接近的现有令牌替代。docs/design.html - 若不存在——遵循代码库中该属性的现有规范(主题配置、CSS自定义属性、组件库),并予以说明,同时推荐运行Design System技能,以便项目获得文档化的可信来源。
docs/design.md
What "done" looks like
“完成”的标准
Generated or reviewed UI where the pre-flight checklist in workflow step 4 passes in full, every visual decision references a token (or a codebase convention when no design system exists), the primary action is the single visually dominant element (H1), microcopy is plain language, errors say what/why/how-to-fix (H32), the success moment is invested in (Peak-End Rule), and any token the design system doesn't yet have is flagged as a New Pattern to promote via the Design System skill rather than invented inline.
docs/design.mdRecommended pairing: run this skill alongside a Build Loop — its review step (, and for sensitive surfaces) catches token drift and accessibility regressions that slip through — and feed any flagged New Patterns back into with the Design System skill before commit.
/review/security-reviewdocs/design.md生成或审查后的UI需完全通过工作流程第4步中的预检查清单,所有视觉决策均引用中的令牌(无设计系统时引用代码库规范),主操作是视图中唯一视觉突出的元素(H1),微文案使用平实语言,错误提示说明问题/原因/解决方法(H32),成功时刻经过精心设计(峰终定律),且设计系统中缺失的令牌均标记为需通过Design System技能添加的新模式,而非直接自定义值。
docs/design.md推荐搭配使用:将此技能与Build Loop配合使用——其审查步骤(,敏感界面使用)可捕获遗漏的令牌偏差和无障碍回归问题——并在提交前将所有标记的新模式通过Design System技能反馈到中。
/review/security-reviewdocs/design.md