MCP HubMCP Hub
SKILL·235899

refactoring-ui

wondelai
업데이트됨 15 days ago
6 조회
2,020
206
2,020
GitHub에서 보기
메타aiautomationdesigndata

정보

이 스킬은 웹 UI의 시각적 디자인 문제를 감사하고 수정하며, 계층 구조, 간격, 색상, 깊이에 중점을 둡니다. 컴포넌트 스타일링을 다듬거나, 디자인 시스템을 구축하거나, 어색해 보이는 레이아웃을 교정할 때 사용하세요. 제한된 디자인 스케일, 다크 모드 테마, 그리고 그레이스케일 우선 워크플로우를 구현하는 실용적인 지침을 제공합니다.

빠른 설치

Claude Code

추천
기본
npx skills add wondelai/skills -a claude-code
플러그인 명령대체
/plugin add https://github.com/wondelai/skills
Git 클론대체
git clone https://github.com/wondelai/skills.git ~/.claude/skills/refactoring-ui

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

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 talent — it's about systems. Constrained scales for spacing, type, color, and shadows produce consistently professional results. Start with too much white space and remove; leave details (icons, shadows, micro-interactions) until layout and hierarchy work.

Scoring

Goal: 10/10. Score by counting satisfied rows in the Quick Diagnostic (8 yes/no checks): score = round(satisfied / 8 × 10). Bands follow directly: 10 = all 8 pass (hierarchy reads blurred and in grayscale, every value on a scale); 9 = exactly 1 gap (usually weak hierarchy or thin white space); 6-8 = 2-3 gaps; <=5 = 4+ gaps (arbitrary spacing, color doing the work hierarchy should, or failing contrast). Always state the current score and the specific diagnostic rows to fix 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; deliberately de-emphasizing 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
  • Labels are secondary — form labels, table headers, and metadata support the data, not compete with it; make them smaller, lighter, or uppercase-small
  • Semantic color ≠ visual weight — a muted secondary button often beats screaming red for routine destructive actions

Product applications:

ContextHierarchy TechniqueExample
Form fieldsDe-emphasize labels, emphasize valuesSmall uppercase label above large value
DashboardsKey metric large, context small"$42,300" large, "vs last month" small
TablesDe-emphasize headers, emphasize dataHeaders uppercase small gray, data normal

Design patterns:

  • Three-level hierarchy: Size (large/base/small), Weight (bold/medium/normal), Color (dark/medium/light gray)
  • 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 when designing components beyond static layout — interaction/hover/focus states, form design, empty states, border-radius systems, text truncation, and responsive breakpoints.

2. Spacing & Sizing

Core concept: Use a constrained spacing scale, not arbitrary values. Spacing defines relationships — closer elements read as more related.

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

Key insights:

  • Use the 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 must exceed spacing within groups
  • Constrain widths: text to 45-75 characters (max-w-prose), forms to 300-500px; full-width is almost never right

Product applications:

ContextSpacing StrategyExample
Icon + labelTight coupling (4px)Small gap keeps them connected
Card sectionsSection separation (24px)Title, content, footer blocks
Page sectionsMajor sections (48-64px)Hero, features, testimonials

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

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 (steps growing ~1.2× each) creates natural visual rhythm; tight line heights on headings and relaxed on body text improve readability in each context.

Key insights:

  • Scale: 12, 14, 16, 18, 20, 24, 30, 36px (~1.2 modular, hand-tuned)
  • Headings: tight line height (1.0-1.25); body: relaxed (1.5-1.75); wider text needs more line height
  • Avoid weights below 400 for body text; use bold (600-700) for emphasis, not everything
  • Two fonts max: one for headings, one for body (or one family with weight variation)

Product applications:

ContextTypography RuleExample
Hero headline36px, line-height 1.1, boldLarge impactful statement
Body text16px, line-height 1.75, normalComfortable reading
Captions/labels12-14px, line-height 1.5, medium graySecondary information

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)

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 predefined shade system ensures consistency, and HSL adjustments create natural-feeling lighter and darker variants.

