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.
In this repository60 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- analyzeSkill
- animation-disciplineSkill
- api-versioningSkill
- autopilotSkill
- browser-e2eSkill
- characterizeSkill
- clarifySkill
- codemodSkill
- constitution-compactSkill
- constitutionSkill
- context-budgetSkill
- creative-webSkill
- db-migrationSkill
- debugSkill
- detect-stackSkill
- dispatch-criteriaSkill
- dreamSkill
- experimentSkill
- fastapiSkill
- flag-cleanupSkill
- flag-rolloutSkill
- flask-realtimeSkill
- framework-detectorSkill
- front-end-designSkill
- grill-meSkill
- handoffSkill
- image-generationSkill
- implementSkill
- initiativeSkill
- instinctSkill
- loopSkill
- nextjsSkill
- observabilitySkill
- okr-alignSkill
- parallel-swarmSkill
- pivotSkill
- planSkill
- pr-bodySkill
- prime-disciplineSkill
- prod-observabilitySkill
- react-nodeSkill
- react-viteSkill
- release-trainSkill
- researchSkill
- reviewSkill
- security-guardSkill
- self-healSkill
- shipSkill
- skill-creatorSkill
- specifySkill
- tasksSkill
- tdd-loopSkill
- token-budgetSkill
- typographySkill
- verify-loopSkill
- verifySkill
- wip-checkpointSkill
- <kebab-case-skill-name>Skill
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
- Very specific: line 21
Extract to
@layer components: only after 3+ uses. Name semantically: btn-primary, NOT blue-button. - Very specific: line 22
tailwind.config.ts: extend, never override defaults: Use theme.extend.colors, not theme.colors. - Very specific: line 25
Mobile-first: Start without prefix; add sm:/md:/lg: for larger.
- Very specific: line 36
Use class strategy in tailwind.config.ts:
- Distinctive: line 55
All colors via semantic tokens
≈ “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.
Files
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 add17pxto the type scale OR add// reason: precise alignment with logo. - Extract to
@layer componentsonly after 3+ uses. Name semantically:btn-primary, NOTblue-button. tailwind.config.ts: extend, never override defaults. Usetheme.extend.colors, nottheme.colors.- Semantic tokens, not literals.
bg-surface-1, NOTbg-gray-900. Defined intokens.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 writelg:px-4 px-2— flip topx-2 lg:px-4.
Anti-patterns (auto-fix)
style={{ color: '#000' }}→ semantic token classtext-[14px] leading-[20px]→ type-scale classbg-[#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
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
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.

