frontend-design-enhanced

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Frontend Design

前端设计

Create real, working frontend experiences with a clear point of view. Distinctive is the goal, but the interface must still help the user complete tasks quickly and confidently. When the codebase already has a design language, extend it intelligently instead of forcing a disconnected redesign.
打造具有明确设计理念的真实可用前端体验。我们的目标是独特性,但界面仍需帮助用户快速、自信地完成任务。当代码库已有设计语言时,应合理扩展该语言,而非强行进行脱节的重新设计。

Use this skill when

适用场景

  • The user wants a page, component, view, landing page, dashboard, form flow, design system, or frontend refactor.
  • The user wants HTML/CSS/JS, TypeScript, React, Vue, Svelte, Next.js, Tailwind, or similar UI code.
  • The user wants an existing UI reviewed, restyled, or made more polished, usable, responsive, or accessible.
  • The request is primarily about visible interface design and implementation, not backend logic.
  • 用户需要页面、组件、视图、着陆页、仪表盘、表单流程、设计系统或前端重构。
  • 用户需要HTML/CSS/JS、TypeScript、React、Vue、Svelte、Next.js、Tailwind或类似UI代码。
  • 用户需要对现有UI进行评审、重新样式化,或使其更精致、易用、响应式、可访问。
  • 请求主要围绕可见界面的设计与实现,而非后端逻辑。

Do not use this skill when

不适用场景

  • The task is purely backend, API, database, infrastructure, or CLI with no meaningful UI surface.
  • The user only wants branding strategy or copywriting without interface work.
  • 任务纯后端、API、数据库、基础设施或CLI相关,无有意义的UI界面。
  • 用户仅需要品牌策略或文案撰写,无需界面相关工作。

Core stance

核心原则

  • Make the design memorable, not merely fashionable.
  • Put task clarity first: hierarchy, affordance, and readability beat decoration.
  • Honor real-world constraints: existing brand, framework, performance budget, accessibility requirements, and team conventions.
  • One signature element is stronger than five disconnected tricks.
  • If the brief is vague, make decisive assumptions and state them briefly.
  • 让设计令人难忘,而非仅仅追求时尚。
  • 优先保证任务清晰:层级结构、交互提示和可读性优于装饰性元素。
  • 尊重现实约束:现有品牌、框架、性能预算、可访问性要求和团队惯例。
  • 一个标志性元素强于五个零散的设计技巧。
  • 如果需求模糊,做出果断假设并简要说明。

Workflow

工作流程

1) Read the problem and the codebase

1) 理解问题与代码库

Before changing anything, extract:
  • Purpose: what the screen must help a person do.
  • Primary actions: the key clicks, decisions, inputs, and success path.
  • Audience: skill level, device mix, and context of use.
  • Constraints: framework, styling system, performance budget, accessibility target, brand rules, localization, dark/light mode, and technical limits.
  • Content shape: real data types, long labels, empty states, loading states, failure states, permissions, destructive actions, and edge cases.
  • Existing system: current tokens, spacing, typography, components, utilities, icon style, and motion language.
  • Reference cues: screenshots, wireframes, existing brand materials, or nearby product surfaces.
If you are refining an existing product, inspect nearby components and styles first. Reuse the product's own primitives unless the user asked for a redesign.
在进行任何修改前,先提炼以下信息:
  • 用途:该界面必须帮助用户完成什么操作。
  • 核心操作:关键的点击、决策、输入和成功路径。
  • 受众:用户技能水平、设备类型和使用场景。
  • 约束条件:框架、样式系统、性能预算、可访问性目标、品牌规则、本地化、深色/浅色模式和技术限制。
  • 内容形态:真实数据类型、长标签、空状态、加载状态、错误状态、权限、破坏性操作和边缘情况。
  • 现有系统:当前的设计令牌、间距、排版、组件、工具类、图标样式和动效语言。
  • 参考线索:截图、线框图、现有品牌素材或相关产品界面。
如果是优化现有产品,先检查相关组件和样式。除非用户要求重新设计,否则复用产品自身的基础组件。

2) Choose the mode

2) 选择设计模式

Pick one mode explicitly:
  • New system: greenfield UI or major redesign.
  • Extension: a new surface inside an existing design system.
  • Polish: improve clarity, rhythm, affordances, and visual quality without changing the product's core identity.
明确选择以下一种模式:
  • 全新系统:从零开始的UI或重大重新设计。
  • 扩展现有:在现有设计系统内新增界面。
  • 优化打磨:在不改变产品核心标识的前提下,提升清晰度、节奏感、交互提示和视觉品质。

3) Write a visual brief before coding

3) 编码前撰写视觉设计 brief

