next-best-practices

Audit Next.js App Router code for invalid routing and runtime patterns.

1|Updated Apr 19, 2026
One-click install
npx skills add https://github.com/arthtyagi/onloop --skill next-best-practices-arthtyagi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-best-practices
Source: https://github.com/arthtyagi/onloop/tree/main/.agents/skills/next-best-practices
Command: npx skills add https://github.com/arthtyagi/onloop --skill next-best-practices-arthtyagi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you write, review, and debug modern Next.js App Router code without tripping over framework-specific pitfalls, reducing regressions and implementation guesswork.

Core Features & Use Cases

  • File and route conventions: Keep layouts, pages, route handlers, parallel routes, intercepting routes, and proxy or middleware files in the correct places.
  • RSC and async safety: Catch invalid async client components, non-serializable props, and Next.js 15+ async request APIs like params, searchParams, cookies, and headers.
  • Production readiness: Apply best practices for metadata, images, fonts, bundling, hydration, error handling, scripts, caching, and self-hosting.
  • Use Case: A developer can use this Skill to review a pull request for App Router mistakes, then fix boundary issues, routing conflicts, and deployment regressions before shipping.

Quick Start

Use the next-best-practices skill to review my Next.js App Router code for routing, server-client boundary, async API, and deployment issues.

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 Next.js App Router hydration and server component boundary errors?

To fix Next.js App Router hydration and React Server Component boundary errors, you must enforce correct Server Component boundaries and ensure all props passed to Client Components are serializable. This prevents invalid async client components and runtime mismatches.

What is the correct way to use async request APIs like params and cookies in Next.js 15+?

In Next.js 15+, async request APIs like params, searchParams, cookies, and headers must be properly awaited. Applying these Next.js 15+ conventions correctly avoids blocking issues and ensures valid data fetching within your App Router pages and route handlers.

How do I audit Next.js code for routing conflicts and deployment regressions?

You can audit Next.js code for routing conflicts and deployment regressions by reviewing file conventions for layouts, pages, parallel routes, and intercepting routes. Correct placement prevents invalid App Router patterns and ensures proper caching and runtime selection.

Does this Next.js best practices guidance cover metadata, image, and font optimization?

Yes, this Next.js best practices guidance covers metadata, image, and font optimization. It applies production readiness rules to these features alongside bundling, scripts, and error handling to ensure your application avoids common implementation pitfalls.

What are common Next.js App Router pitfalls when handling data fetching and route handlers?

Common Next.js App Router data fetching and route handler pitfalls include invalid async patterns, improper caching, and incorrect runtime selection. Ensuring correct file conventions and proxy naming avoids these issues and maintains stable deployment workflows.