add-ui

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

MANDATORY PREPARATION

强制准备

Users start this workflow with
/add-ui
.
add-ui
is the canonical skill name in this repository. Some hosts may expose a friendly
/add
alias, but docs, wrappers, and source files should continue to refer to the skill as
add-ui
.
Once this skill is active, load $frontend-design — it contains the design principles, anti-patterns, and the Context Gathering Protocol. Follow that protocol before proceeding. If no design context exists yet, you MUST load $setup first.
When the request is for a brand-new landing page, marketing page, or several distinct directions and the aesthetic is still open, use the approved style-selection rules in
frontend-design
's design directions. Choose directions that fit the product idea and brand context instead of inventing vague vibe labels.
When working inside an existing project with an established visual system, preserve that system first and make the options feel distinct without quietly rebranding the product.
Also gather the smallest set of implementation details needed to generate usable code:
  • framework / runtime (React, Next.js, Vue, plain HTML, etc.)
  • styling system (Tailwind, CSS modules, styled-components, vanilla CSS, etc.)
  • target insertion point (new route, existing page, shared component folder, design system area)
  • whether this is a brand-new artifact or a redesign of an existing one
  • whether the user wants a section, page, flow, shell, or standalone component
  • quality bar (quick draft, production-ready, flagship)
If the request is a redesign of an existing artifact, also identify:
  • which parts must remain recognizable (content blocks, section order, interaction model, familiar affordances, brand cues)
  • which parts are flexible (style, colors, copywriting, typography, media treatment, density, detail language)
  • whether the user wants mostly safe evolution, a broad explore-and-compare pass, or one or two stretch directions
Use this precedence order when deciding implementation defaults:
  1. detect and match the existing project's styling and component libraries first
  2. if this is a brand-new project and the user explicitly names a styling or component library, use that
  3. if this is a brand-new project and the user does not specify, use the framework defaults defined in
    frontend-design
When React-based fallback defaults are relevant, also consult component library integration to decide whether the requested artifact should be led by primitives, reusable patterns, or block accelerators.
Ask only the missing questions. If you can infer the technical stack from the codebase, do so.
Consult these references as needed:
  • artifact taxonomy
  • component library integration
  • variation quality bar
  • preview and apply patterns
  • request mapping heuristics
  • examples and command naming
Use these deterministic helper assets when they improve consistency across hosts and agents:
  • comparison table template
  • component library integration checklist
  • variant naming scheme
  • preview page checklist
  • apply / cleanup checklist

Generate multiple meaningfully different UI directions for a requested artifact, help the user compare them, then guide selection and integration.
This includes both adding new UI and redesigning existing UI.
When the request is to redesign an existing page, section, flow, shell, or component, default to preserving the artifact's recognizable bones unless the user explicitly asks for structural reinvention. In practice that usually means:
  • keep the core information architecture, content blocks, and sequence intact when they already support the job to be done
  • keep familiar interactions and affordances unless they are clearly broken or the user asks for a larger UX shift
  • evolve the visual system through typography, color, copy framing, media treatment, detail language, spacing rhythm, and emphasis strategy
  • make it obvious across the options what stayed constant and what changed
If one variant intentionally pushes further on structure, label it clearly as the stretch option instead of quietly bulldozing the existing page.
This skill is for requests like:
  • marketing and monetization surfaces: hero, features, pricing, testimonials, FAQ, CTA, logo cloud, gallery, blog, about, contact, plan pickers, upgrade modals, paywalls
  • navigation and shell: navbar, footer, dashboard shell, onboarding feed, settings, card nav
  • auth and account: login, register, forgot password, reset password, verify email, two-factor auth
  • commerce: product overview, product category, product list, filters, cart, checkout, reviews, order summary, gift card
  • data UI: charts, widgets, data tables, forms, compare views, bento grids, timelines, dashboards
