moai-ref-react-patterns

Provides React and Next.js component design patterns, state management guidance, and quality standards.

Updated Aug 29, 2026
One-click install
npx skills add https://github.com/Seung-zedd/secure-file-upload --skill moai-ref-react-patterns-seung-zedd
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: moai-ref-react-patterns
Source: https://github.com/Seung-zedd/secure-file-upload/tree/main/.claude/skills/moai-ref-react-patterns
Command: npx skills add https://github.com/Seung-zedd/secure-file-upload --skill moai-ref-react-patterns-seung-zedd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Frontend developers often make inconsistent architectural decisions about component structure, state management, and data fetching in React and Next.js projects, leading to unmaintainable code, prop drilling, and misuse of useEffect for data fetching. ## Core Features & Use Cases - Component Design Patterns: Reference implementations for compound components, custom hooks, container/presentational separation, and headless components. - State Management Selection Guide: Decision flow for choosing between useState, React Query, Zustand, nuqs, and React Hook Form based on state type. - Quality Standards & Verification: Concrete checklists covering component size limits, error boundaries, accessibility requirements, and common rationalizations to avoid. - Use Case: When designing a new dashboard feature in a Next.js app, consult this reference to decide where server state versus client state lives, how to structure the route groups, and which performance patterns apply. ## Quick Start Ask the agent to design a React component structure for a dashboard feature using the patterns and state management guide from this reference.

Frequently Asked Questions about moai-ref-react-patterns

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

FAQPage Schema
How do I choose between Zustand and React Query for state management?▼

Use React Query for server state that needs caching, refetching, and optimistic updates. Use Zustand for global client state shared across components. The decision flow checks whether data is restorable from URL, comes from a server, or is component-internal.

How to structure a Next.js App Router project?▼

Organize routes with route groups like (auth) and (main) under src/app, place reusable UI in components/ui and feature components in components/features, and keep custom hooks, Zustand stores, and TypeScript types in dedicated directories.

Should I use useEffect for data fetching in React 19?▼

No. React 19 provides the use() hook and server components for data fetching. Using useEffect with fetch is a legacy pattern that causes request waterfalls and should be replaced with server components or React Query.

When should I split a React component?▼

Split components exceeding 200 lines or receiving more than 5 props. Group related props into objects, extract reusable logic into custom hooks with the use prefix, and separate data logic from presentational rendering.

What are the limitations of CSS-in-JS for React styling?▼

CSS-in-JS adds runtime overhead and increases bundle size. Tailwind or CSS Modules achieve equivalent style scoping without the runtime cost, and design tokens should replace inline styles and hardcoded pixel values.