tailwind-ui-refactor▌
pproenca/dot-skills · updated Apr 8, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
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).
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
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Design Intent | CRITICAL | intent- |
| 2 | Visual Hierarchy | CRITICAL | hier- |
| 3 | Layout & Spacing | CRITICAL | space- |
| 4 | Typography | HIGH | type- |
| 5 | Color Systems | HIGH | color- |
| 6 | Depth & Shadows | MEDIUM | depth- |
| 7 | Borders & Separation | MEDIUM | sep- |
| 8 | Images & Content | LOW-MEDIUM | img- |
| 9 | Polish & Details | LOW | polish- |
Quick Reference
1. Design Intent (CRITICAL)
intent-audit-before-styling- Audit what each element communicates before changing any CSSintent-remove-before-decorating- Remove unnecessary elements before styling what remainsintent-reduce-cognitive-load- Reduce choices per screen — fewer options beat prettier optionsintent-progressive-disclosure- Hide secondary information behind interactionsintent-content-drives-layout- Let real content determine layout — not the other way aroundintent-simplify-over-decorate- Prefer removing a wrapper over adding 5 utility classes to itintent-match-context-fidelity- Match design polish to context — admin vs consumer vs productintent-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 sizehier-deemphasize-secondary- De-emphasize secondary content instead of emphasizing primaryhier-button-hierarchy- Style buttons by visual hierarchy, not semantic importancehier-label-value-pairs- Combine labels and values into natural languagehier-semantic-vs-visual- Separate visual hierarchy from document hierarchyhier-icon-sizing- Size icons relative to adjacent text, not to fill spacehier-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 removespace-systematic-scale- Use a constrained spacing scale, not arbitrary valuesspace-relationship-proximity- Use spacing to show relationships between elementsspace-dont-fill-screen- Constrain content width — avoid filling the whole screenspace-grids-not-required- Use fixed widths when grids are not neededspace-relative-sizing-fails- Avoid raw viewport units without clampingspace-mobile-first- Design mobile-first at ~400px, then expand
4. Typography (HIGH)
type-line-length- Keep line length between 45-75 characterstype-line-height-inverse- Line height and font size are inversely proportionaltype-font-weight-variety- Choose fonts with at least 5 weight variationstype-no-center-long-text- Left-align body content — avoid centering long-form texttype-letter-spacing- Tighten letter spacing for headlines, loosen for uppercasetype-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-hoccolor-grayscale-first- Design in grayscale first, add color lastcolor-accessible-contrast- Ensure 4.5:1 contrast ratio for body textcolor-dark-gray-not-black- Use dark gray instead of pure black for textcolor-saturated-grays- Add subtle saturation to grays for warmth or coolnesscolor-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 largedepth-shadow-vertical-offset- Use vertical offset for natural-looking shadowsdepth-interactive-elevation- Use shadow changes to communicate interactivitydepth-light-closer-dark-recedes- Lighter colors feel closer, darker colors recededepth-overlap-layers- Overlap elements to create visual layers
7. Borders & Separation (MEDIUM)
sep-fewer-borders- Use fewer borders — replace with spacing, shadows, or background colorsep-background-color-separation- Use background color differences to separate sectionssep-table-spacing-not-lines- Use spacing instead of lines in simple tablessep-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 ratioimg-text-overlay- Add overlays or reduce contrast for text over imagesimg-dont-scale-up-icons- Avoid scaling up icons designed for small sizesimg-empty-states- Design meaningful empty states with clear CTAs
9. Polish & Details (LOW)
polish-accent-borders- Add accent borders to highlight important elementspolish-custom-bullets- Replace default bullets with icons or checkmarkspolish-border-radius-personality- Match border radius to brand personalitypolish-gradient-close-hues- Use gradients with hues within 30 degrees of each otherpolish-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
| File | Description |
|---|---|
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |
How to use tailwind-ui-refactor on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add tailwind-ui-refactor
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches tailwind-ui-refactor from GitHub repository pproenca/dot-skills and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate tailwind-ui-refactor. Access the skill through slash commands (e.g., /tailwind-ui-refactor) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
Task Automation & Efficiency
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Knowledge Enhancement
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Quality Improvement
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client with skill support
- ›Clear understanding of task or problem to solve
- ›Willingness to iterate and refine outputs
Time Estimate
15-45 minutes depending on use case complexity
Installation Steps
- 1.Install skill using provided installation command
- 2.Test with simple use case relevant to your work
- 3.Evaluate output quality and relevance
- 4.Iterate on prompts to improve results
- 5.Integrate into regular workflow if valuable
Common Pitfalls
- ⚠Expecting perfect results without iteration
- ⚠Not providing enough context in prompts
- ⚠Using skill for tasks outside its intended scope
- ⚠Accepting outputs without review and validation
Best Practices▌
✓ Do
- +Start with clear, specific prompts
- +Provide relevant context and constraints
- +Review and refine all outputs before using
- +Iterate to improve output quality
- +Document successful prompt patterns
✗ Don't
- −Don't use without understanding skill limitations
- −Don't skip validation of outputs
- −Don't share sensitive information in prompts
- −Don't expect skill to replace human judgment
💡 Pro Tips
- ★Be specific about desired format and style
- ★Ask for multiple options to choose from
- ★Request explanations to understand reasoning
- ★Combine AI efficiency with human expertise
When to Use This▌
✓ Use When
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid When
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
Learning Path▌
- 1Familiarize yourself with skill capabilities and limitations
- 2Start with low-risk, non-critical tasks
- 3Progress to more complex and valuable use cases
- 4Build expertise through regular use and experimentation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.6★★★★★48 reviews- ★★★★★Dhruvi Jain· Dec 24, 2024
Solid pick for teams standardizing on skills: tailwind-ui-refactor is focused, and the summary matches what you get after install.
- ★★★★★Daniel Haddad· Dec 24, 2024
Registry listing for tailwind-ui-refactor matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Arya Haddad· Dec 20, 2024
I recommend tailwind-ui-refactor for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Anika Chen· Dec 20, 2024
Useful defaults in tailwind-ui-refactor — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Anika Farah· Dec 4, 2024
Keeps context tight: tailwind-ui-refactor is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Oshnikdeep· Nov 15, 2024
We added tailwind-ui-refactor from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Jin Bansal· Nov 15, 2024
Useful defaults in tailwind-ui-refactor — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Amina Jain· Nov 11, 2024
tailwind-ui-refactor reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Anaya Okafor· Nov 11, 2024
Registry listing for tailwind-ui-refactor matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Ganesh Mohane· Oct 6, 2024
tailwind-ui-refactor fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
showing 1-10 of 48