frontend-design
SKILL.md
CORE PHILOSOPHY
Your mission is to prevent "Design Drift" and "UI Pollution". AI code often takes the path of least resistance by using raw tags (div, button) or arbitrary Tailwind values. You must proactively steer implementation toward the established design system (shadcn/ui) and token scale.
OUTPUT FORMAT (MANDATORY)
FILE: <file_path>
SEVERITY: CRITICAL | WARNING | INFO
RULE: <rule-id>
MESSAGE: <short-description>
LINE: <line-number>
SUGGESTION: <how-to-fix>
---
If no issues: FILE: <file_path>\nSTATUS: PASSED\n---
REVIEW DIMENSIONS
1. Token Integrity (Tailwind Scalability)
- Arbitrary Values: Proactively flag any usage of
-[...](e.g.,p-[9px],w-[325px]). These break site-wide consistency.- Scan Strategy:
grep_searchfor-\[.
- Scan Strategy:
- Raw Color Hardcoding: Flag hex codes, RGB, or specific Tailwind color shades (e.g.,
text-slate-400). Encourage semantic tokens liketext-muted-foreground,bg-primary, etc. - Spacing Balance: Look for uneven padding/margins that deviate from the 4px/8px grid system.
2. Design System Enforcement (No Reinventing the Wheel)
- Primitive Leakage: Proactively find raw
<button>,<input>,<table,<select>,<dialog>, etc. These MUST be replaced by equivalents from the project's component library (e.g., shadcn/ui) to ensure theme support and accessibility. - Discovery: Before suggesting imports, verify the location of components (e.g., often in
@/components/ui,src/components/ui, orpackages/ui). - Shadow Implementations: Look for custom components or complex
divstructures that mimicTabs,Accordion,Popover,Badge, orModal. If it looks like a standard UI element, it should BE a component library element. - Variant Misuse: Flag cases where a developer adds 10+ utility classes to a system component to change its base look (e.g.,
<Button className="bg-red-500 rounded-none shadow-none ...">) instead of adding a newvariantor using an existing one.
3. Motion & Interaction (Framer Motion)
- Raw Transitions: Identify elements with simple CSS
transitionif the project usesframer-motion. Suggestmotion.divfor more premium, spring-based interactions. - Missing Polish: Proactively suggest
AnimatePresencefor exit animations orwhileHover/whileTapfor interactive elements to improve the "premium" feel. - Interaction Accessibility: Ensure
motionelements that act as buttons have proper keyboard listeners or are wrapped in a semantic focusable element.
4. Code Hygiene for Styles
- Template Literal Bloat: Flag messy conditional class strings. Enforce the use of
cn(...)from@/lib/utilsfor clean Tailwind merging. - Inlined Style Tags: CRITICAL violation. Flag
style={{ ... }}except for truly dynamic values (like coordinates from a mouse event).
WORKFLOW
- Structural Visual Scan: Use
view_fileto look at the JSX structure. Does it look like a "generic" implementation (lots of primitives) or a "systemic" one (using library components)? - Proactive Replacement Search:
- Search for raw HTML primitives (
<button,<input, etc). - Search for "ad-hoc" styling patterns:
grep_searchfor-\[,#[0-9a-f],style=\{\{.
- Search for raw HTML primitives (
- Motion Review: Check if interactive elements feel "static". Suggest Framer Motion enhancements where appropriate.
- Synthesize Findings: Provide specific code replacements using shadcn/ui syntax.
RULES OF THUMB
-
Critical: Raw hex/RGB colors, inline
style={...}tags, arbitrary-[...]values. -
Warning: Using raw HTML tags instead of shadcn/ui components, complex manual CSS transitions instead of motion.
-
Info: Improving
cn()usage, adding subtle hover micro-animations.
Weekly Installs
1
Repository
sweetretry/skillsFirst Seen
Feb 7, 2026
Security Audits
Installed on
amp1
opencode1
cursor1
kimi-cli1
codex1
github-copilot1