- name
- design-system-ui
- description
- Create distinctive, production-grade frontend interfaces with high design quality using Mobile First strategy. Analyzes design systems from screenshots, generates Tailwind CSS + Shadcn UI configurations, and retrofits existing projects. Optimized for Claude Opus 4.5 with structured decision trees and self-verification checkpoints.
# Design System UI
> **For Claude Opus 4.5**: This skill leverages your advanced reasoning and creative capabilities. Use the decision trees for rapid technical choices, and the checkpoints for self-verification.
Transform design references into distinctive, production-ready Tailwind CSS + Shadcn UI projects.
> ๐ฑ **Default Strategy: Mobile First** โ All new projects use Mobile First by default. Design for mobile viewport first, then progressively enhance for larger screens.
---
## ๐ง Execution Strategy
**Before starting, determine your execution path:**
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ DECISION: What type of task is this? โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ A) NEW PROJECT from design reference โ
โ โ Execute: Steps 0 โ 1 โ 2 โ 3 โ 4 โ 5 โ 6 โ
โ โ Focus: Creative interpretation + technical scaffolding โ
โ โ ๐ฑ DEFAULT: Mobile First strategy โ
โ โ
โ B) RETROFIT existing project with new theme โ
โ โ Execute: Steps 0 โ 3 โ 7 โ 7.5 โ 8 โ 9 โ 10 โ 11 โ
โ โ Focus: Systematic audit + replacement + verification โ
โ โ ๐ฑ DETECT: Check for Mobile First โ Ask if not found โ
โ โ
โ C) FIX theme/color issues in existing project โ
โ โ Execute: Troubleshooting section โ targeted fixes โ
โ โ Focus: Diagnosis + minimal surgical changes โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
### Mobile First Strategy Decision Tree
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ฑ MOBILE FIRST DETECTION (for Retrofit projects) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ Run detection commands: โ
โ grep -rn "sm:" src/ | head -20 โ
โ grep -rn "md:" src/ | head -20 โ
โ grep -rn "@media.*min-width" src/ | head -10 โ
โ โ
โ Analyze results: โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Mobile First indicators found? โ โ
โ โ (Base styles for mobile, sm:/md:/lg: for larger screens) โ โ
โ โ โ โ
โ โ YES โ Continue with Mobile First strategy โ โ
โ โ Maintain and enhance existing patterns โ โ
โ โ โ โ
โ โ NO โ Desktop First detected (max-width media queries) โ โ
โ โ Or no responsive patterns at all โ โ
โ โ โ ASK USER: โ โ
โ โ "ๆฏๅฆ้่ฆๅฐ้กน็ฎๆน้ ไธบ Mobile First ๅๅบๅผ็ญ็ฅ๏ผ โ โ
โ โ ่ฟๅฐไผๅ็งปๅจ็ซฏไฝ้ช๏ผไฝ้่ฆ้ๆ็ฐๆๆญ็น้ป่พใ" โ โ
โ โ โ โ
โ โ User says YES โ Execute Mobile First Retrofit โ โ
โ โ User says NO โ Preserve existing responsive logic โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
### Tool Usage Strategy
| Task | Primary Tools | Usage Pattern |
|------|---------------|---------------|
| **Analyze design** | `read_file` (image) | Read screenshot, extract tokens |
| **Check Tailwind version** | `grep` | `grep '"tailwindcss"' package.json` |
| **Detect Mobile First** | `grep` | `grep -rn "sm:\|md:\|lg:" src/` |
| **Audit hardcoded colors** | `grep` | Pattern scan across `src/` |
| **Apply changes** | `search_replace` | Targeted replacements |
| **Verify changes** | `mcp_browser_*` | Visual verification in browser |
---
## ๐จ Step 0: Creative Design Thinking
> **THINK**: Before writing any code, pause and commit to a BOLD aesthetic direction.
### Design Context Questions
| Dimension | Question | Your Answer |
|-----------|----------|-------------|
| **Purpose** | What problem does this interface solve? Who uses it? | _Think this through_ |
| **Tone** | Which extreme aesthetic direction? (see library below) | _Commit to ONE_ |
| **Differentiation** | What makes this UNFORGETTABLE? | _Be specific_ |
| **๐ฑ Mobile First** | Design for mobile viewport first. How does this enhance UX? | _Default: YES_ |
### ๐ฑ Mobile First Mindset
**For NEW projects, always start with:**
- Base styles = mobile viewport (< 640px)
- `sm:` = small tablets (โฅ 640px)
- `md:` = tablets/small laptops (โฅ 768px)
- `lg:` = desktops (โฅ 1024px)
- `xl:` / `2xl:` = large screens (โฅ 1280px / โฅ 1536px)
```tsx
// โ
Mobile First (correct)
<div className="flex flex-col md:flex-row">
<div className="w-full md:w-1/2 lg:w-1/3">
<p className="text-sm md:text-base lg:text-lg">
// โ Desktop First (avoid)
<div className="flex flex-row md:flex-col"> // Adding mobile styles later
```
### Aesthetic Direction Library
**Choose ONE and execute with conviction** (bold maximalism and refined minimalism both work - the key is intentionality):
| Style | Characteristics | Use When |
|-------|-----------------|----------|
| **Brutally Minimal** | Extreme whitespace, monochrome, no decoration | Developer tools, pro apps |
| **Maximalist Chaos** | Color explosion, complex layers, dense motion | Creative, entertainment |
| **Retro-Futuristic** | Cyberpunk, neon gradients, tech feel | Games, tech products |
| **Luxury/Refined** | Gold accents, serif fonts, exquisite details | Premium, finance |
| **Playful/Toy-like** | Rounded shapes, high saturation, bouncy motion | Children, social apps |
| **Editorial/Magazine** | Big type, grid systems, generous whitespace | Content, blogs |
| **Brutalist/Raw** | Thick borders, hard shadows, high contrast | Art, indie brands |
### โ ๏ธ Anti-Patterns (AI Slop)
**NEVER use these defaults:**
- Inter, Roboto, Arial, Space Grotesk as primary fonts
- Purple gradients on white backgrounds
- Cookie-cutter rounded corners everywhere
- Safe, middle-of-the-road color choices
---
## Step 1: Analyze Design Reference
Accept input as: Screenshots, Figma exports, URLs, or verbal descriptions.
### Extraction Checklist
```
Colors: Primary โ Secondary โ Accent โ Neutral scale โ Semantic
Typography: Display font โ Body font โ Weights โ Sizes โ Line heights
Spacing: Base unit โ Component padding โ Section margins
Visual: Border radius โ Shadow style โ Animation mood
Details: Gradients โ Textures โ Patterns โ Overlays
```
### ๐ Self-Check: Design Analysis
Before proceeding, verify you have extracted:
- [ ] At least 5 distinct color values (primary, secondary, accent, muted, destructive)
- [ ] Font family choices that are NOT Inter/Roboto/Arial
- [ ] A clear visual mood direction
---
## Step 2: Generate Design Tokens
Convert analysis into structured tokens. Use HSL format for Tailwind compatibility.
```typescript
const designTokens = {
colors: {
primary: { DEFAULT: "hsl(H S% L%)", foreground: "hsl(...)" },
secondary: { DEFAULT: "hsl(...)", foreground: "hsl(...)" },
accent: { DEFAULT: "hsl(...)", foreground: "hsl(...)" },
muted: { DEFAULT: "hsl(...)", foreground: "hsl(...)" },
destructive: { DEFAULT: "hsl(...)", foreground: "hsl(...)" },
background: "hsl(...)",
foreground: "hsl(...)",
border: "hsl(...)",
},
typography: {
sans: ["Your Choice", "system-ui", "sans-serif"],
display: ["Your Display Font", "sans-serif"],
},
borderRadius: { sm: "...", DEFAULT: "...", lg: "..." },
};
```
---
## Step 3: Tailwind Version Decision Tree โ ๏ธ CRITICAL
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FIRST: Check Tailwind version โ
โ Command: grep '"tailwindcss"' package.json โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ Version 3.x? โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โ โ Configuration location: tailwind.config.js โ
โ โ Dark mode: darkMode: "class" โ
โ โ CSS variable format: --primary: 262 83% 58% โ
โ โ Color reference: hsl(var(--primary)) โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ Version 4.x? โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โ โ Configuration location: CSS @theme inline โ
โ โ Dark mode: @variant dark (&:where(.dark, .dark *)) โ
โ โ CSS variable format: --primary-color: hsl(262 83% 58%) โ
โ โ Color reference: var(--primary-color) โ
โ โ Color naming: MUST use --color-* prefix in @theme โ
โ โ โ
โ โ โ ๏ธ tailwind.config.js colors will be IGNORED in v4! โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
### Tailwind v4 CSS Template
```css
@import "tailwindcss";
@theme inline {
--radius-lg: 0.75rem;
--radius-md: calc(0.75rem - 2px);
--radius-sm: calc(0.75rem - 4px);
--color-background: var(--background-color);
--color-foreground: var(--foreground-color);
--color-primary: var(--primary-color);
--color-primary-foreground: var(--primary-foreground-color);
--color-secondary: var(--secondary-color);
--color-secondary-foreground: var(--secondary-foreground-color);
--color-muted: var(--muted-color);
--color-muted-foreground: var(--muted-foreground-color);
--color-accent: var(--accent-color);
--color-accent-foreground: var(--accent-foreground-color);
--color-destructive: var(--destructive-color);
--color-destructive-foreground: var(--destructive-foreground-color);
--color-card: var(--card-color);
--color-card-foreground: var(--card-foreground-color);
--color-popover: var(--popover-color);
--color-popover-foreground: var(--popover-foreground-color);
--color-border: var(--border-color);
--color-input: var(--input-color);
--color-ring: var(--ring-color);
}
@variant dark (&:where(.dark, .dark *));
@layer base {
:root {
/* Light mode - USE FULL hsl() VALUES */
--background-color: hsl(H S% L%);
--foreground-color: hsl(H S% L%);
--primary-color: hsl(H S% L%);
--primary-foreground-color: hsl(H S% L%);
/* ... complete all semantic colors ... */
}
.dark {
/* Dark mode variants */
--background-color: hsl(H S% L%);
--foreground-color: hsl(H S% L%);
/* ... complete all semantic colors ... */
}
}
```
---
## Step 4-6: Project Setup
Standard Shadcn UI setup. Configure `components.json`, create project structure.
---
## ๐ง Retrofit Workflow (Steps 7-11)
> For existing projects, execute this complete flow systematically.
### Step 7: Audit Hardcoded Colors
**Execute these grep commands BEFORE making any changes:**
```bash
# Primary audit
grep -rn "bg-gray-" src/
grep -rn "text-gray-" src/
grep -rn "border-gray-" src/
grep -rn "bg-white" src/
grep -rn "bg-black" src/
# Secondary audit
grep -rn "bg-blue-\|text-blue-" src/
grep -rn "bg-red-\|text-red-" src/
grep -rn "bg-green-\|text-green-" src/
```
### Step 7.5: ๐ฑ Mobile First Detection & Decision
**Execute detection commands:**
```bash
# Check for Mobile First indicators
grep -rn "sm:" src/ | wc -l
grep -rn "md:" src/ | wc -l
grep -rn "lg:" src/ | wc -l
# Check for Desktop First indicators (max-width = desktop first)
grep -rn "@media.*max-width" src/ | head -5
# Sample responsive patterns
grep -rn "flex.*sm:\|flex.*md:" src/ | head -10
```
**Analyze the results:**
| Indicator | Mobile First | Desktop First |
|-----------|--------------|---------------|
| Base styles | Mobile layout (stack, full-width) | Desktop layout (row, fixed-width) |
| Breakpoint usage | `sm:`, `md:`, `lg:` for enhancements | `max-width` media queries |
| CSS pattern | Progressive enhancement | Graceful degradation |
**Decision flow:**
```
Mobile First detected?
โโ YES โ Continue with Mobile First strategy
โ Use mobile-base + sm:/md:/lg: enhancements
โ
โโ NO โ ASK USER:
"ๆฃๆตๅฐ้กน็ฎๆช้็จ Mobile First ็ญ็ฅใ
ๆฏๅฆ้่ฆๆน้ ไธบ Mobile First ๅๅบๅผ่ฎพ่ฎก๏ผ
ไผ็น๏ผ
โ ๆดๅฅฝ็็งปๅจ็ซฏๆง่ฝ๏ผๅ ่ฝฝๆดๅฐ็่ฆ็ๆ ทๅผ๏ผ
โ ไผๅ
ไฟ่ฏ็งปๅจ็จๆทไฝ้ช
โ ็ฌฆๅ็ฐไปฃๅๅบๅผ่ฎพ่ฎกๆ ๅ
็ผบ็น๏ผ
โ ้่ฆ้ๆ็ฐๆๆญ็น้ป่พ
โ ๅฏ่ฝๅฝฑๅ็ฐๆๆก้ขๅธๅฑ"
User: YES โ Execute Mobile First Retrofit (see below)
User: NO โ Skip Mobile First, continue with theme retrofit only
```
### Mobile First Retrofit (if user confirms)
**Common transformations:**
| Desktop First Pattern | Mobile First Pattern |
Auf GitHub ansehen