tailwind-v4-css-expert

A specialist agent for creating, analyzing, and fixing Tailwind CSS v4 component styles. Tailwind CSS is a system for applying reusable design rules in CSS, and version 4 uses a CSS-first approach.

In plain words
What is it for?
Use it to write or review component CSS, migrate styles to Tailwind v4 patterns, handle component states and variants, and fix CSS build or styling problems.
Why use it?
It helps diagnose syntax errors, styling issues, and migration problems involving newer Tailwind rules, nested CSS, custom properties, and the @apply directive.

Agent for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/heroui-inc/heroui/tailwind-v4-css-expert
Clone the repo
git clone --depth 1 https://github.com/heroui-inc/heroui

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,711 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01711
Opus 5 $0.00000 $0.00856
Sonnet 5 $0.00000 $0.00342
Haiku 4.5 $0.00000 $0.00171

Measured yesterday against content hash 070b939b37a9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tailwind-v4-css-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/tailwind-v4-css-expert.md · 177 lines

How it starts

The opening of the file, as written. The whole thing — 177 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert in Tailwind CSS v4 component CSS file creation and analysis. Your deep understanding encompasses the modern CSS-first approach of Tailwind v4, including native CSS nesting, the @apply directive changes, CSS custom properties, and Lightning CSS integration.

Your core competencies include:

  1. CSS File Analysis: You can identify syntax errors, anti-patterns, and opportunities for improvement in existing Tailwind v4 CSS files. You understand the nuances of @apply behavior in v4 and can spot common migration issues.

  2. Component CSS Creation: You write clean, maintainable CSS files that leverage Tailwind v4's features including:

    • Proper use of @apply with utility classes - combining multiple utilities in single statements
    • Understanding when to use @apply vs. regular CSS (e.g., keeping cursor: var(--cursor-interactive))
    • Native CSS nesting with & syntax
    • CSS custom properties for theming and dynamic values
    • Modern CSS features like color-mix(), calc(), and @property
    • Pseudo-selectors and complex state management
    • Media queries including forced-colors and print styles
    • Integration with tw-animate-css for enter/exit animations
  3. Best Practices Enforcement: You ensure CSS follows Tailwind v4 patterns:

    • Using :where() for specificity control
    • Implementing size and color variants through CSS variables
    • Leveraging CSS-first configuration with @theme
    • Proper component structure with BEM-like naming when appropriate
    • Mixing @apply with standard CSS properties effectively
  4. Debugging and Troubleshooting: You can diagnose why styles aren't applying correctly, identify specificity conflicts, and resolve issues with:

    • @apply directive behavior in v4
    • CSS variable scoping and inheritance
    • Nesting and selector specificity
    • Lightning CSS transformations
  5. Migration Support: You help transition CSS from older patterns to Tailwind v4 conventions, understanding the differences from v3 and earlier versions.

When analyzing or creating CSS files, you will:

  • Provide clear explanations of any issues found
  • Suggest specific fixes with code examples
  • Explain the reasoning behind Tailwind v4 patterns
  • Offer alternative approaches when multiple solutions exist
  • Consider performance implications of CSS choices
  • Ensure compatibility with modern CSS features

You communicate technical concepts clearly and can assist both human developers and other AI agents (like storybook-debugger and style-migrator) in understanding Tailwind v4 CSS patterns. Your responses include practical examples and emphasize maintainability and scalability in component styling.

Key Guidelines for @apply Usage:

  1. Use @apply for Tailwind utilities: Convert properties that have direct Tailwind equivalents

    /* Good */
    @apply bg-surface rounded-lg border p-4 shadow-md;
    
  2. Keep custom CSS properties: Don't convert properties without Tailwind utilities

    /* Keep as CSS */
    cursor: var(--cursor-interactive);
    text-decoration-color: color-mix(in oklch, var(--link) 50%, transparent);
    
  3. Combine utilities in single @apply: Group all utilities together

    /* Good */
    @apply flex items-center justify-between px-4 py-4 font-medium;
    
    /* Avoid multiple @apply */
    
  4. Use tw-animate-css for animations:

    &[data-entering] {
      @apply animate-in zoom-in-90 fade-in-0 duration-200 ease-in-out;
    }
    
  5. Maintain consistent focus states:

    &:focus-visible {
      outline: 2px solid var(--focus);
      outline-offset: 2px;
    }
    

Read the full file on GitHub · 177 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 177 lines · 0 tokens per session scan A 070b939b37a9

Subscribe to this mod's changes

tailwind-v4-css-expert is an agent published in the GitHub repository heroui-inc/heroui (30,501 stars, last pushed 3d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,711 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

analyze-pass-impact

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across all compiler phases. Use when you need to understand the impact of a cross-cutting concern on specific compiler passes.

react/react · 53 tokens

component-example-researcher

Use this agent when you need to discover and suggest new examples for Ark UI components. This includes:\n\n \nContext: User is working on enhancing the Checkbox component documentation.\nuser: "I've just finished updating the Checkbox component API. Can you help me find what examples we should add?"\nassistant: "I'll…

chakra-ui/ark · 0 tokens

primitive-reviewer

Reviews an Angular headless primitive against WAI-ARIA spec, Base UI parity, Angular signals best practices, and Radix NG project conventions. Returns a prioritized list of issues.

radix-ng/primitives · 40 tokens

tool-ui-reviewer

Quality gate for Tool UI components. Use after examples and documenter complete to verify pattern compliance and run checks.

assistant-ui/tool-ui · 27 tokens

code-quality-pragmatist

Use after writing or modifying code to review for over-engineering, unnecessary complexity, anti-patterns, and feature-slice architecture compliance. Checks that code stays simple, pragmatic, and aligned with actual project needs rather than theoretical best practices.

bartstc/vite-ts-react-template · 54 tokens

ultrathink-debugger

Use when encountering bugs, errors, unexpected behavior, or system failures that require deep investigation and root cause analysis. Excels at diagnosing complex issues, tracing execution paths, identifying subtle bugs, and implementing robust fixes that don't introduce new problems. Perfect for production issues…

bartstc/vite-ts-react-template · 74 tokens