Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Tailwind Purge Fixer

    1

    The Tailwind Purge Fixer is an expert-level diagnostic skill designed for frontend developers struggling with oversized production CSS files.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Tailwind Purge Fixer

    Tailwind Purge Fixer

    Example session with this skill installed

    "I just migrated my Vite React project from Tailwind v3 to v4. Everything works, but my production CSS jumped from about 4KB to over 80KB! I am using a few components from shadcn-ui. My app.css uses @import "tailwindcss"; and I added @source "../node_modules"; just to make sure the UI library styles loaded properly. Can you help me get my file size back down?"

    • Read your context and instructions
    • Compiled the tailwind purge fixer
    • Generated the app files

    Found it — the culprit is this line:

    @source "../node_modules";
    

    Root cause: In Tailwind v4, @source tells the Oxide engine to scan those files for class names to generate. Pointing it at the entire node_modules directory makes it scan every JS/TS/HTML file in every package you've installed — including packages that have nothing to do with your UI. Any string in any of those files that happens to look like a valid Tailwind utility (text-sm, flex, p-4, etc.) gets generated into your CSS. That's almost certainly your jump from 4KB to 80KB+.

    You don't need to scan node_modules at all — shadcn-ui components aren't styled by scanning the library's source; they're

    copied into your own project (usually src/components/ui/), so Tailwind already picks them up when it scans your app's source files.

    Fix

    Remove the broad @source directive entirely:

    @import "tailwindcss";
    
    /* Remove this line: */
    /* @source "../node_modules"; */
    

    If your @import "tailwindcss"; is at the root of your CSS and your app.css lives inside src/, Tailwind v4's automatic content detection should already pick up everything under your project root (excluding .gitignored paths like node_modules, dist, etc. by default). You likely don't need any manual @source directive at all.

    Only add @source back if:

    • You have shadcn/ui or other component files living outside the default scan root (e.g., a monorepo package), in which case scope it precisely:
    @source "../../packages/ui-components/**/*.{ts,tsx}";
    
    • Never point @source at node_modules as a whole — if you truly need one specific package's compiled output scanned (rare), target the exact subpath, e.g. @source "../node_modules/some-specific-package/dist";.

    Verify

    npm run build
    

    Check the new CSS file size — it should drop back down near your original ~4KB (plus whatever shadcn-ui components you're actually using). Do a quick visual pass on the pages using shadcn-ui components to confirm nothing broke, since shadcn relies on CSS variables (--background, --primary, etc.) defined in your @theme block — those aren't affected by this fix, just the utility-class bloat.

    If size is still high after removing that line, the next place I'd check is whether your @theme block has leftover unused CSS variables from the v3→v4 migration — happy to take a look at that file if you want a second pass.

    app.css

    ZIP · project files

    Generated

    Example file from a real run - the skill writes it into your workspace.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The Tailwind Purge Fixer is an expert-level diagnostic skill designed for frontend developers struggling with oversized production CSS files. When Tailwind fails to purge properly, production CSS can easily balloon from a standard 2-5KB up to 50KB or more, hurting Core Web Vitals and load times.

    This skill provides a systematic troubleshooting workflow that covers both the Tailwind v3 JIT engine and the new Tailwind v4 Oxide engine. It expertly roots out common performance killers such as overly broad content globs, dangerous regex safelists, dynamic string interpolations that bypass the compiler, and bloated UI component libraries (like shadcn-ui, daisyUI, or Skeleton). By analyzing your build stack and configuration files, the skill delivers exact code replacements and refactoring strategies to strip out unused variables, @property rules, and component classes without breaking your production UI.

    Does not apply to dev environments where purging is disabled. Cannot optimize projects using runtime dynamic theming that requires the full variable set.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 2 months ago

    Permissions

    No special permissions declared or detected

    Listed2 months ago

    What's inside

    Frequently Asked Questions

    This skill identifies why Tailwind is failing to tree-shake unused styles, fixing issues like incorrect content globs and dynamic class interpolation to bring your production CSS back down to a lean 2-5KB.

    Yes, the skill is fully optimized for both Tailwind v3 JIT configurations and the new v4 Oxide engine, including support for CSS-based configuration and legacy JavaScript files.

    This skill is designed for use with leading AI coding assistants like ChatGPT, Claude, and GitHub Copilot, allowing you to paste your config files for instant diagnostic feedback.

    You will receive the specialized diagnostic prompt file, a systematic troubleshooting checklist, and a guide for resolving common bloat issues caused by third-party UI libraries.

    No direct access to your codebase is required; you simply provide your tailwind.config.js (or v4 CSS config) and a sample of your build output for the tool to analyze.

    Buyers receive lifetime access to the skill, including free updates whenever Tailwind releases new major versions or changes their internal purging logic.

    New in Frontend & Web Apps