Key insights:

  • Each color needs 5-9 shades from near-white to near-black (50-900); darkest is not pure black — use #111827, not #000000
  • Pure grays look lifeless — tint them (cool UI: blue like #64748b; warm UI: yellow/brown like #78716c)
  • HSL: lighter = raise lightness, lower saturation, hue toward 60°; darker = the reverse, hue toward 0°/240°
  • Contrast minimums: 4.5:1 body text, 3:1 large text (18px+); use #374151 (gray-700) on white, not lighter grays

Product applications:

ContextColor StrategyExample
Primary palette9 shades (50-900) of brand colorBlue-500 buttons, Blue-100 backgrounds
Semantic colorsSuccess/warning/error with shade rangesGreen-500 success, Red-500 errors
Text colorsThree levels: dark, medium, lighttext-gray-900, text-gray-600, text-gray-400

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

See references/theming-dark-mode.md when building a dark theme — hex shade scales, why darkest is #111827 not black (halation), and conveying elevation via lightness instead of shadow. See references/accessibility-depth.md when contrast, focus rings, keyboard nav, or screen-reader support is in scope — full WCAG 2.1 AA checklist and fixes.

5. Depth & Shadows

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

Why it works: The eye reads shadow size as height above the page; a consistent scale makes elevation legible, so users intuit what's interactive, floating, or background.

Key insights:

  • Small shadows = raised slightly (buttons, cards); large = floating (modals, dropdowns)
  • Good shadows have two parts: a tight dark shadow for crispness plus a larger soft one for atmosphere
  • Depth without shadows: lighter top border + darker bottom border, subtle gradients, overlapping elements
  • Don't overuse — if everything floats, nothing has depth; shadow color is transparent dark, never opaque gray

Product applications:

ContextShadow LevelExample
Buttonsshadow-sm (subtle raise)Slightly elevated above surface
Dropdownsshadow-lg (floating)Menu clearly above content
Modalsshadow-xl (highest)Overlay detached from page

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)

See references/animation-microinteractions.md when adding motion to interactive elements — durations, easing curves, loading states, and the prefers-reduced-motion rule.

6. Images & Icons

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

Why it works: Poorly sized icons look awkward and unstyled images break consistency; deliberate treatment (overlays, object-fit, radius) makes interfaces feel polished.

Key insights:

  • Size icons relative to context; use sets with consistent stroke width and style
  • Never stretch or distort — use object-fit: cover with fixed aspect ratios and crop deliberately
  • Text over images needs an overlay (semi-transparent gradient)
  • Empty states are an opportunity — use illustrations plus a clear CTA, not just text

Product applications:

ContextImage/Icon TechniqueExample
Hero imagesSemi-transparent gradient overlayText readable over any photo
AvatarsConsistent size, rounded, fallback initials40px circle, object-fit cover
Empty statesCustom illustration + CTAFriendly illustration with "Get started"

CSS patterns:

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

7. Layout & Composition

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

Why it works: A consistent left edge gives the eye a fixed return point per line, so it costs less to scan; centered multi-line text moves that edge every line and slows reading.

Key insights:

  • Left-align by default; center only short headlines, heroes, single-action CTAs, and empty states
  • Cards don't need to contain everything — let images bleed to edges or overlap containers
  • Vary visual treatment in lists and feeds — feature some items, minimize others
  • Use alignment to create relationships between unrelated elements

Product applications:

ContextLayout StrategyExample
Hero sectionsCentered text, generous spacingShort headline + subtext + single CTA
Blog feedsVaried card sizes for emphasisFirst post large, rest in 2-column grid
Content pagesConstrained width, left-alignedmax-w-prose 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

See references/data-visualization.md when laying out charts, tables, or dashboards — chart-type selection, color use in charts, table density, and dashboard composition.

Common Mistakes

MistakeWhy It FailsFix
"Looks amateur"Insufficient white space, unconstrained widthsMore white space, constrain content widths
"Feels flat"No depth differentiationSubtle 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 hierarchyVary size/weight/color between primary and secondary
"Feels cluttered"Equal spacing everywhereGroup related items, larger gaps between groups
"Colors clash"Random choices, no systemReduce saturation, more grays, limit to palette
"Buttons don't pop"Low contrast with surroundingsIncrease contrast, add shadow
Arbitrary valuespx values like 13, 17, 23 breed inconsistencyStick to the spacing and type scales

Quick Diagnostic

Audit any UI design:

QuestionIf NoAction
Does hierarchy read when squinting (blur test)?Elements competingIncrease primary/secondary contrast
Does it work in grayscale?Color is a crutchStrengthen 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. values?Labels competing with dataSmaller, lighter, or uppercase-small labels
Does spacing follow a consistent scale?Arbitrary spacing = visual noiseUse 4/8/16/24/32/48/64 only
Is text width constrained?Long lines fatigue readersApply max-w-prose (~65ch)
Do colors have sufficient contrast?Accessibility failureWCAG-check; use gray-700+ on white
Are shadows appropriate for elevation?Elements float at wrong levelMatch shadow scale to element purpose