The list is illustrative, not exhaustive.
用户通过
/add-ui
启动此工作流。
add-ui
是本仓库的标准 skill 名称。部分 host 可能会提供便于使用的
/add
别名,但文档、包装器和源文件仍应继续将该 skill 称为
add-ui
。
此 skill 激活后,加载
$frontend-design
——其中包含设计原则、反模式以及 Context Gathering Protocol。继续执行前必须遵循该协议。如果尚未建立设计上下文,则必须先加载
$setup
。
当请求涉及全新落地页、营销页,或者需要多个不同方向且美学方向尚未确定时,使用
frontend-design
的设计方向中已批准的风格选择规则。选择符合产品理念和品牌上下文的方向,而不是凭空创造模糊的氛围标签。
在已有视觉体系的现有项目中,应优先保留该体系,同时让各个方案保持明显差异,避免在未经明确要求的情况下悄然重塑品牌形象。
还需收集生成可用代码所需的最小实现信息集:
  • framework / runtime(React、Next.js、Vue、原生 HTML 等)
  • 样式系统(Tailwind、CSS modules、styled-components、vanilla CSS 等)
  • 目标插入位置(新路由、现有页面、共享组件目录、设计系统区域)
  • 是全新产物,还是对现有产物的重新设计
  • 用户需要的是区块、页面、流程、shell,还是独立组件
  • 质量要求(快速草稿、生产级或旗舰级)
如果请求是对现有产物的重新设计,还需确定:
  • 哪些部分必须保持可辨识(内容区块、区块顺序、交互模型、熟悉的操作入口、品牌线索)
  • 哪些部分可以灵活调整(样式、颜色、文案、排版、媒体处理、信息密度、细节表达)
  • 用户希望以稳健演进为主、进行广泛探索比较,还是探索一至两个突破性方向
决定实现默认值时,遵循以下优先级顺序:
  1. 首先检测并匹配现有项目的样式系统和组件库
  2. 如果是全新项目且用户明确指定了样式或组件库,则使用用户指定的方案
  3. 如果是全新项目且用户未指定,则使用
    frontend-design
    中定义的 framework 默认值
当基于 React 的回退默认值适用时,还应查阅组件库集成,以确定请求的产物应由基础组件、可复用模式还是区块加速器主导。
只询问缺失的信息。如果可以从代码库推断技术栈,则直接推断。
根据需要查阅以下参考资料:
  • 产物分类体系
  • 组件库集成
  • 变体质量标准
  • 预览与应用模式
  • 请求映射启发式规则
  • 示例与命令命名
当以下确定性辅助资源有助于在不同 host 和 agent 之间保持一致性时,应予使用:
  • 比较表模板
  • 组件库集成检查清单
  • 变体命名规范
  • 预览页面检查清单
  • 应用与清理检查清单

为请求的产物生成多个具有实质差异的 UI 方向,帮助用户进行比较,然后指导用户完成选择与集成。
此流程既适用于新增 UI,也适用于重新设计现有 UI。
重新设计现有页面、区块、流程、shell 或组件时,默认保留产物中可辨识的骨架,除非用户明确要求进行结构性重构。实际操作通常意味着:
  • 当现有信息架构、内容区块和顺序能够支持用户完成任务时,保留其核心结构
  • 保留熟悉的交互方式和操作入口,除非它们明显失效或用户要求进行更大范围的 UX 调整
  • 通过排版、颜色、文案表达、媒体处理、细节语言、间距节奏和强调策略来演进视觉体系
  • 让用户能够清楚看出各个方案中哪些内容保持不变,哪些内容发生了变化
如果某个变体有意在结构上更进一步,应明确将其标记为突破性选项,而不是悄然推翻现有页面。
此 skill 适用于以下类型的请求:
  • 营销与变现界面:hero、功能介绍、定价、用户评价、FAQ、CTA、logo 展示区、图库、博客、关于我们、联系我们、套餐选择器、升级弹窗、付费墙
  • 导航与 shell:navbar、footer、dashboard shell、引导信息流、设置、卡片式导航
  • 认证与账户:登录、注册、忘记密码、重置密码、验证邮箱、双重身份验证
  • 电商:商品概览、商品分类、商品列表、筛选器、购物车、结账、评价、订单摘要、礼品卡
  • 数据 UI:图表、组件、数据表格、表单、对比视图、Bento 网格、时间线、dashboard
以上列表仅作示例,并不穷尽所有场景。

Core Operating Rules

