--- name: frontend-design-system description: > Design and refactor React/Tailwind frontends using the project design system. Use this Skill when working on UI components, pages, layouts, or UX improvements and you want distinctive, accessible, non-generic designs that avoid AI slop. allowed-tools: Read, Grep, Glob --- # Frontend Design System Skill ## Purpose This Skill packages opinionated guidance for building and refactoring frontend UI so that output: - Uses the existing design system instead of ad-hoc styles. - Avoids generic “AI slop” UI and looks intentional and product-ready. - Meets accessibility, responsiveness, and basic performance expectations. Use this Skill whenever the user: - Asks for React/Tailwind components, HTML/CSS layouts, or UI redesigns. - Mentions design, UX, responsiveness, accessibility, or “make this look better”. - Wants to refactor messy or inconsistent frontend code. ## Tech stack assumptions Unless the user clearly states otherwise, assume: - Framework: React function components (with hooks, TypeScript when present). - Styling: Tailwind CSS with design tokens (CSS variables, theme config). - Layout: Mobile-first, using flexbox and grid. - Routing: Next.js or React Router style (do not invent routes unless requested). If the project uses a different stack (e.g. Svelte, Vue, plain HTML/CSS), keep the same design principles and adapt syntax. ## Design system rules When generating or editing UI, always: 1. **Use design tokens and theme** - Use semantic classes and variables for color (primary, secondary, accent, danger, surface, background, border, text). - Use the project spacing scale (e.g. `gap-2/3/4/6`, `p-4/6`, etc.) instead of arbitrary values. - Use only the established radii and shadows (e.g. `rounded-sm`, `rounded-md`, `shadow-sm`, `shadow-md`). 2. **Typography hierarchy** - Keep a clear hierarchy: page title, section title, body, caption. - Limit to 1–2 font stacks; never introduce new fonts unless the user asks. - Ensure line height and spacing are readable on mobile and desktop. 3. **Consistent component patterns** - Buttons: primary, secondary, subtle, destructive variants with consistent paddings and icon spacing. - Cards: shared padding, radius, shadow, header/body/footer patterns. - Forms: aligned labels, consistent input heights, clear error/help text styling. If the repo has existing tokens/components, inspect them first (using Read/Grep/Glob) and align with those patterns. ## Anti–AI slop guardrails Treat “AI slop” as any UI that is obviously default, generic, or visually incoherent. **Never:** - Use arbitrary rainbow gradients, neon glows, or random color mixes by default. - Spam shadows, borders, and animations without purpose. - Produce layouts that are just centered blobs of identical cards with no hierarchy. - Fill UI with meaningless placeholder content or fake stats unless explicitly requested. **Always:** - Provide a clear visual hierarchy: one primary action, visible section grouping, obvious reading order. - Use asymmetry and whitespace to create structure, not clutter. - Limit motion: subtle hover and focus states, and respect `prefers-reduced-motion`. Before finalizing any UI, mentally run a quick anti-slop checklist: - Does this look like a bland, default template? - Are color, typography, spacing, and radii consistent? - Is there a clear primary action and purpose in each section? If the answer is “yes, it looks generic” or “no, the hierarchy is unclear”, refactor the design. ## Accessibility requirements For all generated UI: - Use semantic HTML elements (`
`, `
`, `
`, `