nextjs-best-practices — Claude Code skill: what it does and setup
App Router architecture principles for Claude Code. Guides the agent to keep components server-side, configure caching, and organize folder layouts.
npx claude-code-templates@latest --skill development/nextjs-best-practicesWhat nextjs-best-practices does
The skill embeds decision logic for the Next.js App Router into Claude Code sessions. It directs the model to treat Server Components as the default, moving interactivity to small client components only when React hooks or event handlers appear. Guidelines also cover route handlers with Zod schema validation and Server Actions for form submissions.
Caching rules outline build-time generation, time-based ISR, and request-level bypassing via no-store. To review and update your files, the skill requests access to Read, Write, Edit, Glob, and Grep.
Leaving an agent to guess component boundaries usually leads to placing 'use client' on top-level pages, bloating client JavaScript bundles.
What it helps with
- split Server and Client components using a decision tree
- configure fetch caching strategies and revalidation intervals
- structure route folders with route groups and parallel slots
- validate API route handler inputs using Zod
Example prompts for the agent
- Structure a dashboard route in App Router and isolate interactive buttons into client components
- Create an API route handler to update products with Zod payload validation
- Configure data fetching with on-demand tag revalidation for the catalog page
How to install nextjs-best-practices
1claude-code-templates
npx claude-code-templates@latest --skill development/nextjs-best-practices2Skills CLI (Vercel)
npx skills add davila7/claude-code-templates --skill nextjs-best-practices -a claude-code3Manually: put the files in place
~/.claude/skills/nextjs-best-practices/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/nextjs-best-practices/
Manually: put the files in place
.agents/skills/nextjs-best-practices/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/nextjs-best-practices/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install davila7/claude-code-templates nextjs-best-practices2Manually: put the files in place
.github/skills/nextjs-best-practices/SKILL.mdPlatform CLI
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/development/nextjs-best-practicesManually: put the files in place
.devin/skills/nextjs-best-practices/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about nextjs-best-practices
How to install nextjs-best-practices in Claude Code?
Run npx claude-code-templates@latest --skill development/nextjs-best-practices in your terminal. You can also run npx skills add davila7/claude-code-templates --skill nextjs-best-practices -a claude-code.
What does nextjs-best-practices do?
It teaches Claude Code core App Router patterns, including default Server Components, fetch caching strategies, and route organization rules.
Which tools does this skill allow Claude Code to run?
The skill frontmatter permits the agent to use Read, Write, Edit, Glob, and Grep on project files.