Further Reading

For the complete system with visual before/after examples:

About the Authors

Adam Wathan, creator of Tailwind CSS, and Steve Schoger, the visual designer behind its design language, wrote Refactoring UI to teach developers systematic, repeatable design techniques. Their approach replaces artistic talent with constrained systems — fixed scales for spacing, typography, color, and shadows — that produce professional results.

GitHub 저장소

wondelai/skills
경로: plugins/ux-design/skills/refactoring-ui
0
agent-skillsai-skillsbusinessclaude-codeclaude-code-marketplaceclaude-code-plugin
FAQ

자주 묻는 질문

refactoring-ui Skill이란 무엇인가요?

refactoring-ui은(는) wondelai이(가) 만든 Claude Skill입니다. Skill은 Claude가 필요할 때 불러오는 지침과 리소스를 묶어 추가 프롬프트 없이 refactoring-ui 관련 작업을 수행할 수 있게 합니다.

refactoring-ui은(는) 어떻게 설치하나요?

이 페이지의 설치 명령을 사용하세요. refactoring-ui을(를) Claude Code 플러그인으로 추가하거나 저장소를 skills 디렉터리에 복제한 다음 Claude를 다시 시작해 Skill을 불러옵니다.

refactoring-ui은(는) 어떤 카테고리에 속하나요?

refactoring-ui은(는) 메타 카테고리에 속합니다.

refactoring-ui은(는) 무료로 사용할 수 있나요?

네. refactoring-ui은(는) AIMCP에 등록되어 있으며 무료로 설치할 수 있습니다.

연관 스킬

content-collections
메타

이 스킬은 콘텐츠 콜렉션(Content Collections)을 위한 프로덕션 검증된 설정을 제공합니다. 콘텐츠 콜렉션은 Markdown/MDX 파일을 Zod 검증이 포함된 타입 안전한 데이터 콜렉션으로 변환해주는 TypeScript 최우선 도구입니다. 블로그, 문서 사이트 또는 콘텐츠 중심의 Vite + React 애플리케이션을 구축할 때 타입 안전성과 자동 콘텐츠 검증을 보장하기 위해 사용하세요. Vite 플러그인 구성과 MDX 컴파일부터 배포 최적화 및 스키마 검증에 이르기까지 모든 것을 다룹니다.

스킬 보기
polymarket
메타

이 스킬은 개발자들이 Polymarket 예측 시장 플랫폼을 활용한 애플리케이션을 구축할 수 있도록 지원하며, 거래 및 시장 데이터를 위한 API 통합 기능을 포함합니다. 또한 WebSocket을 통한 실시간 데이터 스트리밍을 제공하여 실시간 거래와 시장 활동을 모니터링할 수 있습니다. 이를 통해 거래 전략을 구현하거나 실시간 시장 업데이트를 처리하는 도구를 생성하는 데 활용할 수 있습니다.

스킬 보기
creating-opencode-plugins
메타

이 스킬은 개발자들이 명령어, 파일, LSP 작업 등 25개 이상의 이벤트 유형에 연결되는 OpenCode 플러그인을 만들 수 있도록 돕습니다. JavaScript/TypeScript 모듈을 위한 플러그인 구조, 이벤트 API 명세, 구현 패턴을 제공합니다. OpenCode AI 어시스턴트의 라이프사이클을 사용자 정의 이벤트 기반 로직으로 가로채거나, 모니터링하거나, 확장해야 할 때 사용하세요.

스킬 보기
sglang
메타

SGLang은 RadixAttention 프리픽스 캐싱을 활용하여 JSON, 정규식, 에이전트 워크플로우를 위한 고속 구조화 생성에 특화된 고성능 LLM 서빙 프레임워크입니다. 특히 반복되는 프리픽스가 있는 작업에서 상당히 빠른 추론 속도를 제공하여 복잡한 구조화 출력 및 다중 턴 대화에 이상적입니다. 제약 디코딩이 필요하거나 광범위한 프리픽스 공유가 있는 애플리케이션을 구축할 때는 vLLM과 같은 대안보다 SGLang을 선택하십시오.

스킬 보기