tailwindcss

A set of rules for writing and updating interfaces with Tailwind CSS, a utility-based styling framework. The rules target Tailwind CSS version 4.1 or newer and cover class usage, upgrades, and cleanup.

In plain words
What is it for?
Use it when creating or reviewing Tailwind-styled interfaces, upgrading Tailwind, replacing deprecated utilities, organizing classes, and checking responsive styling.
Why use it?
It helps avoid removed utilities, unnecessary classes, outdated upgrade steps, and styling patterns the rules prohibit, such as @apply.

Cursor rule for Cursor

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 rules/agentset-ai/agentset/tailwind
Clone the repo
git clone --depth 1 https://github.com/agentset-ai/agentset

Made for: Cursor.

Per session 2,753 This file is loaded in full into every session.
When invoked 2,753 The same file — it is already loaded in full.
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.02753 $0.02753
Opus 5 $0.01376 $0.01376
Sonnet 5 $0.00551 $0.00551
Haiku 4.5 $0.00275 $0.00275

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

Security

Grade A, and why

tailwindcss 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.

.cursor/rules/tailwind.mdc · 372 lines

How it starts

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

Tailwind CSS Rules and Best Practices

Core Principles

  • Always use Tailwind CSS v4.1+ - Ensure the codebase is using the latest version
  • Do not use deprecated or removed utilities - ALWAYS use the replacement
  • Never use @apply - Use CSS variables, the --spacing() function, or framework components instead
  • Check for redundant classes - Remove any classes that aren't necessary
  • Group elements logically to simplify responsive tweaks later

Upgrading to Tailwind CSS v4

Before Upgrading

Upgrade Process

  1. Run the upgrade command: npx @tailwindcss/upgrade@latest for both major and minor updates
  2. The tool will convert JavaScript config files to the new CSS format
  3. Review all changes extensively to clean up any false positives
  4. Test thoroughly across your application

Breaking Changes Reference

Removed Utilities (NEVER use these in v4)

❌ Deprecated ✅ Replacement
bg-opacity-* Use opacity modifiers like bg-black/50
text-opacity-* Use opacity modifiers like text-black/50
border-opacity-* Use opacity modifiers like border-black/50
divide-opacity-* Use opacity modifiers like divide-black/50
ring-opacity-* Use opacity modifiers like ring-black/50
placeholder-opacity-* Use opacity modifiers like placeholder-black/50
flex-shrink-* shrink-*
flex-grow-* grow-*
overflow-ellipsis text-ellipsis
decoration-slice box-decoration-slice
decoration-clone box-decoration-clone

Read the full file on GitHub · 372 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 · 372 lines · 2,753 tokens per session scan A ededbd5ba068

Subscribe to this mod's changes

tailwindcss is a cursor rule published in the GitHub repository agentset-ai/agentset (2,076 stars, last pushed 1mo ago), licensed MIT. It adds 2,753 tokens to every session, about $0.0138 per session on Opus 5. 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.