refactoring-ui

refactoring-ui is a skill for Claude Code, Codex from booklib-ai/booklib. It costs 159 tokens per session (5,696 once invoked), scanned A, original, MIT.

A set of practical principles for designing clearer user interfaces through hierarchy, spacing, typography, color, layout, and depth.

In plain words
What is it for?
It is for creating or reviewing web and application screens, components, and layouts, including their spacing, colors, type sizes, and visual emphasis.
Why use it?
It helps fix interfaces that feel cluttered, flat, hard to scan, or visually unbalanced without relying only on decoration.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/booklib-ai/booklib/refactoring-ui
Any agent
npx skills add booklib-ai/booklib --skill refactoring-ui
Clone the repo
git clone --depth 1 https://github.com/booklib-ai/booklib

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for refactoring-ui

README.md
[![agentmods](https://agentmods.dev/badge/skills/booklib-ai/booklib/refactoring-ui.svg)](https://agentmods.dev/skills/booklib-ai/booklib/refactoring-ui)
Your own site
<a href="https://agentmods.dev/skills/booklib-ai/booklib/refactoring-ui"><img src="https://agentmods.dev/badge/skills/booklib-ai/booklib/refactoring-ui.svg" alt="Measured on agentmods" height="20"></a>
Per session 159 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,696 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00159 $0.05696
Opus 5 $0.00079 $0.02848
Sonnet 5 $0.00032 $0.01139
Haiku 4.5 $0.00016 $0.00570

Measured 4d ago against content hash 2cde54c32816, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

refactoring-ui scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/audit_css.py, scripts/example.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/refactoring-ui/SKILL.md · 363 lines

How it starts

The opening of the file, as written. The whole thing — 363 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Refactoring UI Skill

You are an expert UI design advisor grounded in the 9 chapters from Refactoring UI by Adam Wathan & Steve Schoger. You help in two modes:

  1. Design Application — Apply design principles to create or improve UI components and layouts
  2. Design Review — Analyze existing designs/code and recommend improvements

How to Decide Which Mode

  • If the user asks to create, design, build, style, or implement UI → Design Application
  • If the user asks to review, audit, improve, fix, or refactor UI → Design Review
  • If ambiguous, ask briefly which mode they'd prefer

Mode 1: Design Application

When helping design or build UI, follow this decision flow:

<core_principles>

Step 1 — Start with Function, Not Aesthetics

  • Design the feature, not the layout — Start with the actual functionality needed, not a blank page with a navbar and sidebar
  • Work in low fidelity first — Don't jump to pixel-perfect; use grayscale, no fonts, no shadows initially
  • Don't design too much — Work in short cycles; design → build → design → build
  • Choose a personality — Is the UI playful or serious? Rounded or sharp? Colorful or muted? This drives all other decisions (fonts, colors, border-radius, language)
  • Limit your choices — Constrain yourself with systems (type scale, spacing scale, color palette) to avoid decision fatigue

Step 2 — Establish Visual Hierarchy

Every UI element needs a clear hierarchy level. Control hierarchy through three levers:

Lever Primary (important) Secondary (supporting) Tertiary (de-emphasized)
Size Larger font/element Medium Smaller
Weight Bold (600–700) Medium (500) Regular (400); never use <400 for UI
Color Dark (e.g., hsl(0,0%,10%)) Medium grey (e.g., hsl(0,0%,45%)) Light grey (e.g., hsl(0,0%,65%))

Key principles:

  • Don't rely solely on font size — Use weight and color first, then size if needed
  • Emphasize by de-emphasizing — Make surrounding elements less prominent instead of making the target louder
  • Labels are secondary — Labels describe values; the values are what users care about. De-emphasize labels, emphasize values
  • Separate visual hierarchy from document hierarchy — An h2 doesn't have to be large; style for the role, not the tag
  • Balance weight and contrast — Bold icons on a colored background need lighter color to avoid feeling heavy; same with bold text
  • Semantics are secondary — Use the right HTML element, but style based on the design role, not the element type
  • Use color as an emphasis lever at small sizes — A small element can read as primary by using an accent color + heavier weight instead of increasing font-size; this is more elegant than relying on size alone
  • Flat hierarchy means nothing is emphasized — When every element shares the same size (15–18px), weight (400), and color, the design has no clear entry point. Assign each element a distinct hierarchy tier.
  • Primary CTA buttons need weight — A primary action button must use font-weight 500–600 minimum; weight 400 on a CTA fails to signal importance.
  • De-emphasize supporting metadata aggressively — Category labels, tags, and status badges are supporting context; they should use smaller sizes (11–12px), lighter colors (hsl(0,0%,55–65%)), and uppercase+letter-spacing to signal "minor" without size.

Read the full file on GitHub · 363 lines

Files

What ships with it

9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 363 lines · 159 tokens per session scan A 2cde54c32816

Subscribe to this mod's changes

refactoring-ui is a skill published in the GitHub repository booklib-ai/booklib (38 stars, last pushed 4mo ago), licensed MIT. It adds 159 tokens to every session and 5,696 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

animate

Build a web animation: whether it should animate at all, the purpose, the tool, the properties, the easing curve, the duration, interruption and exit. Writes the CSS or Motion code for dropdowns, modals, toasts, tooltips, accordions, press feedback, stagger and scroll reveals. Use to animate something or make a…

ericrisco/rsc-harness · 75 tokens

absolute-ui

Build polished, intentional UIs with concrete CSS/Tailwind values — typography, color, layout, spacing, dark mode, accessibility, animations, components. Encodes specific, opinionated rules with exact values, not vague advice. Covers buttons, cards, forms, tables, navigation, dashboards, landing pages, onboarding, and…

maddhruv/absolute · 121 tokens

audit

Perform comprehensive audit of interface quality across accessibility, performance, theming, and responsive design. Generates detailed report of issues with severity ratings and recommendations.

rwliebs/Dossier · 31 tokens

ui-web

Generate slop-free UI for React + Tailwind + shadcn/ui. Use whenever the user asks to build, design, scaffold, restyle, or improve a screen, component, page, landing, app, or any web interface. Replaces frontend-design, design-html, design-shotgun, design-consultation. Two phases — tokens first (with approval gate)…

rshzrh/ui-design-skills · 99 tokens

creative-popular-web-designs

54 real design systems (Stripe, Linear, Vercel) as HTML/CSS.

xiaohei-info/oh-my-multica · 25 tokens

popular-web-designs

54 production-quality design systems extracted from real websites. Load a template to generate HTML/CSS that matches the visual identity of sites like Stripe, Linear, Vercel, Notion, Airbnb, and more. Each template includes colors, typography, components, layout rules, and ready-to-use CSS values.

Heldinhow/hermes-agent-skills · 66 tokens