
Refactoring UI
Skill按《Refactoring UI》书中的具体规则设计和改进界面:间距、字号、颜色、阴影都从事先定好的刻度里取值,用字重与颜色而不是字号建立层级,用模拟光源营造层次;适合界面看着不对劲、显得业余或杂乱时使用。
Refactoring UI (Claude Code skill)
A Claude Code skill that teaches Claude the concrete, mechanical rules from the book Refactoring UI by Adam Wathan and Steve Schoger — constrained spacing/type/color/shadow scales, visual hierarchy through weight and color rather than size, and depth through emulated light.
Every rule and CSS value in this skill was cross-checked page-by-page against the book. It's not a summary — it's the book's decisions, made once, ready to apply.
What it does
Load this skill and Claude will, when styling or reviewing UI:
- Pick spacing, type sizes, weights, colors, shadows and radii from fixed scales instead of ad hoc values
- Build hierarchy through weight/color rather than piling on font-size
- Diagnose vague complaints ("looks off", "feels cheap") into specific, mechanical fixes
- Apply concrete techniques for depth, contrast, images, and breaking generic component shapes
It does not include the book itself — see Credits.
Repo structure
SKILL.md the skill: systems, procedure, hierarchy, hard rules
references/
systems.md building a color palette from scratch (HSL, saturation, hue rotation)
diagnose.md symptom -> fix table, for improving existing UI
techniques.md depth/light simulation, typefaces, grids, images
assets/
tokens.css a complete, contrast-verified starter token set
Installation
Claude Code loads skills from a folder containing a SKILL.md. Clone this repo into one
of the skill directories below — use the folder name refactoring-ui so it matches
the skill's declared name.
Personal skill (available in every project)
git clone https://github.com/<you>/refactoring-ui-skill.git ~/.claude/skills/refactoring-ui
Project skill (checked into a specific repo, shared with your team)
git clone https://github.com/<you>/refactoring-ui-skill.git .claude/skills/refactoring-ui
(Or add it as a git submodule at that path if you want to track updates.)
Restart Claude Code (or start a new session) after installing so it picks up the new skill.
Usage
The skill activates automatically whenever Claude is building or styling UI, picking font sizes/spacing/colors/shadows, designing a palette or design tokens, or when you say a UI "looks off", "looks amateur", or "feels cluttered/plain/unfinished." You can also invoke it explicitly:
/refactoring-ui make this dashboard look less amateur
Credits
All design rules and reasoning are drawn from Refactoring UI by Adam Wathan and Steve Schoger. This repo does not include the book's text or images — only original notes and CSS derived from its concepts. If you find this useful, buy the book: https://www.refactoringui.com/
License
MIT for the contents of this repo (see LICENSE). Does not extend to the book itself.
相关资源

Tailwind CSS
Skill用 Tailwind CSS 实现界面的通用指南:响应式与状态变体、深色模式、克制使用任意值、优先拆组件再用 @apply,以及动态拼接类名导致生产环境缺样式等常见问题,附按钮与首屏版式示例。
MengTo/Skills7.3k
Beautiful Shadows
Skill提供 sm、md、lg 三档现成的 Tailwind 任意值阴影类,用于卡片、表单控件、浮层、主视觉等表面,做出分层的中性灰阴影,并规定不与默认阴影混用、不染色、不叠加多个阴影。
MengTo/Skills7.2k
Progressive Blur
Skill用多层 backdrop-filter 与渐变遮罩在页面顶部或底部做出由弱到强的渐进模糊,提供可直接粘贴的 HTML 与 CSS,可调整高度、模糊层级、方向与 z-index,且不拦截点击。
MengTo/Skills7.2k
Container Lines
Skill在页面内容容器左右边缘画 1px 低透明度的竖向参考线,并在区块角落加小方块,营造精确、有结构感的版式;提供 CSS 变量与伪元素写法,参考线不拦截点击与选中。
MengTo/Skills7.2k
OKLCH Colors
Skill在网页项目中使用 OKLCH 色彩空间:把 hex、rgb、hsl 转成 oklch,生成没有色相漂移的色阶与暗色模式配色,用 APCA 或 WCAG 检查对比度并只调亮度来修正,处理 P3 色域与 sRGB 回退,以及 Tailwind v4 的 @theme 配置;修改结果以前后对照表呈现。
jakubkrehel/oklch-skill280
Neo Industrial Design
Skill按新工业、编辑式粗野主义风格设计或改造网页界面:先定模式、主视觉动作、网格与单一强调色,再从宏观到细节确定版式、字体层级与图形元素,保留语义 HTML、键盘操作与对比度,并在宽屏与手机宽度下检查渲染效果。只用于明确要求这种风格时。
elithrar/dotfiles223