核心执行规则

  1. Generate real alternatives, not recolors
    • Variations must differ in layout, hierarchy, density, tone, interaction model, and content framing.
    • Changing only palette, border radius, or icon set does not count as a new direction.
  2. Start from the requested job to be done
    • A pricing section is not just cards.
    • A login screen is not just inputs.
    • A dashboard shell is not just chrome.
    • Anchor every variant in the user's primary task and the product's tone.
    • For broad new-project marketing requests, choose approved design directions that fit the company / product idea and explain the fit.
  3. Prefer source-based previews over ephemeral DOM tricks
    • If the host supports previews, generate real components/pages/routes the user can inspect and choose from.
    • Do not rely on browser-extension-style DOM injection as the primary workflow. It is fragile and does not create maintainable source code.
  4. Stay opinionated
    • better-web-ui
      optimizes for distinctive, high-taste output.
    • Do not collapse into the safest possible generic SaaS layout.
    • Use the frontend-design anti-pattern guidance aggressively.
  5. Be integration-aware
    • Match the project's existing code conventions and folder structure.
    • If a shared UI system already exists, plug into it instead of creating random one-off primitives.
    • If repeated structure emerges across variants, extract sensible shared pieces.
  6. Honor preserve-the-essence requests
    • If the user says to keep the essence, keep the recognizable structure, key parts, and narrative flow unless they explicitly invite a deeper overhaul.
    • Distinct directions can still be genuinely different through type, color, copy, density, proof treatment, surface styling, media direction, and action emphasis.
    • Do not mistake “give me options” for permission to discard the existing architecture.
  1. 生成真正的替代方案,而不只是换色
    • 各个变体必须在布局、层级、信息密度、语气、交互模型和内容表达方面存在差异。
    • 仅更改配色、圆角或图标集不算作新的设计方向。
  2. 从用户要完成的核心任务出发
    • 定价区不只是卡片。
    • 登录界面不只是输入框。
    • dashboard shell 不只是外框装饰。
    • 每个变体都应围绕用户的首要任务和产品语气展开。
    • 对于需求广泛的全新项目营销页面,应选择符合公司或产品理念的已批准设计方向,并说明其适配原因。
  3. 优先使用基于源码的预览,而非临时性的 DOM 技巧
    • 如果 host 支持预览,应生成真实的组件、页面或路由,供用户检查并选择。
    • 不要将浏览器扩展式的 DOM 注入作为主要工作流。这种方式十分脆弱,也无法生成可维护的源代码。
  4. 保持明确的设计立场
    • better-web-ui
      旨在产出鲜明且具有高品味的成果。
    • 不要退回到最保守、最普通的通用 SaaS 布局。
    • 应积极运用
      frontend-design
      的反模式指导原则。
  5. 具备集成意识
    • 匹配项目现有的代码约定和目录结构。
    • 如果项目已经具备共享 UI 系统,应直接接入,而不是创建零散的一次性基础组件。
    • 如果多个变体中反复出现相同结构,应提取合理的共享部分。
  6. 尊重“保留本质”的要求
    • 如果用户要求保留本质,应保留可辨识的结构、关键部分和叙事流程,除非用户明确邀请进行更深入的全面改造。
    • 即使需要呈现明显不同的方向,也可以通过字体、颜色、文案、信息密度、信任背书、表面样式、媒体方向和操作重点形成真正差异。
    • 不要将“提供多个选项”误解为可以丢弃现有架构。

Workflow

工作流

1. Classify the request

1. 对请求进行分类

Use the artifact taxonomy to determine whether the user is asking for a section, page, flow, shell, or data/content component.
Also determine whether this is:
  • a net-new artifact
  • a redesign of an existing artifact with structure mostly preserved
  • a redesign that allows moderate restructuring
  • a redesign that invites a full rethink
Then identify:
  • primary user goal
  • core content blocks
  • critical states (loading, empty, error, success, validation, responsive layout)
  • placement context (new page, inside existing page, inside dashboard, inside marketing site)
  • which structural elements are fixed versus flexible
  • which current qualities should remain recognizable versus which should change
使用产物分类体系,确定用户请求的是区块、页面、流程、shell,还是数据与内容组件。
同时确定该请求属于以下哪一种:
  • 全新产物
  • 保留大部分结构的现有产物重新设计
  • 允许适度重构的重新设计
  • 邀请进行全面重新思考的重新设计
然后确定:
  • 用户的核心目标
  • 核心内容区块
  • 关键状态(加载、空状态、错误、成功、验证、响应式布局)
  • 放置上下文(新页面、现有页面内部、dashboard 内部、营销站点内部)
  • 哪些结构元素固定,哪些可以灵活调整
  • 哪些现有特征应保持可辨识,哪些应发生变化

2. Define 5 distinct directions

2. 定义 5 个不同方向

Generate 5 candidate directions. Fewer than 3 reduces exploration; more than 5 becomes noise.
Use the variation quality bar to ensure the five directions are meaningfully different rather than cosmetic recolors.
When the request says to preserve the existing structure or essence, treat the current artifact as the baseline skeleton. The directions should primarily vary through visual system and messaging decisions rather than by deleting or reordering the page without permission.
For that kind of redesign, distinct options can differ through combinations of:
  • typography and font pairing
  • palette and contrast strategy
  • copywriting tone and headline framing
  • proof placement and emphasis
  • density and spacing rhythm
  • imagery or illustration treatment
  • surface styling, borders, depth, and detail language
  • action hierarchy and CTA presentation
Each direction must have:
  • Name: short, memorable, concept-led
  • Approved direction: the primary structural direction and any supporting treatment when relevant
  • Design thesis: one sentence explaining the idea
  • Why it works: how it supports the user's goals
  • Key traits: hierarchy, layout, density, personality, media treatment, action strategy
  • Best fit: when this direction should be chosen over the others
  • Style cost: the main implementation, performance, or state-management cost to watch
For redesigns of existing artifacts, also state:
  • Preserved bones: what remains intentionally recognizable from the current artifact
  • Primary changes: what is being pushed hardest in this direction
生成 5 个候选方向。少于 3 个会限制探索,超过 5 个则会造成噪声。
使用变体质量标准,确保这 5 个方向具有实质差异,而不是仅做表面换色。
当请求要求保留现有结构或本质时,应将当前产物作为基础骨架。各方向应主要通过视觉体系和文案决策形成差异,而不是在未经许可的情况下删除或重新排列页面。
对于这类重新设计,不同选项可以通过以下因素的组合形成差异:
  • 字体与字体搭配
  • 配色与对比度策略
  • 文案语气和标题表达
  • 信任背书的放置与强调方式
  • 信息密度和间距节奏
  • 图像或插画处理
  • 表面样式、边框、深度和细节语言
  • 操作层级和 CTA 呈现方式
每个方向都必须包含:
  • 名称:简短、易记、以设计概念为核心
  • 采用的方向:主要结构方向,以及相关时的辅助处理方式
  • 设计主张:用一句话解释设计想法
  • 适用原因:说明该方向如何支持用户目标
  • 关键特征:层级、布局、信息密度、个性、媒体处理和操作策略
  • 最佳适用场景:说明何时应优先选择该方向
  • 实现成本:需要关注的主要实现、性能或状态管理成本
对于现有产物的重新设计,还需说明:
  • 保留的骨架:当前产物中有意保持可辨识的部分
  • 主要改动:该方向重点推进的变化

3. Build real candidate artifacts

3. 构建真实候选产物

For each direction, generate a real artifact package.
Prefer:
  • real component files
  • real route/page files
  • real preview shells that switch between variants
  • real data mocks or placeholders when needed to make the UI legible
When redesigning an existing artifact, fork from the real current implementation when practical instead of rebuilding the whole thing from scratch. Preserve the requested structure first, then layer the design changes on top.
Use the preview and apply patterns to decide how to structure previews, fallback comparison formats, and final integration.
为每个方向生成一套真实产物包。
优先使用:
  • 真实组件文件
  • 真实路由或页面文件
  • 可在不同变体间切换的真实预览 shell
  • 为确保 UI 内容清晰可读而提供的真实数据 mock 或占位内容
重新设计现有产物时,应尽可能以真实的当前实现为基线进行派生,而不是从头重建整个产物。先保留请求指定的结构,再叠加设计改动。
使用预览与应用模式,决定如何组织预览、备用比较形式和最终集成。

4. Make the variants truly comparable

4. 让各个变体具备真正可比性

For every variation, include the same practical checkpoints:
  • responsive behavior
  • accessibility expectations
  • key interaction states
  • content placeholders or example copy
  • implementation notes
  • any required supporting components
For redesigns, also include:
  • a short note about what remained structurally consistent
  • a short note about what changed visually or editorially
Do not let one option be a sketch while another is production-grade. Compare like with like.
每个变体都应包含相同的实用检查项:
  • 响应式行为
  • 无障碍要求
  • 关键交互状态
  • 内容占位符或示例文案
  • 实现说明
  • 所需的配套组件
对于重新设计,还需包含:
  • 一段简短说明,指出哪些内容在结构上保持一致
  • 一段简短说明,指出哪些内容在视觉或文案层面发生了变化
不要让某个选项停留在草图阶段,而另一个选项却达到生产级质量。所有方案都应在同一标准下进行比较。

5. Recommend, then let the user choose

5. 先给出推荐,再让用户选择

After generating the options:
  1. summarize the tradeoffs in a compact table
  2. recommend one option if the user's goals clearly favor it
  3. let the user choose explicitly when multiple directions are viable
