Skip to content
asyrafhussin avatar

Tailwind Best Practices

Tailwind CSS patterns for responsive, dark-mode, and v3-to-v4 work, with version detection first.

CCM score
63 of 100
skills.sh installs
1.1K
GitHub stars
109
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers responsive design, dark mode, reusable component styles, configuration, and migrating from v3 to v4
  • Includes 29 rules across eight categories, with resp-, dark-, comp-, config-, and v4- prefixes
  • Requires checking package.json and config signals to tell v3 from v4 before giving advice
  • Provides cn helper patterns with clsx and tailwind-merge, plus v3 tailwind.config.js and v4 @theme {} examples

Install

$ npx -y skills add asyrafhussin/agent-skills --skill tailwind-best-practices -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Tailwind CSS Best Practices

Comprehensive patterns for building consistent, maintainable interfaces with Tailwind CSS v3.4+ and v4. Contains 29 rules covering responsive design, dark mode, component patterns, configuration, and v4 migration.

Metadata

  • Version: 1.0.0
  • Framework: Tailwind CSS v3.4+ / v4.0+
  • Rule Count: 29 rules across 8 categories
  • License: MIT
  • Documentation: tailwindcss.com/docs

Step 1: Detect Tailwind Version

Always check the version before giving any advice. v3 and v4 are fundamentally different.

Check package.json for the installed version:

{ "tailwindcss": "^3.x" }  // → v3 rules apply
{ "tailwindcss": "^4.x" }  // → v4 rules apply

Also check for these signals:

SignalVersion
tailwind.config.js existsv3
@import "tailwindcss" in CSSv4
@tailwindcss/vite in dependenciesv4
@tailwindcss/postcss in dependenciesv4
@theme {} block in CSSv4

Details

Repository
github.com/asyrafhussin/agent-skills
Category
Frontend & UI Code
First seen
Jun 3, 2026

Questions

What does the tailwind-best-practices skill cover?

tailwind-best-practices gives patterns and conventions for Tailwind CSS, including responsive designs, dark mode, reusable component styles, configuration, and migrating from v3 to v4. It checks the installed Tailwind version first, since v3 and v4 need different advice.

How do I install the tailwind-best-practices skill?

Run npx -y skills add asyrafhussin/agent-skills --skill tailwind-best-practices -y in a project to install tailwind-best-practices. Once installed, the agent can apply its Tailwind rules when a task involves Tailwind classes or a v3 to v4 migration.

Does tailwind-best-practices handle migrating from Tailwind v3 to v4?

Yes, tailwind-best-practices includes a v4 migration rule set that moves a project from v3 to v4. It covers replacing tailwind.config.js with @theme blocks in CSS, along with custom utilities and renamed classes.

Where does tailwind-best-practices sit in the Frontend and UI Code category?

tailwind-best-practices is one of the skills in the Frontend and UI Code category, alongside vercel-react-best-practices and web-design-guidelines. It stands out by focusing specifically on Tailwind class patterns, dark mode setup and v4 configuration.

More from asyrafhussin/agent-skills

All 14

Similar to Tailwind Best Practices

More Frontend & UI Code