Token导航 LogoToken导航

Agent Skill · 前端设计

refactoring-ui(重构用户界面)

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

refactoring-ui 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 248。

总安装 54,096周安装 2,316GitHub Stars 779下载 18,952核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:refactoring-ui(重构用户界面)
来源仓库:https://github.com/wondelai/skills
仓库路径:skills/refactoring-ui
安装命令:
npx skills add https://github.com/wondelai/skills --skill refactoring-ui
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/wondelai/skills --skill refactoring-ui

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

使用系统设计原则审核并修复 Web UI 中的视觉层次结构、间距、颜色和深度。

七个核心原则:通过大小/重量/颜色的视觉层次结构、受限的间距比例(4/8/16/24/32/48/64px)、模块化排版、每种颜色 5-9 种色调的系统调色板、阴影标高比例、有意的图像/图标大小以及有意的布局组合 先灰度设计,最后添加颜色;根据框架指南对设计进行 0-10 评分,并提供达到 10/10 的具体改进路径 涵盖表单设计、导航模式、卡片布局、表格、仪表板和响应策略,以及每个原则的 CSS 模式和道德界限 包括诊断检查表(模糊测试、灰度验证、间距一致性、对比度验证)和常见错误及修复

来源仓库内路径:skills/refactoring-ui

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/wondelai/skills --skill refactoring-ui;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

refactoring-ui 怎么安装?

在终端执行 npx skills add https://github.com/wondelai/skills --skill refactoring-ui。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

refactoring-ui 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

refactoring-ui 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

refactoring-ui 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

refactoring-ui 用的人多吗?

公开数据是累计安装 54,096 次,近一周安装 2,316 次,下载 18,952 次,GitHub 779 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

refactoring-ui 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
refactoring-ui

重构用户界面 · 本页

54,096779只读未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Refactoring UI Design System

A practical, opinionated approach to UI design. Apply these principles when generating frontend code, reviewing designs, or advising on visual improvements.

Core Principle

Design in grayscale first. Add color last. This forces proper hierarchy through spacing, contrast, and typography before relying on color as a crutch.

The foundation: Great UI isn't about creativity or talent -- it's about systems. Constrained scales for spacing, type, color, and shadows produce consistently professional results. Start with too much white space, then remove. Details come later -- don't obsess over icons, shadows, or micro-interactions until the layout and hierarchy work.

Scoring

Goal: 10/10. When reviewing or creating UI designs or frontend code, rate it 0-10 based on adherence to the principles below. A 10/10 means full alignment with all guidelines; lower scores indicate gaps to address. Always provide the current score and specific improvements needed to reach 10/10.

The Refactoring UI Framework

Seven principles for building professional interfaces without a designer:

1. Visual Hierarchy

Core concept: Not everything can be important. Create hierarchy through three levers: size, weight, and color.

Why it works: When every element competes for attention, nothing stands out. Deliberate de-emphasis of secondary content makes primary content powerful by contrast.

Key insights:

  • Combine levers, don't multiply -- primary text = large OR bold OR dark, not all three
  • Save "all three" for the single most important element on the page
  • Labels are secondary -- form labels, table headers, and metadata labels support the data, not compete with it
  • Semantic color does not equal visual weight -- a muted red secondary button often works better than screaming danger for routine actions
  • De-emphasize labels by making them smaller, lighter, or uppercase-small

Product applications:

ContextHierarchy TechniqueExample
Form fieldsDe-emphasize labels, emphasize valuesSmall uppercase label above large value text
NavigationPrimary nav bold, secondary nav lighterActive link in dark gray-900, inactive in gray-500
CardsTitle large, metadata small and lightCard title 20px bold, date 12px gray-400
DashboardsKey metric large, context smallRevenue "$42,300" large, "vs last month" small
TablesDe-emphasize headers, emphasize cell dataHeaders uppercase small gray, data normal weight

Design patterns:

  • Three-level hierarchy table: Size (large/base/small), Weight (bold/medium/normal), Color (dark/medium/light gray)
  • Label-value pattern: de-emphasized label above emphasized value
  • Button hierarchy: primary (filled), secondary (outlined or muted), tertiary (text only)

Ethical boundary: Don't use hierarchy tricks to hide important information like pricing, terms, or cancellation options.

See: references/advanced-patterns.md for interaction states and advanced component patterns.

