design-system-tailwind
Skill2 starsChanged 4 months agoMITView on GitHub
Build and maintain a scalable Tailwind CSS design system and component library — design tokens, variant management with class-variance-authority, theming, and consistent spacing/color/typography scales. Use whenever the user is styling with Tailwind, building a component library, setting up design tokens, configuring a Tailwind theme, or asking how to keep UI consistent across a project. Trigger on "design system", "tailwind config", "component library", "design tokens", "consistent styling".
In this repository22 other files it gives its agents.
- accessibility-a11ySkill
- motion-design-toolkitSkill
- nextjs-architectureSkill
- react-component-engineeringSkill
- react-three-fiber-3dSkill
- responsive-mobile-firstSkill
- auth-authorizationSkill
- database-schema-designSkill
- form-validation-error-handlingSkill
- mern-stack-architectureSkill
- rest-api-integrationSkill
- state-managementSkill
- landing-page-conversionSkill
- payment-gateway-integrationSkill
- saas-dashboard-adminSkill
- startup-mvp-developmentSkill
- ux-research-flow-designSkill
- visual-design-languageSkill
- ai-assisted-frontend-workflowSkill
- deployment-vercel-productionSkill
- performance-seo-optimizationSkill
- project-architecture-clean-codeSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 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.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 31
Never branch className with long ternary chains.
- Very specific: line 53
No arbitrary values (w-[123px], text-[#3a3a3a]) in feature code — if the scale doesn't have it, add the token, don't escape the system.
- Distinctive: line 56
Every new primitive gets documented with its variant matrix (a short table: variant × size × state) before being reused across features.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Design System & Tailwind CSS Engineering Skill
Turns Tailwind usage from ad-hoc utility soup into a governed design system.
Foundation: tokens before components
Define tokens once in tailwind.config.ts (or CSS variables for runtime theming) — never hardcode hex codes or arbitrary pixel values in component files.
// tailwind.config.ts
theme: {
extend: {
colors: {
brand: { 50: '...', 500: '...', 900: '...' },
surface: 'hsl(var(--surface))',
foreground: 'hsl(var(--foreground))',
},
fontFamily: { sans: ['var(--font-inter)'] },
spacing: { '18': '4.5rem' }, // only add if a real gap exists in the default scale
borderRadius: { xl: '1rem' },
}
}For dark mode / multi-theme, drive colors through CSS variables (hsl(var(--x))) so themes swap without a rebuild.
Component variants with class-variance-authority (cva)
Never branch className with long ternary chains. Use cva for variant + size + state matrices:
const button = cva('inline-flex items-center rounded-md font-medium transition-colors', {
variants: {
variant: { primary: 'bg-brand-600 text-white hover:bg-brand-700', ghost: 'bg-transparent hover:bg-surface-100' },
size: { sm: 'h-8 px-3 text-sm', md: 'h-10 px-4', lg: 'h-12 px-6 text-lg' },
},
defaultVariants: { variant: 'primary', size: 'md' },
});Merge with tailwind-merge (cn = (...cls) => twMerge(clsx(cls))) so consumer className overrides win predictably.
Structure a component library
components/ui/ # primitives: Button, Input, Card, Dialog (shadcn-style, headless-first)
components/patterns/ # composed patterns: FormField, DataTable, EmptyState
components/features/ # feature-specific, not reused elsewhere
lib/cn.tsBase primitives on unstyled/headless behavior (Radix primitives are the standard pairing with Tailwind) and layer Tailwind classes on top — don't reinvent focus trapping, keyboard nav, or ARIA roles.
Governance rules
- No arbitrary values (
w-[123px],text-[#3a3a3a]) in feature code — if the scale doesn't have it, add the token, don't escape the system. - One typographic scale (
text-xs→text-4xlmapped to real heading levels), documented in aTypographystories/reference, not redefined per page. - Spacing follows the 4px base scale everywhere; flag any component using raw margin/padding outside
p-*/m-*/gap-*utilities. - Every new primitive gets documented with its variant matrix (a short table: variant × size × state) before being reused across features.
Example prompt this skill should trigger on
"Set up a Tailwind design system for this SaaS app with light/dark themes and a Button, Card, and Input 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.

