MCPInstall

tailwind-ui-refactor

Refactoring UI design patterns for Tailwind CSS applications. This skill should be used when writing, reviewing, or refactoring HTML with Tailwind utility classes to improve visual hierarchy, spacing, typography, color, depth, and polish. Triggers on tasks involving UI cleanup, design review, Tailwind refactoring, component styling, or visual improvements.

Installs
461
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/pproenca/dot-skills --skill tailwind-ui-refactor
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads tailwind-ui-refactor automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Refactoring UI Tailwind CSS Best Practices

Comprehensive UI refactoring guide based on Refactoring UI by Adam Wathan & Steve Schoger, implemented with Tailwind CSS utility classes. Contains 52 rules across 9 categories, prioritized by design impact to guide automated refactoring and code generation. Uses Tailwind CSS v4 syntax (v3 notes provided where syntax differs).

Important: Think first, style second. Before applying any visual rule, understand the UI's purpose, identify what matters to the user, and remove unnecessary elements. The Design Intent category (priority 1) must be considered before any styling changes. A simpler component with fewer elements always beats a decorated component with unnecessary markup.

When to Apply

Reference these guidelines when:

  • Refactoring existing Tailwind CSS components
  • Writing new UI with Tailwind utility classes
  • Reviewing code for visual hierarchy and spacing issues
  • Improving design quality without a designer
  • Fixing accessibility contrast problems

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Design IntentCRITICALintent-
2Visual HierarchyCRITICALhier-
3Layout & SpacingCRITICALspace-
4TypographyHIGHtype-
5Color SystemsHIGHcolor-
6Depth & ShadowsMEDIUMdepth-
7Borders & SeparationMEDIUMsep-
8Images & ContentLOW-MEDIUMimg-
9Polish & DetailsLOWpolish-

Quick Reference

1. Design Intent (CRITICAL)

  • intent-audit-before-styling - Audit what each element communicates before changing any CSS
  • intent-remove-before-decorating - Remove unnecessary elements before styling what remains
  • intent-reduce-cognitive-load - Reduce choices per screen — fewer options beat prettier options
  • intent-progressive-disclosure - Hide secondary information behind interactions
  • intent-content-drives-layout - Let real content determine layout — not the other way around
  • intent-simplify-over-decorate - Prefer removing a wrapper over adding 5 utility classes to it
  • intent-match-context-fidelity - Match design polish to context — admin vs consumer vs product
  • intent-match-existing-patterns - Audit sibling component patterns before restyling

2. Visual Hierarchy (CRITICAL)

  • hier-size-weight-color - Use size, weight, and color for hierarchy — not just size
  • hier-deemphasize-secondary - De-emphasize secondary content instead of emphasizing primary
  • hier-button-hierarchy - Style buttons by visual hierarchy, not semantic importance
  • hier-label-value-pairs - Combine labels and values into natural language
  • hier-semantic-vs-visual - Separate visual hierarchy from document hierarchy
  • hier-icon-sizing - Size icons relative to adjacent text, not to fill space
  • hier-color-hierarchy-on-dark - Use opacity or muted colors for hierarchy on colored backgrounds

3. Layout & Spacing (CRITICAL)

  • space-start-generous - Start with too much whitespace, then remove
  • space-systematic-scale - Use a constrained spacing scale, not arbitrary values
  • space-relationship-proximity - Use spacing to show relationships between elements
  • space-dont-fill-screen - Constrain content width — avoid filling the whole screen
  • space-grids-not-required - Use fixed widths when grids are not needed
  • space-relative-sizing-fails - Avoid raw viewport units without clamping
  • space-mobile-first - Design mobile-first at ~400px, then expand

4. Typography (HIGH)

  • type-line-length - Keep line length between 45-75 characters
  • type-line-height-inverse - Line height and font size are inversely proportional
  • type-font-weight-variety - Choose fonts with at least 5 weight variations
  • type-no-center-long-text - Left-align body content — avoid centering long-form text
  • type-letter-spacing - Tighten letter spacing for headlines, loosen for uppercase
  • type-align-numbers-right - Align numbers right in tables for easy comparison

5. Color Systems (HIGH)

  • color-define-palette-upfront - Define a complete color palette upfront — don't pick colors ad-hoc
  • color-grayscale-first - Design in grayscale first, add color last
  • color-accessible-contrast - Ensure 4.5:1 contrast ratio for body text
  • color-dark-gray-not-black - Use dark gray instead of pure black for text
  • color-saturated-grays - Add subtle saturation to grays for warmth or coolness
  • color-light-backgrounds-dark-text - Use light-colored backgrounds with dark text for badges

6. Depth & Shadows (MEDIUM)

  • depth-shadow-scale - Define a fixed shadow scale — small to extra large
  • depth-shadow-vertical-offset - Use vertical offset for natural-looking shadows
  • depth-interactive-elevation - Use shadow changes to communicate interactivity
  • depth-light-closer-dark-recedes - Lighter colors feel closer, darker colors recede
  • depth-overlap-layers - Overlap elements to create visual layers

7. Borders & Separation (MEDIUM)

  • sep-fewer-borders - Use fewer borders — replace with spacing, shadows, or background color
  • sep-background-color-separation - Use background color differences to separate sections
  • sep-table-spacing-not-lines - Use spacing instead of lines in simple tables
  • sep-card-radio-buttons - Upgrade radio buttons to selectable cards for key choices

