Skip to main content
skill CX Codex

next-best-practices — Claude Code skill: Next.js rules

A skill that hands your agent a set of Next.js rules: file conventions, RSC boundaries, async APIs, metadata, error handling. Useful whenever it writes or reviews Next.js code.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add pedronauck/skills --skill next-best-practices -a claude-code
Open on GitHub

What next-best-practices does

The skill kicks in while the agent writes or reviews Next.js code, and tells it what the framework expects. It ships as a bundle of reference files. One covers project layout and the special files, plus dynamic, catch-all and grouped route segments, parallel and intercepting routes, and the middleware rename in v16.

Another set deals with React Server Components: spotting an async client component, non-serializable props, exceptions thrown from Server Actions. Async patterns for Next.js 15+ get their own file — params, searchParams, cookies() and headers() are all async now, and a codemod handles the migration. Runtime choice is short: Node.js unless Edge actually fits.

Error handling has a file of its own (error.tsx, global-error.tsx, not-found.tsx, redirect, notFound, forbidden, unauthorized). Data patterns explain when to reach for a Server Component, a Server Action or a route handler, and how to avoid waterfalls with Promise.all and Suspense. The rest covers metadata and OG images through next/og, next/image and next/font, bundling, scripts, hydration errors, Suspense boundaries, and self-hosting with output: 'standalone'. You do not invoke it yourself — it is marked user-invocable: false and loads on its own when the context fits.

What it helps with

  • catch an async client component before it breaks the build
  • move a project to async params and cookies() on Next.js 15+
  • decide between a route handler and a Server Action
  • kill a request waterfall with Promise.all and Suspense
  • set up OG images and metadata without hand-written tags

Example prompts for the agent

  • Check this component for RSC boundary violations and tell me what's wrong
  • Rewrite this page for async params and searchParams
  • Why am I getting a hydration error in this component?

How to install next-best-practices

1Skills CLI (Vercel)

npx skills add pedronauck/skills --skill next-best-practices -a claude-code

2Manually: put the files in place

~/.claude/skills/next-best-practices/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/next-best-practices/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about next-best-practices

How do I install next-best-practices in Claude Code?

Run npx skills add pedronauck/skills --skill next-best-practices -a claude-code. The skill file lands at ~/.claude/skills/next-best-practices/SKILL.md.

What does next-best-practices do?

It gives the agent rules for writing and reviewing Next.js code: file conventions, RSC boundaries, async APIs, metadata, error handling, image and font optimization, bundling.

Can I invoke this skill manually?

No. It is marked user-invocable: false, so it fires on its own when the agent is working with Next.js code.

Similar skills

Everything for Frontend and UI →

From the same set18

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor