tailwind-refactor
БесплатноБез исполняемых скриптовНе проверенTailwind CSS code refactoring patterns for v4 migration and anti-pattern cleanup. This skill should be used when refactoring Tailwind utility classes…
от pproenca★ 231 звезда на GitHubОб этом скилле
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:
- Migrating a project from Tailwind CSS v3 to v4
- Cleaning up deprecated or renamed utility classes
- Consolidating verbose multi-class patterns
- Replacing arbitrary values with design tokens
- Removing
@applyoveruse in CSS files - Modernizing syntax to v4 conventions
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)
config-import-directive- Replace @tailwind directives with @importconfig-css-theme- Migrate tailwind.config.js to CSS @themeconfig-theme-function- Replace theme() function with CSS variablesconfig-theme-inline- Use @theme inline for non-utility design tokensconfig-utility-directive- Replace @layer utilities with @utilityconfig-postcss-plugin- Update PostCSS plugin to @tailwindcss/postcssconfig-content-autodetect- Remove manual content configurationconfig-custom-variant- Migrate addVariant to @custom-variantconfig-preflight-defaults- Account for Preflight default changes in v4
2. Deprecated Utility Replacement (CRITICAL)
dep-opacity-modifiers- Replace -opacity- with opacity modifiers (/50)dep-flex-shorthand- Replace flex-shrink/flex-grow with shrink/growdep-text-ellipsis- Replace overflow-ellipsis with text-ellipsisdep-decoration-utilities- Replace decoration-slice/clone with box-decoration-*dep-transform-composites- Replace transform-none with individual resetsdep-transition-properties- Update transition-[transform] to individual properties
3. Renamed Utility Updates (HIGH)
rename-shadow-scale- Update shadow utilities to new scalerename-blur-scale- Update blur utilities to new scalerename-rounded-scale- Update border radius utilities to new scalerename-ring-width- Replace ring with ring-3 for v3 defaultrename-gradient-utilities- Replace bg-gradient-* with bg-linear-*rename-outline-hidden- Replace outline-none with outline-hidden
4. Class Consolidation (HIGH)
class-size-utility- Replace matching w-* h-* with size-*class-gap-over-space- Prefer gap-* over space-x/y-* in flex/gridclass-inset-shorthand- Replace top/right/bottom/left with inset-*class-border-color-explicit- Add explicit border color for v4 default changeclass-ring-color-explicit- Add explicit ring color for v4 default changeclass-redundant-display- Remove redundant display classesclass-hidden-priority- Remove display overrides for hidden attributeclass-container-utility- Replac
Установить tailwind-refactor в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл tailwind-refactor?
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 visual output. Triggers on tasks involving Tailwind CSS cleanup, v4 migration, class refactoring, @apply removal, or utility modernization.
Как установить скилл tailwind-refactor?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл tailwind-refactor запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic