Comprehensive Cc Skill Frontend
Comprehensive skill designed for frontend, development, patterns, react. Includes structured workflows, validation checks, and reusable patterns for development.
Comprehensive Claude Code Skill ā Frontend Patterns
A Claude Code skill providing modern frontend development patterns for React, Next.js, and performant user interfaces. Covers component architecture, state management, data fetching, performance optimization, and accessibility ā following composition-over-inheritance principles.
When to Use This Skill
Choose CC Skill Frontend Patterns when:
- You need established patterns for React/Next.js development
- You want best practices for component composition and state management
- You're implementing data fetching, caching, or real-time updates
- You need performance optimization guidance for frontend applications
- You want consistent frontend patterns across your codebase
Consider alternatives when:
- You need backend patterns (use a backend patterns skill)
- You want visual design direction (use a design/UI skill)
- You need mobile-specific patterns (use a mobile design skill)
Quick Start
# Install the skill claude install comprehensive-cc-skill-frontend # Apply component patterns claude "Refactor this component using composition pattern: [paste monolithic component]" # Optimize performance claude "This page has a 4-second LCP. Here's the component: [paste]. How do I optimize it?" # Implement data fetching claude "Implement data fetching with React Query for a paginated list of products with optimistic updates"
Core Concepts
Component Composition
// ā GOOD: Composable components <Card> <CardHeader> <CardTitle>Dashboard</CardTitle> <CardActions><Button>Edit</Button></CardActions> </CardHeader> <CardBody> <DataTable data={data} /> </CardBody> </Card> // ā BAD: Monolithic prop-driven <Card title="Dashboard" actions={[{ label: 'Edit', onClick: handleEdit }]} bodyContent={<DataTable data={data} />} />
State Management Decision Tree
Is this state...
āāā Only used by one component?
ā ā useState
āāā Shared between parent and child?
ā ā Lift state up + props
āāā Shared between distant components?
ā ā Context (if rarely changes) or Zustand (if changes often)
āāā Server data (API responses)?
ā ā React Query / SWR
āāā URL state (filters, pagination)?
ā ā URL search params / router state
āāā Form state?
ā React Hook Form
Performance Patterns
| Pattern | When to Use | Implementation |
|---|---|---|
| Code Splitting | Large routes/features | React.lazy() + Suspense |
| Memoization | Expensive computations | useMemo, React.memo |
| Virtualization | Long lists (100+ items) | react-window, @tanstack/virtual |
| Image Optimization | Any page with images | Next.js <Image>, lazy loading |
| Bundle Analysis | Regular performance audits | @next/bundle-analyzer |
| Streaming SSR | Initial page load speed | Next.js App Router streaming |
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
framework | string | "nextjs" | Framework: nextjs, remix, vite_react |
state_management | string | "react_query" | State: react_query, zustand, redux, context |
styling | string | "tailwind" | Styling: tailwind, css_modules, styled |
form_library | string | "react_hook_form" | Forms: react_hook_form, formik |
testing | string | "vitest" | Testing: vitest, jest, playwright |
Best Practices
-
Composition over configuration ā Build components that accept children and compose with other components rather than components with many props.
<Dialog><DialogTitle /><DialogBody /><DialogActions /></Dialog>is more flexible than<Dialog title="" body="" actions={[]}/>. -
Use React Query for all server state ā Don't store API data in useState or Redux. React Query handles caching, refetching, optimistic updates, and error states automatically. Your components become simpler and your data is always fresh.
-
Co-locate state with usage ā Keep state as close to where it's used as possible. If only one component needs a value, use local state. Only lift state or use global stores when genuinely necessary for cross-component coordination.
-
Optimize images aggressively ā Images are typically the largest page assets. Use Next.js Image component for automatic optimization, serve WebP format, lazy-load below-fold images, and specify width/height to prevent layout shift.
-
Measure before optimizing ā Use React DevTools Profiler to identify actual bottlenecks. Most performance problems come from 2-3 components, not the entire app. Focus optimization where profiling data shows the most impact.
Common Issues
Component re-renders too often ā Use React DevTools to identify which state changes trigger re-renders. Common fixes: lift state down instead of up, use React.memo for expensive pure components, and avoid creating new objects/arrays in render.
Hydration mismatch errors ā Server and client rendering produce different HTML. Common causes: using Date.now() or Math.random() during render, accessing window or localStorage during SSR, and conditional rendering based on client-only data.
Bundle size too large ā Analyze with @next/bundle-analyzer or source-map-explorer. Common bloat: importing entire libraries (import _ from 'lodash' instead of import debounce from 'lodash/debounce'), unused dependencies, and large polyfills.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Full-Stack Code Reviewer
Comprehensive code review skill that checks for security vulnerabilities, performance issues, accessibility, and best practices across frontend and backend code.
Test Suite Generator
Generates comprehensive test suites with unit tests, integration tests, and edge cases. Supports Jest, Vitest, Pytest, and Go testing.
Pro Architecture Workspace
Battle-tested skill for architectural, decision, making, framework. Includes structured workflows, validation checks, and reusable patterns for development.