next-best-practices

Standardize Next.js project structure with server/client boundaries and data fetching patterns.

Updated Sep 6, 2024
One-click install
npx skills add https://github.com/Jaylaelike/pm25-interactive-thaipbs-app --skill next-best-practices-jaylaelike
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-best-practices
Source: https://github.com/Jaylaelike/pm25-interactive-thaipbs-app/tree/main/.agents/skills/next-best-practices
Command: npx skills add https://github.com/Jaylaelike/pm25-interactive-thaipbs-app --skill next-best-practices-jaylaelike

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a curated set of Next.js best practices to ensure scalable, maintainable, and high-performance apps, covering coding conventions, architecture patterns, and deployment considerations.

Core Features & Use Cases

  • Code quality and project structure: guidelines for file conventions, routing, and layout composition to avoid common pitfalls.
  • Server Components boundaries and data patterns: best practices for server/client separation, data fetching, and routing patterns (Server Components, Server Actions, Route Handlers).
  • Performance and optimization: guidance on image/font optimization, metadata, and bundling strategies for production readiness.

Quick Start

Use this skill to review a Next.js project and apply the listed best practices to a new or existing app.

Frequently Asked Questions about next-best-practices

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

FAQPage Schema
How do I structure a Next.js project to follow best practices for server and client boundaries?

Next.js project structure best practices involve clear server and client component separation, optimized data fetching patterns, and consistent routing conventions to ensure scalable apps. This skill provides guidelines for file conventions and layout composition to avoid common architectural pitfalls.

What is the best way to optimize images and fonts in a Next.js app?

Image and font optimization in Next.js is best handled through built-in components and metadata APIs that automatically serve responsive formats and reduce layout shift. This skill provides specific guidance on bundling strategies and optimization techniques for production readiness.

How do I use Route Handlers and Server Actions for data fetching in Next.js?

Using Route Handlers and Server Actions for Next.js data fetching requires defining clear server/client boundaries to execute secure backend logic and streamline data patterns. This skill standardizes these routing patterns to maintain consistent project architecture.

Can I use this Next.js best practices reference for code reviews and onboarding?

Yes, you can use this Next.js best practices reference during code reviews and onboarding to standardize project architecture and verify team compliance. It serves as a curated set of guidelines for coding conventions, metadata handling, and error management.