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.
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-practicesRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/davila7/claude-code-templates /tmp/claude-code-templates && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/claude-code-templates/cli-tool/components/skills/development/nextjs-best-practices ~/.gemini/antigravity-cli/skills/nextjs-best-practicesAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install nextjs-best-practices in Antigravity CLI
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 →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
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.
