next-best-practices

Detect and correct incorrect Next.js App Router architecture and implementation patterns.

3|2|Updated Mar 25, 2026
One-click install
npx skills add https://github.com/zaid-khan-code/learnHub-ai-powered-online-learning-platform-lms --skill next-best-practices-zaid-khan-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-best-practices
Source: https://github.com/zaid-khan-code/learnHub-ai-powered-online-learning-platform-lms/tree/main/.agents/skills/next-best-practices
Command: npx skills add https://github.com/zaid-khan-code/learnHub-ai-powered-online-learning-platform-lms --skill next-best-practices-zaid-khan-code

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you avoid subtle Next.js mistakes that cause broken routing, invalid server-client boundaries, hydration bugs, poor performance, and unreliable production deployments.

Core Features & Use Cases

  • App Router Conventions: Validates file structure, route segments, parallel routes, intercepting routes, and special files like layout, loading, error, and not-found.
  • Server and Client Boundaries: Guides correct use of server components, client components, server actions, async request APIs, and serializable props.
  • Performance and SEO: Improves metadata, image handling, font loading, script usage, bundling, Suspense boundaries, and data-fetching patterns.
  • Production Operations: Covers route handlers, error handling, runtime selection, self-hosting, and debugging workflows for robust deployments.
  • Use Case: A team migrating to Next.js 16 can use this Skill to review pages, layouts, API routes, and UI components for best-practice compliance before shipping.

Quick Start

Ask the skill to review a Next.js App Router feature or code change for architectural issues, async API mistakes, and performance best practices.

Frequently Asked Questions about next-best-practices

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

FAQPage Schema
How do I fix server-client component boundary issues in Next.js App Router?

Fix Next.js App Router server-client component boundaries by validating serializable props, correctly using server actions, and ensuring client components isolate interactive logic to prevent hydration bugs.

What is the correct way to use async request APIs in Next.js server components?

Async request APIs in Next.js server components require proper serialization rules and runtime selection to fetch data reliably without blocking the render cycle or causing deployment failures.

How do I validate Next.js file conventions for parallel routes and intercepting routes?

Validate Next.js file conventions by checking route segments, parallel routes, and intercepting routes against special files like layout, loading, error, and not-found to ensure correct architectural structure.

What's the best way to optimize images, fonts, and scripts in Next.js for production?

Optimize Next.js images, fonts, and scripts by applying production-safe patterns for bundling, Suspense boundaries, and metadata handling to improve performance and SEO reliably before deployment.

Does this Next.js best practices guidance apply to self-hosting workflows?

Next.js best practices guidance applies to self-hosting workflows by validating route handlers, error handling, and runtime selection to ensure robust production deployments without relying on managed platforms.

Why does my Next.js 16 application have broken routing and poor performance?

Broken routing and poor performance in Next.js 16 applications stem from incorrect architecture, invalid async API usage, and missing Suspense boundaries, requiring validation of file conventions to resolve.