agentleFS
qyndexqyndex/claude-init/.claude/skills/tailwind-discipline/SKILL.md

tailwind-discipline

Skill2 starsChanged 5 months agoMITView on GitHub

Use when writing Tailwind utility classes. Enforces utility-first discipline, semantic token usage, no inline style, prettier-plugin-tailwindcss class order. Round 9 C.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Extract to @layer components: only after 3+ uses. Name semantically: btn-primary, NOT blue-button.

    line 21
  2. Very specific:

    tailwind.config.ts: extend, never override defaults: Use theme.extend.colors, not theme.colors.

    line 22
  3. Very specific:

    Mobile-first: Start without prefix; add sm:/md:/lg: for larger.

    line 25
  4. Very specific:

    Use class strategy in tailwind.config.ts:

    line 36
  5. Distinctive:

    All colors via semantic tokens

    line 55

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Tailwind Discipline

Mandate

95%+ Tailwind utilities. No custom CSS without 3+ reuse justification. Arbitrary values require justification comment.

Rules

  • No !important. Ever. If you need it, your specificity is wrong.
  • No inline style= — except dynamic values (computed transforms, animations from JS state).
  • No arbitrary values without comment. text-[17px] → either add 17px to the type scale OR add // reason: precise alignment with logo.
  • Extract to @layer components only after 3+ uses. Name semantically: btn-primary, NOT blue-button.
  • tailwind.config.ts: extend, never override defaults. Use theme.extend.colors, not theme.colors.
  • Semantic tokens, not literals. bg-surface-1, NOT bg-gray-900. Defined in tokens.ts / theme.extend.
  • Class order via prettier-plugin-tailwindcss. Enforce in .prettierrc. PR fails if classes out of order.
  • Mobile-first. Start without prefix; add sm:/md:/lg: for larger. Never write lg:px-4 px-2 — flip to px-2 lg:px-4.

Anti-patterns (auto-fix)

  • style={{ color: '#000' }} → semantic token class
  • text-[14px] leading-[20px] → type-scale class
  • bg-[#1a1a1a] → bg-surface-2 (or add to tokens first)
  • mt-[13px] → snap to scale (mt-3=12px or mt-4=16px); add 13px to scale only if it genuinely matters

Dark mode

Use class strategy in tailwind.config.ts:

darkMode: 'class',

Apply to <html> via ThemeProvider. Tokens get dark variants via dark: prefix or CSS variables.

When breaking the rules is OK

  • Animations with computed values: style={{ transform: \rotate(${angle}deg)` }}`
  • Iframe sizing forced by parent
  • Email templates (limited CSS support → inline OK)

Each exception requires a one-line // reason: comment.

Done means

  • Zero !important
  • Zero inline style= except dynamic
  • Class order normalized via prettier
  • All colors via semantic tokens
  • Dark mode works on every component

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.