2. Spacing & Sizing

Core concept: Use a constrained spacing scale, not arbitrary values. Spacing defines relationships -- elements closer together are more related.

Why it works: Arbitrary spacing (padding: 13px) creates inconsistency. A fixed scale forces deliberate decisions and produces harmonious layouts. Generous spacing feels premium; dense spacing feels overwhelming.

Key insights:

  • Use a linear or near-linear scale: 4, 8, 16, 24, 32, 48, 64px
  • Start with too much white space, then remove -- you'll almost never remove enough
  • Spacing between groups should be larger than spacing within groups
  • Text blocks should be constrained to 45-75 characters (max-w-prose or ~65ch)
  • Forms should max out at 300-500px width
  • Full-width is almost never right for content

Product applications:

ContextSpacing StrategyExample
Icon + labelTight coupling (4px)Small gap keeps them visually connected
Form fieldsRelated elements (8-16px)Input and its label tightly coupled
Card sectionsSection separation (24px)Title block, content block, footer block
Page sectionsMajor sections (48-64px)Hero, features, testimonials, footer
Container widthConstrain to contentmax-w-prose for text, max-w-md for forms

CSS patterns:

  • p-1(4px) p-2(8px) p-4(16px) p-6(24px) p-8(32px) p-12(48px) p-16(64px)
  • max-w-prose(65ch) max-w-md(28rem) max-w-lg(32rem) max-w-xl(36rem)
  • gap-2 for related items, gap-6 for section separation

Ethical boundary: Don't use spacing to bury important UI elements like unsubscribe buttons or privacy controls.

See: references/advanced-patterns.md for responsive breakpoint strategies.

3. Typography

Core concept: Use a modular type scale, constrain line heights by context, and limit to two font families maximum.

Why it works: A modular scale (e.g., 1.25 ratio) creates natural visual rhythm. Tight line heights on headings and relaxed line heights on body text improve readability across contexts.

Key insights:

  • Use a modular scale: 12, 14, 16, 20, 24, 30, 36px (1.25 ratio)
  • Headings need tight line height (1.0-1.25); body text needs relaxed (1.5-1.75)
  • Wider text needs more line height
  • Avoid font weights below 400 for body text -- they become unreadable
  • Use bold (600-700) for emphasis, not for everything
  • Two fonts maximum: one for headings, one for body (or one family with weight variation)

Product applications:

ContextTypography RuleExample
Hero headline36px, tight line-height (1.1), boldLarge impactful statement
Section title24px, line-height 1.25, semiboldClear section demarcation
Body text16px, line-height 1.75, normal weightComfortable reading
Captions/labels12-14px, line-height 1.5, medium graySecondary information
Code/dataMonospace, 14px, consistent widthTabular data alignment

CSS patterns:

  • text-xs(12px) text-sm(14px) text-base(16px) text-lg(18px) text-xl(20px)
  • font-normal(400) font-medium(500) font-semibold(600) font-bold(700)
  • leading-tight(1.25) leading-normal(1.5) leading-relaxed(1.75)

Ethical boundary: Don't use tiny type sizes to hide terms, conditions, or fees from users.

See: references/advanced-patterns.md for text truncation and responsive typography.

4. Color

Core concept: Build a systematic palette with 5-9 shades per color, add subtle saturation to grays, and design in grayscale first.

Why it works: Random colors clash. A systematic palette with predefined shades ensures consistency across the entire interface. HSL adjustments create natural-feeling lighter and darker variants.