Your recommendation should explain why the chosen direction best matches:
  • audience
  • product tone
  • information density
  • conversion or usability goals
  • maintainability in the current codebase
生成各个选项后:
  1. 使用紧凑的表格总结权衡因素
  2. 如果用户的目标明显偏向某个方案,则推荐该方案
  3. 如果存在多个可行方向,让用户明确选择
推荐说明应解释所选方向为何最符合以下方面:
  • 目标受众
  • 产品语气
  • 信息密度
  • 转化或可用性目标
  • 当前代码库中的可维护性

6. Apply the chosen direction cleanly

6. 干净地应用所选方向

Once a direction is selected:
  • integrate it into the requested target location
  • preserve project conventions and imports
  • extract repeated primitives if they are genuinely reusable
  • remove obviously dead temporary scaffolding unless the user wants to keep the alternatives around
  • keep preview artifacts only when they remain useful for future iteration
When a reusable pattern emerges, apply the spirit of
extract
— but do not build a bloated design system for one request.
Use the request mapping heuristics for artifact-specific priorities such as hero sections, pricing, paywalls, auth, dashboards, commerce flows, and content surfaces.
选定方向后:
  • 将其集成到请求指定的目标位置
  • 保留项目约定和导入方式
  • 如果重复结构确实可复用,则提取相应基础组件
  • 除非用户希望保留备选方案,否则删除明显失效的临时脚手架
  • 仅在预览产物对未来迭代仍有帮助时予以保留
当出现可复用模式时,借鉴
extract
的理念,但不要为一次请求构建臃肿的设计系统。
使用请求映射启发式规则,处理 hero 区、定价、付费墙、认证、dashboard、电商流程和内容界面等特定产物的优先事项。

Output Contract

输出约定

Whenever possible, present results in this order:
  1. What I generated — requested artifact + number of directions
  2. Variation summary table — 1/2/3/4/5 with thesis and best-fit use case, using the comparison table template when helpful
  3. Recommended choice — if appropriate
  4. Preview/apply notes — how to inspect or switch among variants
  5. Implementation output — created/updated files
Use the variant naming scheme to keep labels, file names, and selection mapping deterministic. Use the preview page checklist when building a preview surface. Use the apply / cleanup checklist after the user selects a direction.
尽可能按照以下顺序呈现结果:
  1. 生成了什么——请求的产物及方向数量
  2. 变体摘要表——使用 1/2/3/4/5 编号,并列出设计主张和最佳适用场景;必要时使用比较表模板
  3. 推荐方案——如适用
  4. 预览与应用说明——如何检查或切换不同变体
  5. 实现输出——已创建或更新的文件
使用变体命名规范,确保标签、文件名和选择映射具有确定性。
构建预览界面时,使用预览页面检查清单。
用户选定方向后,使用应用与清理检查清单。

Never Do This

禁止事项

  • generate 5 near-identical variants with cosmetic differences only
  • inject temporary browser DOM as the main implementation strategy
  • ignore the existing codebase structure and styling system
  • bulldoze an existing artifact's structure after the user asked to preserve its essence or recognizable parts
  • default to generic startup aesthetics just because the prompt is broad
  • default to retro, cyber, synthwave, terminal, or generic futuristic-neon directions in this library
  • make every option loud, card-heavy, gradient-heavy, or animation-heavy
  • skip loading/error/empty/responsive-layout states when they materially affect the artifact
  • apply a chosen variant without making it clear what changed
Remember: this skill is not a slot machine for interchangeable UI. It is a structured exploration workflow that helps the user choose among genuinely different, production-credible directions and end up with maintainable source code.
  • 生成 5 个仅存在表面差异的近似变体
  • 将临时的浏览器 DOM 注入作为主要实现策略
  • 忽略现有代码库结构和样式系统
  • 用户要求保留本质或可辨识部分后,仍推翻现有产物的结构
  • 仅因为请求宽泛,就默认采用通用初创公司审美
  • 在此设计库中默认使用复古、赛博朋克、合成波、终端或泛未来霓虹风方向
  • 让每个选项都过于喧闹、卡片过多、渐变过多或动画过多
  • 在状态会实质影响产物时,忽略加载、错误、空状态或响应式布局状态
  • 应用所选变体时,未清楚说明发生了哪些改动
请记住,此 skill 不是一台用于产出可互换 UI 的老虎机。它是一套结构化探索工作流,旨在帮助用户在真正不同且可信的生产级方向之间做出选择,并最终获得可维护的源代码。