SKILL.md
Frontend Design Skill
AI-generated UI has a recognisable smell: default blues, five different paddings, everything the same visual weight, no states. This skill produces interfaces that look decided — by making the decisions explicit as a token system, then spending contrast deliberately instead of everywhere.
What This Skill Produces
- Working UI code (single-file HTML/CSS or framework components) built on an explicit token block
- The token system: type scale, spacing scale, color roles, radius/shadow levels — small and consistent
- The states: hover, focus-visible, active, disabled, empty, loading, error — designed, not defaulted
Required Inputs
Ask for (if not already provided):
- What's being built and its emotional register (dense pro tool? calm consumer? playful?)
- Brand constraints if any (colors, fonts, an existing product to match) — else the skill picks a deliberate palette and says so
- The framework target (vanilla/React/Vue/Tailwind) — vanilla single-file is the default demo form
The System (build this first, then the UI)
- Type scale, one ratio. Pick a base (16px) and a ratio (1.25 for product UI, 1.333 for marketing); derive 5-6 sizes max. Two font families ceiling (one is usually right); weight does hierarchy work before size does.
- Spacing on a single scale. 4-or-8px base:
4/8/12/16/24/32/48/64. Every margin/padding/gap comes FROM the scale — the #1 tell of undesigned UI is seventeen distinct paddings. Related things sit closer than unrelated things (proximity is free information design). - Color as roles, not decoration. Define roles:
bg / surface / border / text / text-muted / accent / danger / success. ONE accent, spent where attention belongs — the primary action, the active state, the number that matters. The 90% of a designed UI is neutrals; if everything is colorful, nothing is. Check text contrast (4.5:1 body, 3:1 large) as you pick, not after. - Depth and shape, one voice. 2-3 shadow levels, 2 radius values — used consistently by element class (inputs share a radius; cards share a shadow). Mixed radii on sibling elements reads as accident, because it is.
