Tailwind refactor

From pproenca/dot-skills · View interactive version

Tailwind refactor is an AI agent skill from the GitHub repository pproenca/dot-skills. Tailwind CSS code refactoring patterns for v4 migration and anti-pattern cleanup. This skill should be used when refactoring Tailwind utility classes, migrating from v3 to v4, cleaning up deprecated utilities, consolidating verbose class patterns, or removing code smells — all without changing the v

How to use this skill

Skill file

Community Tailwind CSS Refactoring Best Practices

Comprehensive code quality refactoring guide for Tailwind CSS applications targeting v4. Contains 50 rules across 8 categories, prioritized by migration urgency. Every transformation preserves the existing look and feel — this skill is purely about cleaner code, modern syntax, and v4 compatibility.

Companion skills: Use tailwind-ui-refactor for visual design improvements and tailwind-responsive-ui for responsive layout patterns.

When to Apply

Before manual migration: Run npx @tailwindcss/upgrade first — it handles most configuration and renamed utility changes automatically. Then use this skill for patterns the automated tool does not cover.

Reference these guidelines when:

Rule Categories by Priority

| Priority | Category | Impact | Prefix |

|----------|----------|--------|--------|

| 1 | Configuration Migration | CRITICAL | config- |

| 2 | Deprecated Utility Replacement | CRITICAL | dep- |

| 3 | Renamed Utility Updates | HIGH | rename- |

| 4 | Class Consolidation | HIGH | class- |

| 5 | Arbitrary Value Cleanup | MEDIUM-HIGH | arb- |

| 6 | Syntax Modernization | MEDIUM | syntax- |

| 7 | @apply & Architecture Cleanup | MEDIUM | arch- |

| 8 | Modern Feature Adoption | LOW-MEDIUM | adopt- |

Quick Reference

1. Configuration Migration (CRITICAL)

2. Deprecated Utility Replacement (CRITICAL)

3. Renamed Utility Updates (HIGH)

4. Class Consolidation (HIGH)

5. Arbitrary Value Cleanup (MEDIUM-HIGH)

6. Syntax Modernization (MEDIUM)

7. @apply & Architecture Cleanup (MEDIUM)

8. Modern Feature Adoption (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

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 |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.