affaan-m avatar

Frontend Patterns

A solid reference for React patterns you'll actually use in production. Covers component composition (compound components, render props), custom hooks with proper dependency management, and context-plus-reducer for state. The examples are clean and show both the pattern and real usage. Especially useful for the performance optimization section with useMemo and useCallback patterns that avoid common pitfalls like infinite render loops. The useQuery hook implementation is a good teaching example if you're building your own data fetching before reaching for a library. Skips the basics and focuses on intermediate patterns you'd encounter building real apps with Next.js or similar frameworks.

skills.sh installs
7.1K
GitHub stars
300.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add affaan-m/ecc --skill frontend-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

Frontend Development Patterns

Modern frontend patterns for React, Next.js, and performant user interfaces.

When to Activate

  • Building React components (composition, props, rendering)
  • Managing state (useState, useReducer, Zustand, Context)
  • Implementing data fetching (SWR, React Query, server components)
  • Optimizing performance (memoization, virtualization, code splitting)
  • Working with forms (validation, controlled inputs, Zod schemas)
  • Handling client-side routing and navigation
  • Building accessible, responsive UI patterns

Component Patterns

Composition Over Inheritance

// PASS: GOOD: Component composition
interface CardProps {
  children: React.ReactNode
  variant?: 'default' | 'outlined'
}

export function Card({ children, variant = 'default' }: CardProps) {
  return <div className={`card card-${variant}`}>{children}</div>
}

export function CardHeader({ children }: { children: React.ReactNode }) {
  return <div className="card-header">{children}</div>
}

export function CardBody({ children }: { children: React.ReactNode }) {
  return <div className="card-body">{children}</div>
}

Sponsors

Details

Repository
github.com/affaan-m/ecc
Categories
Frontend Development, Debugging
First seen
Jul 14, 2026

More from affaan-m/ecc

All 263
1pixijs avatarpixijs-scene-dom-containerpixijs/pixijs-skillsUse this skill when overlaying HTML elements on the PixiJS v8 canvas. Covers DOMContainer with element, anchor, and scene-graph-driven CSS transforms, the pixi.6.7Kskills.sh installs
2jeffallan avatarnextjs-developerjeffallan/claude-skillsUse when building Next.js 14+ applications with App Router, server components, or server actions. Invoke to configure route handlers, implement middleware, set 6Kskills.sh installs
3affaan-m avatarreact-patternsaffaan-m/eccReact 18/19 patterns including hooks discipline, server/client component boundaries, Suspense + error boundaries, form actions, data fetching, state management 5.9Kskills.sh installs
4affaan-m avatarreact-testingaffaan-m/eccReact component testing with React Testing Library, Vitest/Jest, MSW for network mocking, accessibility assertions with axe, and the decision boundary between c5.8Kskills.sh installs
5affaan-m avatarfrontend-a11yaffaan-m/eccAccessibility patterns for React and Next.js — semantic HTML, ARIA attributes, form labeling, keyboard navigation, focus management, and screen reader support. 5.8Kskills.sh installs
6jeffallan avatarreact-expertjeffallan/claude-skillsUse when building React 18+ applications in .jsx or .tsx files, Next.js App Router projects, or create-react-app setups. Creates components, implements custom h5.8Kskills.sh installs