frontend-patterns

Guide React and Next.js development with component, hook, and performance patterns.

1|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/ndhananj/codex-agent-setup --skill frontend-patterns-ndhananj
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frontend-patterns
Source: https://github.com/ndhananj/codex-agent-setup/tree/main/docs/zh-CN/skills/frontend-patterns
Command: npx skills add https://github.com/ndhananj/codex-agent-setup --skill frontend-patterns-ndhananj

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a comprehensive guide to modern frontend development patterns, helping developers build maintainable, performant, and accessible user interfaces with React and Next.js.

Core Features & Use Cases

  • Component Patterns: Demonstrates composition, compound components, and render props.
  • Custom Hooks: Illustrates patterns for state management, async data fetching, and debouncing.
  • State Management: Explains Context API with Reducer for complex state.
  • Performance Optimization: Covers memoization, code splitting, and virtualization.
  • Form Handling: Shows controlled forms with validation.
  • Error Handling: Implements Error Boundaries.
  • Animations: Integrates Framer Motion.
  • Accessibility: Details keyboard navigation and focus management.
  • Use Case: A developer can use this Skill to quickly implement best practices for building a new feature in a React/Next.js application, ensuring it's performant, accessible, and maintainable.

Quick Start

Review the component patterns section to understand how to structure React components effectively.

Frequently Asked Questions about frontend-patterns

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

FAQPage Schema
How do I optimize React and Next.js performance for large UI components?

Manage complex state in React using the Context API combined with a Reducer pattern. This approach centralizes state logic, making your application's data flow predictable and your components easier to maintain without prop drilling.

How do I handle async data fetching and debouncing in custom hooks?

Handle async data fetching and debouncing by creating custom hooks that encapsulate these logic patterns. This separation simplifies your components, manages side effects cleanly, and ensures efficient data retrieval without overwhelming your backend with rapid requests.

What is the best way to implement accessibility and keyboard navigation in React?

Implement accessibility in React by following best practices for keyboard navigation and focus management. These patterns ensure your user interfaces are fully navigable via keyboard, providing an inclusive experience for all users interacting with your application.

How do I add animations to a React component using Framer Motion?

Add animations to React components by integrating Framer Motion patterns. This library allows you to create smooth, declarative animations that enhance the user experience while maintaining the performance and accessibility of your user interfaces.

When should I use error boundaries in a Next.js application?

Use error boundaries in your Next.js application to gracefully catch JavaScript errors anywhere in the component tree. This pattern prevents a single component failure from crashing the entire application, displaying a fallback UI instead and improving overall stability.