--- name: frontend-master description: Master skill for frontend development with Next.js + React + Tailwind stack. Decision framework for choosing components, animations, assets, and tools. Routes to specialized skills for implementation details. Use as entry point for any frontend task. allowed-tools: Read, Edit, Write, Bash (*), Playwright MCP tools --- # Frontend Master Skill Unified decision framework for modern frontend development. **Stack:** Next.js 14+ (App Router) · React 18+ · Tailwind CSS · TypeScript · Framer Motion ## Quick Decision Matrix ```yaml WHAT DO YOU NEED? │ ├─► UI Components │ ├─ Basic (buttons, forms, dialogs) → shadcn/ui │ ├─ SaaS polish (tickers, marquees) → Magic UI [skill: frontend-magic-ui] │ └─ Dramatic effects (spotlight, 3D) → Aceternity [skill: frontend-aceternity] │ ├─► Animations │ ├─ Just plays/loops (loaders, feedback) → Lottie [skill: frontend-lottie] │ └─ Reacts to input (hover, data) → Rive [skill: frontend-rive] │ ├─► Assets │ ├─ Icons → Iconify/Lucide [skill: frontend-iconify] │ ├─ Avatars → DiceBear (FREE) [skill: frontend-image-generation] │ ├─ Photos → Unsplash (FREE) [skill: frontend-image-generation] │ └─ Illustrations → unDraw (FREE) [skill: frontend-image-generation] │ ├─► Theming │ ├─ Colors/palette → Color System [skill: frontend-color-system] │ └─ Typography → Google Fonts [skill: frontend-google-fonts] │ └─► Quality ├─ Code checks → Debug & Linting [skill: frontend-debug-linting] └─ Visual QA → Playwright [skill: frontend-playwright] ``` --- ## 1. Project Setup Checklist ```bash # New Next.js project npx create-next-app@latest my-app --typescript --tailwind --eslint --app # Essential dependencies npm install clsx tailwind-merge framer-motion npm install -D prettier eslint-config-prettier # UI foundation npx shadcn@latest init npx shadcn@latest add button card input dialog ``` ### Recommended Structure ``` src/ ├── app/ # Next.js App Router │ ├── layout.tsx # Root layout + fonts │ ├── page.tsx # Home page │ └── (routes)/ # Route groups ├── components/ │ ├── ui/ # shadcn components │ ├── magicui/ # Magic UI components │ └── [feature]/ # Feature components ├── lib/ │ ├── fonts.ts # Font configuration │ ├── utils.ts # cn() helper │ └── constants.ts # App constants ├── styles/ │ └── globals.css # Tailwind + CSS vars └── public/ ├── animations/ # .lottie, .riv files ├── icons/ # Downloaded SVGs └── images/ # Static images ``` --- ## 2. Component Selection Guide ### UI Components Decision Tree ```yaml Need a component? │ ├─► Form element (input, select, checkbox) │ └─► shadcn/ui — accessible, unstyled base │ ├─► Data display (table, card, list) │ └─► shadcn/ui — consistent patterns │ ├─► Marketing/Landing page │ ├─► Stats/numbers → Magic UI: NumberTicker │ ├─► Logo carousel → Magic UI: Marquee │ ├─► Feature grid → Magic UI: BentoGrid │ ├─► Hero spotlight → Aceternity: Spotlight, Aurora │ ├─► 3D hover cards → Aceternity: 3DCard │ ├─► Text reveal → Aceternity: TextGenerateEffect │ └─► Device mockup → Magic UI: Safari, iPhone │ └─► Interactive element ├─► Simple hover/focus → Tailwind transitions ├─► Complex entrance → Framer Motion └─► State machine → Rive ``` ### Animation Decision Tree ```yaml Animation needed? │ ├─► Does it react to user input? │ ├─ NO → Lottie (just plays) │ └─ YES → Does it have multiple states? │ ├─ Simple hover → CSS/Framer Motion │ └─ Complex states → Rive │ ├─► What type? │ ├─ Loading spinner → Lottie │ ├─ Success/error → Lottie │ ├─ Empty state illustration → Lottie │ ├─ Animated toggle/checkbox → Rive │ ├─ Progress driven by data → Rive │ └─ Hero background effect → Aceternity ``` **Quick Reference:** | Need | Solution | |------|----------| | Loader spinner | Lottie | | Success checkmark | Lottie | | Animated button | Rive | | Data-driven progress | Rive | | Hero spotlight | Aceternity | | Number ticker | Magic UI | --- ## 3. Styling Best Practices ### Tailwind Patterns ```tsx // ✅ Use cn() for conditional classes import { cn } from "@/lib/utils" ) } ``` ### Stats Section ```tsx 'use client' import { NumberTicker } from '@/components/magicui/number-ticker' const stats = [ { value: 10000, label: 'Users', suffix: '+' }, { value: 99.9, label: 'Uptime', suffix: '%' }, { value: 50, label: 'Countries', suffix: '+' }, ] export function Stats() { return (
{stats.map(stat => (
{stat.suffix}
{stat.label}
))}
) } ``` --- ## External Resources - **shadcn/ui:** https://ui.shadcn.com - **Tailwind CSS:** https://tailwindcss.com/docs - **Next.js:** https://nextjs.org/docs - **Framer Motion:** https://www.framer.com/motion - **Magic UI:** https://magicui.design - **Aceternity:** https://ui.aceternity.com - **LottieFiles:** https://lottiefiles.com - **Rive:** https://rive.app For latest API of any library → use context7 skill