Key insights:

  • Each color needs 5-9 shades from near-white to near-black (50 through 900)
  • The darkest shade is not black -- use 900-level dark grays (e.g., #111827) instead of pure #000000
  • Pure grays look lifeless -- add subtle saturation (cool UI: blue tint like #64748b; warm UI: yellow/brown tint like #78716c)
  • HSL adjustments: lighter = higher lightness, lower saturation, shift hue toward 60 degrees; darker = lower lightness, higher saturation, shift hue toward 0/240 degrees
  • Body text minimum 4.5:1 contrast ratio; large text (18px+) minimum 3:1
  • Use #374151 (gray-700) on white, not lighter grays for readable text

Product applications:

ContextColor StrategyExample
Primary palette9 shades (50-900) for main brand colorBlue-500 for buttons, Blue-100 for backgrounds
Gray paletteSaturated grays matching UI temperatureCool grays with blue tint for tech products
Semantic colorsSuccess, warning, error each with shade rangeGreen-500 for success, Red-500 for errors
Text colorsThree levels: dark, medium, lighttext-gray-900, text-gray-600, text-gray-400
Accessible contrastTest all text/background combos#374151 on white = 10.5:1 ratio

CSS patterns:

  • text-gray-900(dark) text-gray-600(medium) text-gray-400(light)
  • bg-blue-50 for subtle backgrounds, bg-blue-500 for primary actions
  • border-gray-200 for subtle borders, border-gray-300 for stronger

Ethical boundary: Don't use color alone to convey information -- always pair with text or icons for accessibility.

See: references/theming-dark-mode.md for dark palette creation and theme implementation.

5. Depth & Shadows

Core concept: Use a shadow scale to convey elevation. Small shadows for slightly raised elements, large shadows for floating elements.

Why it works: Shadows create a sense of physical depth that helps users understand which elements are interactive, which are floating above the surface, and which are part of the background.

Key insights:

  • Small shadows = raised slightly (buttons, cards); large shadows = floating (modals, dropdowns)
  • Shadows have two parts: a tight, dark shadow for crispness plus a larger, softer shadow for atmosphere
  • Depth without shadows: lighter top border + darker bottom border, subtle gradient backgrounds, overlapping elements with offset
  • Don't overuse shadows -- if everything floats, nothing has depth
  • Shadow color should be transparent dark, not opaque gray

Product applications:

ContextShadow LevelExample
Buttonsshadow-sm (subtle raise)Slightly elevated above page surface
Cardsshadow-md (clear separation)Content grouped and lifted from background
Dropdownsshadow-lg (floating)Menu clearly floating above content
Modalsshadow-xl (highest elevation)Overlay clearly detached from page
Flat alternativesBorder + background shiftLighter top border, darker bottom border

CSS patterns:

  • shadow-sm: 0 1px 2px rgba(0,0,0,0.05)
  • shadow-md: 0 4px 6px rgba(0,0,0,0.1)
  • shadow-lg: 0 10px 15px rgba(0,0,0,0.1)
  • shadow-xl: 0 20px 25px rgba(0,0,0,0.15)

Ethical boundary: Don't use excessive shadows or visual emphasis to draw attention to deceptive UI elements (dark patterns).

See: references/advanced-patterns.md for interaction states and elevation hierarchy.

6. Images & Icons

Core concept: Treat images as design elements, not afterthoughts. Size icons deliberately and use overlays to ensure text readability on images.

Why it works: Poorly sized icons look awkward. Unstyled images break visual consistency. Deliberate image treatment (overlays, object-fit, border radius) makes interfaces feel polished.

Key insights:

  • Icons should be sized relative to their context -- don't use the same size everywhere
  • Use icon sets with consistent stroke width and style
  • Images need treatment: object-fit cover, consistent aspect ratios, overlays for text
  • Don't stretch or distort images -- use object-fit: cover and crop deliberately
  • Empty states are an opportunity -- use illustrations, not just text

Product applications:

ContextImage/Icon TechniqueExample
Hero imagesOverlay with semi-transparent gradientText readable over any photo
AvatarsConsistent size, rounded, fallback initials40px circle with object-fit cover
Feature iconsConsistent size, weight, and color24px stroke icons in gray-500
Empty statesCustom illustration + clear CTAFriendly illustration with "Get started" button
ThumbnailsFixed aspect ratio with object-fit cover16:9 cards with no distortion

CSS patterns:

  • object-fit: cover with fixed aspect-ratio for consistent image display
  • Icon sizing: w-4 h-4 inline, w-6 h-6 in navigation, w-8 h-8 for feature icons
  • Image overlay: bg-gradient-to-t from-black/60 to-transparent for text on images

Ethical boundary: Don't use misleading images or icons that misrepresent functionality or product capabilities.

See: references/advanced-patterns.md for image treatment, icon usage, and empty states.

7. Layout & Composition

Core concept: Don't center everything. Use alignment, overlap, and emphasis variation to create engaging compositions.

Why it works: Left-aligned text is easier to read. Varied layouts keep users engaged. Breaking out of rigid boxes makes designs feel dynamic and intentional.

Key insights:

  • Left-align text by default; center only short headlines, hero sections, single-action CTAs, and empty states
  • Cards don't need to contain everything -- let images bleed to edges, overlap containers, or extend beyond bounds
  • In lists and feeds, vary the visual treatment -- feature some items, minimize others
  • Use alignment to create visual relationships between unrelated elements
  • Alternate emphasis: not every card in a list needs the same layout

Product applications:

ContextLayout StrategyExample
Hero sectionsCentered text, generous spacingShort headline + subtext + single CTA
Feature gridsLeft-aligned text, consistent card sizes3-column grid with icon + title + description
Blog feedsVaried card sizes for emphasisFirst post large, next posts in 2-column grid
SidebarsNarrower than main content, lighter backgroundNavigation or filters at 240-320px width
Content pagesConstrained width, left-alignedmax-w-prose centered container with left text

CSS patterns:

  • text-left by default, text-center only for heroes and short headlines
  • grid grid-cols-3 gap-6 for feature grids
  • max-w-4xl mx-auto for page containers
  • overflow-hidden on cards with object-fit: cover images that bleed to edges

Ethical boundary: Don't use layout tricks to hide or obscure important user choices like opt-outs or data permissions.

See: references/advanced-patterns.md for responsive breakpoints and complex layout patterns.

Common Mistakes

MistakeWhy It FailsFix
"Looks amateur"Insufficient white space, unconstrained widthsAdd more white space, constrain content widths
"Feels flat"No depth differentiation between elementsAdd subtle shadows, border-bottom on sections
"Text is hard to read"Poor line-height, too wide, low contrastIncrease line-height, constrain width, boost contrast
"Everything looks the same"No visual hierarchy between elementsVary size/weight/color between primary and secondary
"Feels cluttered"Equal spacing everywhere, no groupingGroup related items, increase spacing between groups
"Colors clash"Random color choices without a systemReduce saturation, use more grays, limit palette to system
"Buttons don't pop"Low contrast with surrounding elementsIncrease contrast with surroundings, add shadow
Using arbitrary valuespx values like 13, 17, 23 create inconsistencyStick to the spacing and type scales

Quick Diagnostic

Audit any UI design:

QuestionIf NoAction
Does hierarchy read when squinting (blur test)?Elements competing for attentionIncrease contrast between primary and secondary
Does it work in grayscale?Relying on color for hierarchyStrengthen size/weight/spacing hierarchy
Is there enough white space?Probably not -- most designs are too denseIncrease spacing, especially between groups
Are labels de-emphasized vs. their values?Labels competing with dataMake labels smaller, lighter, or uppercase-small
Does spacing follow a consistent scale?Arbitrary spacing creates visual noiseUse 4/8/16/24/32/48/64 scale only
Is text width constrained for readability?Long lines cause reader fatigueApply max-w-prose (~65ch) to text blocks
Do colors have sufficient contrast?Accessibility failure, hard to readTest with WCAG contrast checker, use gray-700+ on white
Are shadows appropriate for elevation?Elements floating at wrong visual levelMatch shadow scale to element purpose

Reference Files

  • advanced-patterns.md: Empty states, form design, image treatment, icon sizing, interaction states, color psychology, border radius systems, text truncation, responsive breakpoints
  • animation-microinteractions.md: When to animate, easing functions, durations, loading states, animation performance
  • accessibility-depth.md: WCAG 2.1 AA checklist, focus management, screen reader support, keyboard navigation
  • data-visualization.md: Chart selection, color in charts, table design, dashboard layouts
  • theming-dark-mode.md: Dark palette creation, elevation in dark mode, theme implementation strategies

Further Reading

This skill is based on Adam Wathan and Steve Schoger's practical design guide. For the complete system with visual examples:

About the Authors

Adam Wathan is a full-stack developer and the creator of Tailwind CSS, one of the most popular utility-first CSS frameworks. Steve Schoger is a visual designer known for his practical design tips and illustrations. Together they created *Refactoring UI* to teach developers how to design better interfaces using systematic, repeatable techniques rather than relying on innate artistic talent. Their approach emphasizes constrained design systems -- fixed scales for spacing, typography, color, and shadows -- that produce professional results without requiring a design background.

平台分布

Codex

34.77%
按下载量换算6,590

Claude

30.97%
按下载量换算5,869

Cursor

21.19%
按下载量换算4,016

Gemini CLI

9.72%
按下载量换算1,842

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills