Skill library

Agent skill Frontend

Tailwind Design System

Translate a visual system into Tailwind CSS v4 theme tokens, responsive layouts and reusable component variants.

  • Tailwind CSS
  • Design tokens
  • Component variants

Install the skill

Installation method

Run the command from your project root with Node.js and npm.

npx skills@latest add wshobson/agents --skill tailwind-design-system --agent claude-code --yes

Check this file in your project.claude/skills/tailwind-design-system/SKILL.md

Other ways to install
  • Choose an assistant interactively

    npx skills@latest add wshobson/agents --skill tailwind-design-system

    Select your assistant and choose the project installation scope.

    Official instructions

The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. Open the project and confirm Tailwind CSS v4, its stylesheet entry, and its build tool. For a v3 project, review the official upgrade guide and identify the supported browser baseline before proposing a migration.

View operation manual

What this skill helps with

  • Define a theme with semantic color, type and spacing tokens.
  • Build reusable component variants around shared design decisions.
  • Apply responsive and dark-theme patterns across pages.

Good for

  • Tailwind CSS v4 design systems
  • Standardizing components across a website
Scope
Tailwind CSS v4 semantic tokens, variants, responsive patterns, and theming.
Inputs
The CSS entry, existing token and component recipes, and representative call sites.
Options
The React examples use libraries such as class-variance-authority and tailwind-merge. Keep the project’s existing equivalent where it fits.
Deliverable
A focused component or theme change and its build, appearance, and interaction evidence.
Skill name
tailwind-design-system
Repository
wshobson/agents

Map the role before moving a color into a token

A global rewrite by value

Move all my colors into @theme and replace duplicate class strings.

The same value can represent different roles. A global replacement can change dark mode, focus indicators, and unrelated components.

A change tied to real components

  1. Trace one component’s variants and document its current users.
  2. Map semantic roles to existing tokens or introduce a missing role deliberately.
  3. Verify the same component states in light and dark appearance.

Tailwind Design System operation manual

Use the skill to consolidate a button recipe or fix dark-mode inconsistencies in a card. Fill in the bracketed project details before sending a prompt.

Move repeated button styles into the existing component system while preserving behavior and caller overrides.

  1. Find the active stylesheet and button callers

    Identify the Tailwind version, existing token names, duplicate recipes, and real behavior before editing.

    Prompt · Step 1
    Use the installed tailwind-design-system skill to inspect [button component and two representative routes]. Read the project’s dependency lockfile and CSS entry to confirm Tailwind v4. Identify reusable button primitives, class helpers, theme selectors, and semantic tokens. Trace the requested callers’ primary, secondary, disabled, loading, and focus behavior where present. Record any custom className overrides, different HTML semantics, and tests. If the project is on v3, explain the compatibility gap and use the official upgrade guide to report migration implications before proposing a change. Keep this pass to the inventory.
  2. Map intent and size to existing styles

    Propose a named variant API around actual use cases and decide which tokens can be reused.

    • Each variant has at least one real use case.
    • Existing accessible names and supported overrides are accounted for.
    Prompt · Step 2
    Use tailwind-design-system to plan [shared button API] for [selected call sites]. Recover the caller inventory or inspect the real callers before proposing a change. Read the CVA example in references/details.md and reuse the project’s current variant mechanism if it already works. Map each semantic color pair and focus style to existing v4 tokens. Propose variants and sizes based on actual use, list the behavior and overrides each caller needs, and show one migrated call. Keep existing links as links and actions as buttons. Ask for approval before editing.
  3. Implement the approved recipe and migrate one caller

    Apply the smallest token and recipe change, then move one agreed caller to the new variant.

    Prompt · Step 3
    Use tailwind-design-system to implement [approved variant plan] and migrate [selected button caller]. Verify the project’s Tailwind v4 entry and approved token mapping first. Reuse the project’s variant and merge utilities. Leave tokens already defined under their current names and add only a genuinely missing role. Use full static class names for every variant so the production build detects them. Preserve the caller’s button or link element, form type, loading and disabled behavior, accessible name, focus style, and intended className overrides. Run the project’s relevant type and build checks. Report migrated and remaining callers.
  4. Compare real states at both widths and themes

    Open the existing button stories or routes and confirm the approved style and behavior agree with the recorded baseline.

    • The supported variants render in both themes.
    • Keyboard, form, and override behavior match the baseline.
    Prompt · Step 4
    Use tailwind-design-system to verify [migrated button caller] against [button baseline or existing story]. Capture the baseline if it is missing. Open the requested routes in light and dark modes at narrow and wide widths. Confirm the intended variants render, focus stays visible, and loading and disabled states behave as before. Check keyboard activation, destination or form submission, and a known className override. Run the project’s production build and confirm the selected classes still render. Return the actual checks, evidence, and unverified states.

Find the right Tailwind v4 pattern

Point the assistant to the project stylesheet and the matching installed reference.

Several call sites repeat button class listsVariants
Command or reference
references/details.md · Pattern 1
Examples
Map actual intent, size, and component states through the project’s variant API.
An alias resolves incorrectly after theme changesTokens
Command or reference
references/advanced-patterns.md · Theme Modifiers
Examples
Compare the runtime variable and generated utility. Use @theme inline for variable aliases.
A dark-mode card ignores the existing switchDark mode
Command or reference
references/advanced-patterns.md · Pattern 6
Examples
Trace the project’s dark selector and inspect both computed color pairs.
A variant works locally but its styles disappear from the buildClass detection
Command or reference
Tailwind · Detecting classes in source files
Examples
Replace interpolated fragments with full class strings and verify project source detection.

Tailwind Design System troubleshooting

Can I paste the v4 CSS into a Tailwind v3 project?

Use the official upgrade guide to review framework integration and browser support first. The skill’s CSS-first directives and examples target v4.

Do I have to add CVA and tailwind-merge?

The React examples show both tools. Use the variant and class merging mechanism that the project already uses when it can express the same styles. The Skills CLI installs documentation.

Why is the generated utility missing?

Tailwind scans source text for complete class names. Keep variant values as complete literals, confirm the component source is picked up by the build, and verify the compiled result.