Commit to one strong direction rather than blending everything together. Examples: ultra-minimal, editorial, brutalist, playful, industrial, luxe, retro-futuristic, organic, art deco, lo-fi zine, soft/pastel.
Before you code, write 3-5 bullets covering:
  • aesthetic direction
  • density (airy vs compact)
  • palette strategy
  • type strategy
  • signature element
  • motion character
Example:
Dark industrial dashboard; compact grid; condensed serif display + restrained sans; graphite + acid-lime accent; data panels with scanline texture; 140ms snap transitions.
Also define a restraint rule: what you will intentionally avoid so the design stays coherent.
确定一个清晰的设计方向,而非混合多种风格。例如:极简主义、编辑风格、粗野主义、趣味风格、工业风、奢华风、复古未来主义、有机风格、装饰艺术风、低保真zine风、柔和/马卡龙风。
编码前,撰写3-5条要点,涵盖:
  • 美学方向
  • 密度(宽松 vs 紧凑)
  • 调色板策略
  • 排版策略
  • 标志性元素
  • 动效风格
示例:
深色工业风仪表盘;紧凑网格;浓缩衬线标题字体搭配简洁无衬线正文字体;石墨色+酸橙绿强调色;带扫描线纹理的数据面板;140ms快速过渡动效。
同时定义约束规则:明确刻意避免的设计元素,以保持设计连贯性。

4) Build the information hierarchy

4) 构建信息层级

Make the interface readable at a glance:
  • establish a dominant headline or anchor
  • make the primary action unmistakable
  • group related content clearly
  • design for scanning before reading
  • remove decorative clutter that competes with task completion
When building workflows, reduce friction first. When building marketing pages, create narrative pace. When building dashboards, optimize for fast interpretation and dense clarity.
让界面一目了然:
  • 确立主导标题或视觉锚点
  • 让核心操作清晰突出
  • 清晰分组相关内容
  • 优先为快速浏览设计,而非深度阅读
  • 移除干扰任务完成的装饰性冗余元素
构建工作流时,优先减少操作摩擦;构建营销页面时,打造叙事节奏;构建仪表盘时,优化快速解读和信息密度。

5) Build a visual system, not isolated styles

5) 构建视觉系统,而非孤立样式

Use tokens or theme variables for all repeat values.
Typography
  • Choose typography that carries the concept. Avoid default-feeling display choices unless the existing brand requires them.
  • Pair expressive display typography with a calmer body face, or create distinction through weight, width, case, and spacing if custom fonts are constrained.
  • Use intentional hierarchy:
    • headline
      line-height
      : ~1.0-1.2
    • subhead/section titles: ~1.2-1.35
    • body: ~1.5-1.7
  • Use slight tracking for uppercase labels. Use
    clamp()
    for fluid scale.
Color
  • Use a tight palette: 1-2 neutrals, 1 dominant accent, semantic colors only where needed.
  • Concentrate accent color where action or emphasis matters.
  • Ensure accessible contrast, including on hover, focus, and disabled states.
  • Prefer decisive color stories over timid multi-accent palettes.
Layout and space
  • Work from a consistent spacing scale such as
    4, 8, 12, 16, 24, 32, 48, 64
    .
  • Use a real grid, or deliberate asymmetry that still reads clearly.
  • Create energy with contrast in scale: tiny labels against large headlines, compressed dense tables against generous margins, and other intentional shifts.
  • Avoid default centered-everything compositions unless the concept truly calls for it.
Depth and atmosphere
  • Never stop at flat white plus default black.
  • Add depth that matches the concept: subtle gradients, grain, borders, patterning, layered surfaces, ambient shadows, blur, print textures, or controlled glow.
  • Decorative effects must reinforce the concept and never reduce legibility.
Motion
  • Micro-interactions: ~100-150ms
  • Panels, modals, and state changes: ~200-300ms
  • Orchestrated entrances: ~400-600ms
  • Use
    ease-out
    for entrances and
    ease-in-out
    for state changes.
  • Prefer one well-choreographed reveal over many random animations.
  • Always respect
    prefers-reduced-motion
    .
使用设计令牌或主题变量定义所有重复值。
排版
  • 选择符合设计理念的排版。除非现有品牌要求,否则避免使用默认感的标题字体。
  • 将富有表现力的标题字体与更沉稳的正文字体搭配;若自定义字体受限,可通过字重、字宽、大小写和间距来区分层级。
  • 建立明确的层级:
    • 标题
      line-height
      :~1.0-1.2
    • 副标题/章节标题:~1.2-1.35
    • 正文:~1.5-1.7
  • 大写标签使用轻微字距调整。使用
    clamp()
    实现流畅的字体缩放。
色彩
  • 使用精简调色板:1-2种中性色、1种主导强调色,仅在必要时使用语义化颜色。
  • 将强调色集中用于操作或需要突出的区域。
  • 确保可访问的对比度,包括 hover、focus和禁用状态。
  • 优先选择明确的色彩方案,而非保守的多强调色调色板。
