Skip to content
Skills Library
Programming · Review & audit

tailwindcss-optimizer

/tailwindcss-optimizer

Audit and optimize Tailwind CSS 4.3 usage for CSS-first setup, @theme/@source/@utility, dynamic class names, broad safelists, @apply sprawl, legacy v3 directives/config, cascade layers, dark mode, content detection and the v3-to-v4 migration, with real before/after measurement. Always produces a written findings report and a fix plan for approval before touching code. Use this whenever the user mentions Tailwind, Tailwind 4, @theme, @source, @tailwind directives, tailwind.config, utility-class bundle size, or "optimize my Tailwind" -- even if they never say audit or optimize.

Licence
MIT
Last repository change
04.11.2026

Assessment and security

85/ 100Class: good
Format20 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
8
Scripts
1
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 04.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/audit.py

What it does and when to use it

Audit and optimize Tailwind CSS 4.3 usage for CSS-first setup, @theme/@source/@utility, dynamic class names, broad safelists, @apply sprawl, legacy v3 directives/config, cascade layers, dark mode, content detection and the v3-to-v4 migration, with real before/after measurement. Always produces a written findings report and a fix plan for approval before touching code. Use this whenever the user mentions Tailwind, Tailwind 4, @theme, @source, @tailwind directives, tailwind.config, utility-class bundle size, or "optimize my Tailwind" -- even if they never say audit or optimize.

Triggers from the description

optimize my Tailwind
Original author description

Audit and optimize Tailwind CSS 4.3 usage for CSS-first setup, @theme/@source/@utility, dynamic class names, broad safelists, @apply sprawl, legacy v3 directives/config, cascade layers, dark mode, content detection and the v3-to-v4 migration, with real before/after measurement. Always produces a written findings report and a fix plan for approval before touching code. Use this whenever the user mentions Tailwind, Tailwind 4, @theme, @source, @tailwind directives, tailwind.config, utility-class bundle size, or "optimize my Tailwind" -- even if they never say audit or optimize.

How it works

  1. Workflow
  2. Principles
  3. Docs
Original SKILL.md headings · 61 lines, 569 words
SKILL.md preview
---
name: tailwindcss-optimizer
description: Audit and optimize Tailwind CSS 4.3 usage for CSS-first setup, @theme/@source/@utility, dynamic class names, broad safelists, @apply sprawl, legacy v3 directives/config, cascade layers, dark mode, content detection and the v3-to-v4 migration, with real before/after measurement. Always produces a written findings report and a fix plan for approval before touching code. Use this whenever the user mentions Tailwind, Tailwind 4, @theme, @source, @tailwind directives, tailwind.config, utility-class bundle size, or "optimize my Tailwind" -- even if they never say audit or optimize.
---

# Tailwind CSS Optimizer

Tailwind 4.3 is CSS-first and scans source automatically: `@import "tailwindcss"`, `@theme`, `@source`, `@utility`, `@custom-variant`. Cost is dynamic class names that cannot be scanned, broad safelists, `@apply` sprawl, legacy v3 directives/config and duplicate utility frameworks.

## Workflow

### 1. Scope (quick)

- Find the app root and detect Tailwind CSS usage: `Tailwind CSS 4.3.x`. Record the version, framework (React/Next/Vue/Svelte/Solid/Angular or HTML), styling system, and whether the library is a package, a CSS-only kit, or copied source.
- Run `python <skill-dir>/scripts/audit.py <project-root>` -- static scan of `package.json`, config/CSS files and source for version drift, dynamic class names, broad safelists, @apply sprawl, legacy v3 directives and v3-to-v4 migration, with file:line evidence. Use `--json` to post-process.
- Classify the pain: bundle/import cost, runtime/re-render cost, theming/SSR style flash, accessibility/forms, large tables/lists, or migration/upgrade. Ask which hurts if unclear.
- Read `references/tooling.md` once: what can be measured here.

- Check the CSS entry (`@import "tailwindcss"`), `@theme`/`@source`, the Vite/PostCSS plugin and any leftover v3 `tailwind.config`/directives.

### 2. Audit

The script finds cheap leads; you find the rest by reading. Read the install/config, the global CSS/theme file, the provider or plugin setup, and the 3-5 most-used components. Load only what applies:

| Area | Reference |
|------|-----------|
| Install, config, provider/plugin, theming, SSR | `references/setup.md` |
| Bundle/imports, runtime, a11y/forms, tables, upgrades | `references/optimizations.md` |
| Measurement and honest reporting | `references/tooling.md` |

**Measure, never guess.** Build for production and measure the real route/bundle. Inspect SSR HTML for style tags and dark-mode flash; run axe/Playwright on dialogs, menus, forms and tables. Component count, bundle bytes and a11y violations are evidence; "feels heavy" is not.

Mark each finding **Confirmed** (build/analyzer/axe/code evidence) or **Suspected** (needs measuring).

### 3. Report

Fill `assets/report-template.md`, save it as `TAILWIND_CSS_OPTIMIZATION_REPORT.md` in the project root, and show the user. Five-line summary, findings table by impact/effort, then per-finding detail (evidence, why it hurts, fix, risk, visual/behavior impact). Group near-duplicates.

### 4. Plan -- then stop for approval

Use plan mode: `EnterPlanMode` (load with ToolSearch if deferred), write the plan, present with `ExitPlanMode`; if unavailable show it in chat and wait for an explicit "go". Structure:

1. **Quick wins** -- trim imports, use path imports, add provider/plugin correctly, add missing labels/titles, move heavy components off the initial route, remove per-row overlays, align theme tokens, add SSR style/cache setup. Low risk.
2. **Structural** -- split component boundaries, virtualize tables, lazy-load heavy widgets, consolidate theming, migrate variants/tokens, fix form composition, deduplicate copied components. Name each behavior change.
3. **Heavy** -- major upgrade, primitive-base change, CSS-only to styled kit (or reverse), Tailwind 3 to 4, copy-in registry extraction, SSR architecture. Separately approved.
   Each step: files touched, expected effect, how to verify, how to roll back.

### 5. Fix

Only approved items, in small groups. After each: typecheck, lint, tests, production build, and a visual/axe check on affected components. A break must trace to one change. Do not mix a major migration with optimization edits. If a change alters a public component API, theme tokens or SSR behavior, stop and ask.

### 6. Verify and wrap up

Re-measure the same routes/components: route JS/CSS, SSR styles/theme, axe violations, dialog/form keyboard flow, table interaction. State plainly what could not be measured. End with deferred items and one suggested next step.

## Principles

- **CSS-first in v4.** Tokens/content live in CSS.
- **Classes must be statically visible.**
- **One utility engine.** Don't mix Tailwind and Uno/Twind.

## Docs

- https://tailwindcss.com/docs/installation/using-vite
Files in this package (8)
  • LICENSE 1 KB
  • README.md 1 KB
  • SKILL.md 5 KB
  • assets/report-template.md 1 KB
  • references/optimizations.md 1 KB
  • references/setup.md 1 KB
  • references/tooling.md 1 KB
  • scripts/audit.py 10 KB

Versions

The database has no other skills named tailwindcss-optimizer.

Database snapshot: 13.11.2026 · package version 1cb680c36097 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100tailwindcss
    Tailwind CSS v4 utility-first discipline: CSS-first configuration, design tokens via @theme, and principled class composition. Invoke whenever task involves any interaction with Tailwind CSS — writing, reviewing, refactoring, debugging, or understanding utility classes, theme…
  • 95use-tailwind-v4
    Tailwind CSS v4 syntax and v3→v4 migration reference. Use when the user mentions 'Tailwind v4', 'upgrade Tailwind', @theme, @utility, or @import 'tailwindcss', or is working in a project whose config indicates v4.
  • 100tailwindcss
    Tailwind CSS v4 utility-first styling patterns including responsive design, dark mode, and custom configuration. Use when styling with Tailwind, adding utility classes, configuring Tailwind, setting up dark mode, or customizing the theme.
  • 100tailwindcss-core
    Use when configuring Tailwind CSS-first (no config.js), defining @theme tokens, or creating custom utilities/variants. Do NOT use for v3-to-v4 migration or category utility lookup.
  • 100tailwind-css
    Tailwind CSS v4 patterns: CSS-first config, utility classes, component variants, v3 migration. Use when styling with Tailwind, configuring @theme tokens, using tailwind-variants/CVA, migrating v3 to v4, or fixing Tailwind styles and dark mode.
  • 100tailwind-css-v4
    Reference for Tailwind CSS v4 syntax and the differences from v3.x. Use when configuring Tailwind (CSS-first @theme config, @import "tailwindcss"), using new v4 features (container queries, 3D transforms, gradients, composable variants, @utility/@custom-variant/@plugin), or…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.