ecc-react-patterns

Guides writing and reviewing React 18/19 components using hooks discipline, state placement, and accessibility patterns.

Updated May 26, 2026
One-click install
npx skills add https://github.com/avel123111/triplanio --skill ecc-react-patterns-avel123111
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ecc-react-patterns
Source: https://github.com/avel123111/triplanio/tree/main/.claude/skills/ecc-react-patterns
Command: npx skills add https://github.com/avel123111/triplanio --skill ecc-react-patterns-avel123111

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React codebases often accumulate anti-patterns like derived state in useEffect, misplaced global stores, missing error boundaries, and inaccessible markup. This Skill provides decision trees and concrete code patterns so components are written and reviewed against consistent React 18/19 idioms. ## Core Features & Use Cases - Hooks and State Discipline: Enforces top-level hook calls, cleanup of subscriptions, functional state updaters, and a decision tree for choosing between useState, lifted state, Context, external stores, and server-state libraries. - Server/Client Component Boundaries: Covers RSC composition, Suspense and error boundary placement, React 19 form actions with useActionState, and optimistic UI with useOptimistic. - Data Fetching and Performance: Provides a decision matrix for TanStack Query, SWR, and RSC fetch, plus guidance on React.memo, context splitting, list virtualization, and accessibility-first composition. - Use Case: When reviewing a pull request that fetches data inside useEffect and stores derived totals in state, use this Skill to rewrite the component with TanStack Query and render-time derivation. ## Quick Start Ask the assistant to review your React component or design a new one using the React patterns skill, for example by requesting a form built with React 19 actions and proper error boundaries.

Frequently Asked Questions about ecc-react-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between useState, Context, and Zustand in React?

Use useState for single-component state, lift state to the nearest common ancestor for shared subtrees, Context for low-frequency cross-tree values like theme or auth, and an external store like Zustand for high-frequency updates shared across the tree.

How do I fetch data in React without useEffect?

Use TanStack Query or SWR for client-side caching and invalidation, or await fetch directly in React Server Components. Avoid useEffect plus fetch because it introduces race conditions, no cache, no retry, and no Suspense integration.

When should I use React.memo and useMemo?

Apply React.memo only when a component re-renders frequently, its props are usually unchanged, and its render is measurably expensive. The default position is to not memoize; add useMemo or useCallback only when a profiler or dependency chain proves it matters.

Can I import a Server Component into a Client Component?

No, you cannot import a Server Component from a Client Component file. Instead compose them by passing the Server Component as children or props into the Client Component, keeping the boundary serializable.

Why is storing derived state in useEffect a problem?

Derived state in useEffect adds an extra render cycle, can desynchronize from source data, and obscures data flow. Compute derived values directly during render, such as reducing cart items into a total inside the component body.

Does this skill cover Next.js App Router specifics?

No, Next.js specifics like Route Handlers, Middleware, and Parallel Routes are explicitly out of scope. The skill covers router-agnostic React core patterns and points to Next.js documentation for framework-level concerns.