refactoring-ui
Audit and fix visual hierarchy, spacing, color, and depth in web UIs. Use when the user mentions "my UI looks off", "fix the design", "Tailwind styling", "color palette", "visual hierarchy", "design system", "spacing scale", or "component styling". Also trigger when building consistent design tokens, creating dark mode themes, improving data visualization clarity, or polishing UI details before launch. Covers grayscale-first workflow, constrained design scales, shadows, and component styling. For typeface selection, see web-typography. For usability audits, see ux-heuristics.
What this skill does
# 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:** | Context | Hierarchy Technique | Example | |---------|---------------------|---------| | **Form fields** | De-emphasize labels, emphasize values | Small uppercase label above large value text | | **Navigation** | Primary nav bold, secondary nav lighter | Active link in dark gray-900, inactive in gray-500 | | **Cards** | Title large, metadata small and light | Card title 20px bold, date 12px gray-400 | | **Dashboards** | Key metric large, context small | Revenue "$42,300" large, "vs last month" small | | **Tables** | De-emphasize headers, emphasize cell data | Headers 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](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:** | Context | Spacing Strategy | Example | |---------|-----------------|---------| | **Icon + label** | Tight coupling (4px) | Small gap keeps them visually connected | | **Form fields** | Related elements (8-16px) | Input and its label tightly coupled | | **Card sections** | Section separation (24px) | Title block, content block, footer block | | **Page sections** | Major sections (48-64px) | Hero, features, testimonials, footer | | **Container width** | Constrain to content | `max-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](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:** | Context | Typography Rule | Example | |---------|----------------|---------| | **Hero headline** | 36px, tight line-height (1.1), bold | Large impactful statement | | **Section title** | 24px, line-height 1.25, semibold | Clear section demarcation | | **Body text** | 16px, line-height 1.75, normal weight | Comfortable reading | | **Captions/labels** | 12-14px, line-height 1.5, medium gray | Secondary information | | **Code/data** | Monospace, 14px, consistent width | Tabular 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](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:** | Context | Color Strategy | Example | |---------|---------------|---------| | **Primary palette** | 9 shades (50-900) for main brand color | Blue-500 for buttons, Blue-100 for backgrounds | | **Gray palette** | Saturated grays matching UI temperature | Cool gra
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.