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

Written for no agent in particular: nothing here depends on one.

Good fit It is for creating or reviewing web and application screens, components, and layouts, including their spacing, colors, type sizes, and visual emphasis.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/booklib-ai/booklib/refactoring-ui
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.

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for refactoring-ui

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00159 $0.05696
Opus 5.5 $0.00064 $0.02278
Sonnet 5.5 $0.00032 $0.01139
Haiku 4.5 $0.00016 $0.00570

Measured 1mo ago against content hash 2cde54c32816, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 (39 stars, last pushed 6mo ago), licensed MIT. It adds 159 tokens to every session and 5,696 once invoked, about $0.0006 per session on Opus 5.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.