布局与间距
  • 使用统一的间距尺度,如
    4, 8, 12, 16, 24, 32, 48, 64
  • 使用真实网格,或清晰易读的刻意不对称布局。
  • 通过尺度对比营造活力:小标签搭配大标题、紧凑密集的表格搭配充足边距,以及其他刻意的尺度变化。
  • 除非设计理念确实需要,否则避免默认的全居中布局。
深度与氛围
  • 不要止步于纯白加默认黑色的基础设计。
  • 添加符合设计理念的层次感:微妙渐变、颗粒感、边框、图案、分层界面、环境阴影、模糊、印刷纹理或可控光晕。
  • 装饰性效果必须强化设计理念,且绝不降低可读性。
动效
  • 微交互:~100-150ms
  • 面板、模态框和状态变化:~200-300ms
  • 协同入场动画:~400-600ms
  • 入场动画使用
    ease-out
    ,状态变化使用
    ease-in-out
  • 优先选择一组编排良好的展示动画,而非多个随机动画。
  • 始终尊重
    prefers-reduced-motion
    设置。

6) Implement like a product designer who also ships

6) 以懂落地的产品设计师视角实现

  • Use semantic HTML and meaningful component structure.
  • Keep component APIs small and understandable.
  • Follow the framework's conventions instead of fighting them.
  • Prefer co-located styles and shared tokens over scattered one-off overrides.
  • Avoid magic numbers. If a value repeats, promote it to a token.
  • Do not introduce major UI libraries or animation dependencies for minor stylistic gains unless the user asked for them or the payoff is substantial.
Framework-specific guidance:
  • Tailwind: use CSS variables, shared utility patterns, and extracted components or classes for recurring patterns; avoid walls of arbitrary values.
  • React/Vue/Svelte: keep components composable, state flows clear, and props intentional.
  • Plain HTML/CSS/JS: make the code clean enough to drop into a real project, not a demo-only snippet.
  • 使用语义化HTML和合理的组件结构。
  • 保持组件API精简易懂。
  • 遵循框架惯例,而非与之对抗。
  • 优先使用就近样式和共享令牌,而非分散的一次性覆盖样式。
  • 避免魔法数值。若某个值重复出现,将其提升为设计令牌。
  • 除非用户要求或收益显著,否则不要为了微小的风格提升引入大型UI库或动画依赖。
框架特定指南:
  • Tailwind:使用CSS变量、共享工具类模式,提取重复模式为组件或类;避免大量任意值堆砌。
  • React/Vue/Svelte:保持组件可组合、状态流转清晰、props设计合理。
  • 纯HTML/CSS/JS:确保代码足够整洁,可直接投入真实项目,而非仅适用于演示的片段。

7) Handle real product states

7) 处理真实产品状态

Every important surface should account for:
  • hover, focus, active, and disabled states
  • loading with layout stability
  • empty state with a useful next step
  • error state with a recovery path
  • success or confirmation states when relevant
  • validation feedback for forms
  • text overflow, long labels, and small screens
Use realistic copy and data shapes whenever possible. Avoid lorem ipsum unless the user asks for placeholders.
每个重要界面都应考虑以下状态:
  • hover、focus、active和禁用状态
  • 保持布局稳定的加载状态
  • 带有实用下一步操作的空状态
  • 带有恢复路径的错误状态
  • 相关场景下的成功或确认状态
  • 表单验证反馈
  • 文本溢出、长标签和小屏幕适配
尽可能使用真实的文案和数据形态。除非用户要求占位符,否则避免使用lorem ipsum。

8) Make it responsive and accessible by default

8) 默认实现响应式与可访问性

  • Start mobile-first.
  • No horizontal scroll at 320px.
  • Use fluid type and responsive containers.
  • Provide visible, high-contrast focus styles.
  • Ensure full keyboard navigation.
  • Use labels for form fields and accessible names for icon-only controls.
  • Use ARIA only when native semantics are insufficient.
  • Preserve readability at zoom and with long text.
  • Support reduced motion and color/contrast needs.
  • 采用移动端优先的设计思路。
  • 在320px宽度下无水平滚动。
  • 使用流畅字体和响应式容器。
  • 提供可见、高对比度的focus样式。
  • 支持完整的键盘导航。
  • 为表单字段添加标签,为纯图标控件设置可访问名称。
  • 仅在原生语义不足时使用ARIA。
  • 在缩放和长文本场景下保持可读性。
  • 支持减少动效和色彩/对比度适配需求。

9) QA the result before you stop

9) 完成前进行QA检查

Check:
  • Does the design have a clear identity?
  • Does the primary action stand out immediately?
  • Would this still feel good with real, messy content?
  • Is it consistent with the existing product if one already exists?
  • Is it usable without a mouse?
  • Does it still work on a narrow mobile viewport?
  • Could this belong to any brand? If yes, revise.
  • Does anything feel like a copied trend rather than an intentional choice?
