Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

nextjs-best-practices

Skill by davila7

Gives an AI assistant principles for building Next.js App Router apps. Covers Server vs Client Components, data fetching, routing, caching and server actions. Aimed at developers working on Next.js App Router projects.

  • Score 89
  • 34k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install nextjs-best-practices

Built from the published package, never by AI.

git clone --depth 1 https://github.com/davila7/claude-code-templates /tmp/claude-code-templates && mkdir -p ~/.claude/skills && cp -r /tmp/claude-code-templates/cli-tool/components/skills/development/nextjs-best-practices ~/.claude/skills/nextjs-best-practices

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install nextjs-best-practices in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

nextjs-best-practices is an agent skill that gives an AI assistant principles for developing with the Next.js App Router. It covers when to use Server versus Client Components, data fetching and caching patterns, file-based routing conventions, route handlers, and server actions. It also includes guidance on performance, metadata, and common anti-patterns.

The skill is a SKILL.md file made of decision trees and tables. Its default advice is to keep components on the server and add client code only when state, effects, or event handlers are needed. It lists Read, Write, Edit, Glob and Grep as allowed tools. It suits developers building Next.js App Router projects who want a set of conventions for their assistant to follow.

Written from the project's SKILL.md and checked against it.

What it can do

  • Server vs Client ComponentsDecision tree for when to mark a component with 'use client'.
  • Data fetching patternsStatic, revalidate and no-store fetch strategies with data flow guidance.
  • Routing conventionsRoles of page, layout, loading, error and not-found files.
  • Route organizationRoute groups, parallel routes and intercepting routes for modal overlays.
  • Route handlersGuidance for GET, POST, PUT/PATCH and DELETE, with input validation via Zod.
  • PerformanceImage optimization with next/image and dynamic imports for heavy components.
  • MetadataStatic and generateMetadata approaches, plus title and description length tips.
  • Caching strategyRequest, data and full route cache layers and revalidation methods.
  • Server actionsGuidance for 'use server' forms, data mutations and input validation.
  • Anti-patternsCommon mistakes in Next.js apps with recommended alternatives.

What you need

  • Next.js App Router project

Try asking

  • Should this dashboard component be a Server or Client Component?
  • Set up caching and revalidation for my product list data fetch.
  • Review my route handlers for input validation and status codes.

Good to know

  • Gives principles and conventions rather than runnable code.

Security check

B
  • Allowed to use Write, Edit without limitsIn SKILL.md

Checked automatically: cli-tool/components/skills/development/nextjs-best-practices/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

Allowed tools: ReadWriteEditGlobGrep

  • SKILL.md4 KB

Alternatives to nextjs-best-practices

All alternatives →

Compare with agent-reproduce-align, google_contacts or m06-error-handling

nextjs-best-practices: common questions

When should I use a Client Component in Next.js?

The source says to use a Client Component ('use client') when a component needs useState, useEffect or event handlers. Otherwise a Server Component is the default.

What caching options does the skill describe?

It covers request, data and full route cache layers, time-based revalidation with revalidate, on-demand revalidation with revalidatePath or revalidateTag, and no-store.

Does the skill include validation advice?

Yes. It says to validate input with Zod in route handlers and to validate all inputs in server actions.

How do I install nextjs-best-practices?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is nextjs-best-practices free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is nextjs-best-practices safe to use?

It scores 89 of 100. Grades: maintenance A, licence A, quality A. Security check: grade B (allowed to use write, edit without limits). Review the code before you install. How grades work.

What are alternatives to nextjs-best-practices?

Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.

nextjs-best-practices Install

Add to stack

Loading.