Advanced React patterns, performance optimization, and state management rules.
Scanned 2/12/2026
Install via CLI
openskills install majiayu000/claude-skill-registry---
name: frontend_mastery
description: Advanced React patterns, performance optimization, and state management rules.
allowed-tools: Read, Edit, Write
---
# Frontend Mastery Protocol (React + Vite + Tailwind)
## 1. Performance "Pro" Checklist
**Before submitting any UI component, verify:**
- [ ] **Re-renders**: Are we re-rendering unnecessarily? Use `React.memo` or `useCallback` for stable props.
- [ ] **Lazy Loading**: Are strict routes lazy-loaded? (`React.lazy`)
- [ ] **Image Optimization**: Are images using proper formats (WebP/AVIF) and `loading="lazy"`?
- [ ] **Zustand Selectors**: Are we selecting _only_ what we need?
- ❌ `const { user, token } = useAuthStore()`
- ✅ `const user = useAuthStore((s) => s.user)`
- [ ] **Bundle Size**: Did we import a huge library for one function? (e.g. import `lodash` vs `lodash/debounce`)
## 2. State Management Rules (Zustand + React Query)
- **Server State**: MUST use `React Query`.
- NEVER store server data in global Zustand store manually (unless caching for UI sync).
- Use `staleTime` and `cacheTime` appropriately.
- **Client State**: Use `Zustand` for global, `useState` for local.
- Avoid "Prop Drilling" > 2 levels. Use Context or Zustand.
## 3. Architectectural Patterns
- **Container/Presenter**: Separate logic (Hooks) from View (JSX).
- Complex components should have a custom hook (e.g., `useComponentLogic.ts`).
- **Composition**: Use `children` prop instead of passing components as props where possible.
- **Custom Hooks**: Extract reusable logic immediately. `useBoolean`, `useToggle`, etc.
## 4. Code Quality & Formatting
- **Naming**: `use[Action]` for hooks, `handle[Event]` for handlers.
- **CSS (Tailwind)**:
- Group layout (`flex`, `grid`) first, then spacing, then visual (`bg`, `text`).
- Use `clsx` or `tailwind-merge` for conditional classes.
- NO inline styles (`style={{}}`) except for dynamic coordinates.
## 6. Error Boundaries
- Critical UI parts MUST have an `<ErrorBoundary>`.
- Async components (Suspense) must handle loading states gracefully.
No comments yet. Be the first to comment!
Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.
SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.
Python backend development expertise for FastAPI, security patterns, database operations, Upstash integrations, and code quality. Use when: (1) Building REST APIs with FastAPI, (2) Implementing JWT/OAuth2 authentication, (3) Setting up SQLAlchemy/async databases, (4) Integrating Redis/Upstash caching, (5) Refactoring AI-generated Python code (deslopification), (6) Designing API patterns, or (7) Optimizing backend performance.
Drive the full internationalization journey for a project — detect the stack, recommend a library, set up the chosen library, wrap existing strings, and optionally connect a translation platform. Use when the user asks to add or configure i18n, internationalization, localization, multi-language support, or translations — including when they explicitly mention LinguiJS, Lingui, next-intl, "wrap strings", "find hardcoded text", "make my app translatable", or "set up translations". Triggers on g...
PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.