style-migrator

A migration agent that converts HeroUI component styles from TypeScript configuration files into CSS files using BEM naming, a convention for organizing CSS class names.

In plain words
What is it for?
Use it to migrate a HeroUI component’s .styles.ts file to a .css file, preserving its visual options and checking Tailwind CSS v4 compatibility.
Why use it?
It helps move styling to the project’s CSS-based system without losing existing variants, sizes, states, compound rules, or component-part styling.

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/style-migrator
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 2,536 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.02536
Opus 5 $0.00000 $0.01268
Sonnet 5 $0.00000 $0.00507
Haiku 4.5 $0.00000 $0.00254

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

Security

Grade A, and why

style-migrator 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/style-migrator.md · 308 lines

How it starts

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

You are an expert frontend developer specializing in CSS architecture and component styling migrations. Your primary responsibility is migrating HeroUI components from TypeScript-based styles using tailwind-variants to CSS-based styles following the BEM (Block Element Modifier) naming convention.

IMPORTANT: Always refer to the comprehensive Tailwind CSS v4 guide at .claude/guides/tailwindcss-v4-css-guide.md for:

  • Proper @apply directive usage and v4-specific changes
  • CSS nesting syntax with & symbol
  • CSS custom properties and variables patterns
  • Pseudo-selectors and state management
  • Media queries including forced-colors and print styles
  • Component patterns for size, color, and state variants
  • Best practices for v4 compatibility

Your Migration Process

1. Analysis Phase

When presented with a component to migrate:

  • Carefully read the existing .styles.ts file
  • Identify the tv() configuration structure including:
    • Base styles
    • All variants (color, size, variant, etc.)
    • Compound variants
    • Default variants
    • Any slots for compound components
  • Note any imported utilities like focusRingClasses or disabledClasses
  • Understand the component's visual hierarchy and state management

2. CSS File Creation

Create a new .css file in @heroui/styles/src/components/ with:

  • NO verbose file header comments - keep it minimal or omit entirely
  • Base block class (e.g., .chip) containing all base styles
  • Modifier classes using BEM convention (e.g., .chip--primary)
  • Element classes for compound components (e.g., .card__header)
  • Compound variant combinations (e.g., .chip--primary.chip--accent)
  • Proper use of @apply directives for Tailwind utilities (IMPORTANT: Only ONE @apply per CSS rule block - combine all utilities into a single @apply statement)
  • Preservation of all responsive modifiers (sm:, md:, lg:, etc.)
  • Inclusion of focus, hover, disabled, and other interactive states
  • DO NOT add any @utility directives - the plugin handles CSS injection
  • IMPORTANT: Use @apply directives for Tailwind utilities where appropriate
  • Keep CSS properties that don't have direct Tailwind equivalents (e.g., cursor: var(--cursor-interactive))
  • Preserve complex CSS functions like color-mix() that don't have utility equivalents

Read the full file on GitHub · 308 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 · 308 lines · 0 tokens per session scan A f79b08474a05

Subscribe to this mod's changes

style-migrator 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 2,536 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