8. Images & Content (LOW-MEDIUM)

  • img-control-user-content - Control user-uploaded image size and aspect ratio
  • img-text-overlay - Add overlays or reduce contrast for text over images
  • img-dont-scale-up-icons - Avoid scaling up icons designed for small sizes
  • img-empty-states - Design meaningful empty states with clear CTAs

9. Polish & Details (LOW)

  • polish-accent-borders - Add accent borders to highlight important elements
  • polish-custom-bullets - Replace default bullets with icons or checkmarks
  • polish-border-radius-personality - Match border radius to brand personality
  • polish-gradient-close-hues - Use gradients with hues within 30 degrees of each other
  • polish-inner-shadow-images - Add inner shadow to prevent image background bleed

Scope & Limitations

This skill covers layout, hierarchy, spacing, color, and polish based on Refactoring UI principles. It does NOT cover:

  • Font selection & pairing — choosing distinctive typefaces, avoiding generic AI defaults (Inter, Arial, system-ui), or pairing display + body fonts
  • Animation & motion — meaningful transitions, micro-interactions, page load sequences, or scroll-triggered reveals
  • Creative direction — establishing an aesthetic vision, choosing a tone (minimal, maximalist, brutalist, etc.), or differentiating from generic "AI slop" aesthetics
  • Spatial composition — asymmetric layouts, grid-breaking elements, or unconventional visual flow

For these concerns, pair this skill with a design-thinking or frontend-design skill that covers creative direction and aesthetic execution.

How to Use

Read individual reference files for detailed explanations and code examples:

  • Section definitions - Category structure and impact levels
  • Rule template - Template for adding new rules

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

FAQ

What does the tailwind-ui-refactor skill do?

Refactoring UI design patterns for Tailwind CSS applications. This skill should be used when writing, reviewing, or refactoring HTML with Tailwind utility classes to improve visual hierarchy, spacing, typography, color, depth, and polish. Triggers on tasks involving UI cleanup, design review, Tailwind refactoring, component styling, or visual improvements.

How do I install tailwind-ui-refactor?

Run npx skills add https://github.com/pproenca/dot-skills --skill tailwind-ui-refactor in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/tailwind-ui-refactor/ (personal) or .claude/skills/tailwind-ui-refactor/ (project).

Which AI agents can use tailwind-ui-refactor?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is tailwind-ui-refactor safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains tailwind-ui-refactor?

It is published by pproenca in pproenca/dot-skills. It has 461 recorded installs.

More from pproenca/dot-skills

View all →

zod

pproenca/dot-skills

Zod schema validation best practices for type safety, parsing, and error handling. This skill should be used when defining z.object schemas, using z.string validations, safeParse, or z.infer. This skill does NOT cover React Hook Form integration patterns (use react-hook-form skill) or OpenAPI client generation (use orval skill).

Frontend & Design7.1K installs

vitest

pproenca/dot-skills

Vitest testing framework patterns for test setup, async testing, mocking with vi., snapshots, and test performance (formerly test-vitest). This skill should be used when writing or debugging Vitest tests. This skill does NOT cover TDD methodology (use test-tdd skill), API mocking with MSW (use test-msw skill), or Jest-specific APIs.

Testing & QA6.2K installs

react-hook-form

pproenca/dot-skills

React Hook Form performance optimization for client-side form validation using useForm, useWatch, useController, useFieldArray, the subscribe() API, and the Watch / FormStateSubscribe / FieldArray render-prop components. Covers RHF 7.82 additions including resetDefaultValues() and the disabled field-array option. This skill should be used when building client-side controlled forms with React Hook Form library. This skill does NOT cover React 19 Server Actions, useActionState, or server-side form handling (use react-19 skill for those).

emilkowal-animations

pproenca/dot-skills

Emil Kowalski's animation best practices for web interfaces. Use when writing, reviewing, or implementing animations in React, CSS, or Framer Motion. Triggers on tasks involving transitions, easing, gestures, toasts, drawers, or motion.

Frontend & Design2.8K installs

nuqs

pproenca/dot-skills

nuqs (type-safe URL query state) best practices for Next.js and other React frameworks. This skill should be used when writing, reviewing, or refactoring code that uses nuqs for URL state management. Triggers on tasks involving useQueryState, useQueryStates, search params, URL state, query parameters, nuqs parsers, limitUrlUpdates, Standard Schema, NuqsAdapter, or Next.js routing with state.

Frontend & Design2.3K installs

clean-architecture

pproenca/dot-skills

Clean Architecture principles and best practices from Robert C. Martin's book. This skill should be used when designing software systems, reviewing code structure, or refactoring applications to achieve better separation of concerns. Triggers on tasks involving layers, boundaries, dependency direction, entities, use cases, or system architecture.

Popular frontend & design skills

View category →

setup-matt-pocock-skills

mattpocock/skills

Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.

Frontend & Design1.1M installs

frontend-design

anthropics/skills

Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.

OfficialFrontend & Design1M installs

hyperframes-animation

heygen-com/hyperframes

All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.

prototype

mattpocock/skills

Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.

Frontend & Design999.2K installs

hyperframes-core

heygen-com/hyperframes

The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.

Frontend & Design930.5K installs

vercel-react-best-practices

vercel-labs/agent-skills

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

OfficialFrontend & Design843.1K installs