Revise until the answer is yes.
检查以下内容:
  • 设计是否具有清晰的辨识度?
  • 核心操作是否立即突出?
  • 搭配真实、杂乱的内容后是否仍体验良好?
  • 若存在现有产品,是否与之一致?
  • 无需鼠标是否可正常使用?
  • 在窄屏移动设备上是否仍能正常工作?
  • 该设计是否可适用于任意品牌?如果是,进行修改。
  • 是否存在看似跟风而非刻意选择的设计元素?
修改至所有问题的答案都符合要求为止。

Surface-specific heuristics

界面特定启发式规则

Landing pages and marketing

着陆页与营销页面

  • Build a clear narrative arc, not a template stack.
  • Make the hero distinctive, but let proof, differentiation, and CTA rhythm carry the page.
  • Avoid the default
    hero -> three cards -> testimonials -> CTA
    skeleton unless the user explicitly asks for it.
  • 打造清晰的叙事弧线,而非模板堆砌。
  • 让 hero 区域独特,但由产品证明、差异化优势和CTA节奏支撑整个页面。
  • 除非用户明确要求,否则避免默认的
    hero -> 三张卡片 -> 客户证言 -> CTA
    结构。

Dashboards and data-heavy apps

仪表盘与数据密集型应用

  • Optimize for scan speed, density, comparison, and filter clarity.
  • Use hierarchy and spacing to separate control surfaces from data surfaces.
  • Make tables, charts, filters, and cards feel related, not like unrelated widgets.
  • 优化扫描速度、信息密度、对比性和筛选清晰度。
  • 使用层级和间距区分控制区域与数据区域。
  • 让表格、图表、筛选器和卡片感觉彼此关联,而非独立的小部件。

Forms and workflow UIs

表单与工作流UI

  • Reduce cognitive load.
  • Show progress, consequences, and validation clearly.
  • Make destructive actions unmistakable and reversible where possible.
  • 降低认知负荷。
  • 清晰展示进度、结果和验证反馈。
  • 让破坏性操作清晰可辨,并尽可能支持撤销。

Design-system work and component libraries

设计系统与组件库工作

  • Solve for consistency, extensibility, and state coverage.
  • Prefer a few strong primitives over many almost-duplicate components.
  • 解决一致性、可扩展性和状态覆盖问题。
  • 优先选择少量强大的基础组件,而非多个近乎重复的组件。

Avoid generic output

避免通用化输出

Do not default to:
  • Inter, Roboto, Arial, Space Grotesk, Poppins, or generic system fonts as the display voice unless the product already uses them or constraints require them
  • purple or blue gradients on white
  • shallow startup palettes
  • default browser form controls
  • generic glassmorphism or neumorphism as the whole concept
  • cookie-cutter section stacks and evenly weighted card grids
  • decorative motion with no functional purpose
Always include at least one memorable signature element that fits the context. Good options include a striking typographic treatment, an unusual but usable grid, a distinctive border language, a controlled texture system, a strong color-positioning strategy, or a single standout interaction pattern.
不要默认使用:
  • Inter、Roboto、Arial、Space Grotesk、Poppins或通用系统字体作为标题字体,除非产品已在使用或受约束条件限制
  • 白色背景上的紫色或蓝色渐变
  • 千篇一律的创业公司调色板
  • 浏览器默认表单控件
  • 将通用玻璃拟态或新拟态作为整体设计理念
  • 刻板的区块堆叠和权重均等的卡片网格
  • 无功能意义的装饰性动效
始终至少包含一个符合场景的标志性记忆点。优秀的选择包括:醒目的排版处理、独特但易用的网格、与众不同的边框风格、可控的纹理系统、明确的色彩定位策略,或单一突出的交互模式。

Response format

响应格式

When you answer the user, structure the work like this unless they asked for something different:
  1. brief assumptions or context
  2. visual brief (3-5 bullets)
  3. implementation notes or what changed
  4. complete code or concrete edits
  5. short QA and polish notes
If the user asks for direct edits to an existing file, keep the commentary brief and ship the implementation.
除非用户另有要求,否则按以下结构回复:
  1. 简要假设或上下文
  2. 视觉设计brief(3-5条要点)
  3. 实现说明或修改内容
  4. 完整代码或具体修改
  5. 简短的QA与优化说明
如果用户要求直接修改现有文件,保持评论简洁并交付实现结果。

Standard

标准

Safe is forgettable. Trend-chasing is forgettable. Ship frontend work that feels considered, specific, usable, and ready to live in a real product.
保守的设计易被遗忘,跟风的设计易被遗忘。交付经过深思熟虑、贴合场景、易用且可直接投入真实产品的前端作品。