Agent skill

Nextjs

by pproenca in pproenca/dot-skills

Next.js 16 App Router performance, caching, server components, server actions, routing, and codebase-hygiene best practices — plus a category-major review/refactor algorithm with codebase-level…

MITAuto-check passedDevelopment

Install Nextjs

skills CLI
$ npx skills add pproenca/dot-skills --skill nextjs -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pproenca/dot-skills nextjs --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pproenca/dot-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/nextjs .claude/skills/nextjs && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
nextjs
GitHub stars
214
Token cost
~3.7k tokens
SKILL.md length
1,414 words
Files
52 (incl. references, assets)
Skills in repo
182
Repo updated
First seen
Licence
MIT

At a glance

Next.js 16 App Router performance, caching, server components, server actions, routing, and codebase-hygiene best practices — plus a category-major review/refactor algorithm with codebase-level…

  • Works in 4 steps: Two modes — never refuse a whole-repo… → Judgment over grep. Each rule names a… → Category-major, not file-major — with… → …
  • Tasks that involve Refactoring
  • SKILL.md covers When to Apply, How to Review or Refactor a…, Rule Categories and Quick Reference, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Nextjs is an agent skill from pproenca/dot-skills. Next.js 16 App Router performance, caching, server components, server actions, routing, and codebase-hygiene best practices — plus a category-major review/refactor algorithm with codebase-level (remove/dedup/reuse) findings. This skill should be used when writing Next.js 16 App Router code, configuring caching with 'use cache', building Server Components, setting up parallel/intercepting routes, configuring next.config.js OR proxy.ts, OR auditing/refactoring a Next.js codebase (single file or whole repo). This…

Its SKILL.md is about 3.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 54 other files, including reference files and assets (for example `AGENTS.md`, `README.md` and `assets/templates/_template.md`).

It sits in Development, covering Refactoring and Caching. It works with Next.js and React. The repository describes itself as: A collection of AI agent skills following the Agent Skills open format. The licence is MIT.

When your agent uses it

  • Tasks that involve Refactoring
  • Tasks that involve Caching

Example prompts

  • “use cache”
  • “/nextjs”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Two modes — never refuse a whole-repo audit. Pick Mode A (scoped, ≤~20 files) or Mode B (whole-tree: inventory pass + targeted sweeps +…
  2. Judgment over grep. Each rule names a pattern shape, not a syntactic marker. Read each rule's Shapes to recognize section before sweeping…
  3. Category-major, not file-major — with forcing functions. Sweep one category at a time across all in-scope files in priority order…
  4. Codebase-level findings come from Category 9. Single-file rules can't tell you "these two routes should be one" or "this server action is…

What it can do on your machine

Read from SKILL.md and the folder at commit cf93c57. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • nextjs.org
    • react.dev
    • vercel.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Nextjs loads about 3.7k tokens when it runs, and up to ~49k if it reads all its reference files. Until then it costs about 155 tokens; SKILL.md has 1,414 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~155
When it runs · the whole SKILL.md, loaded when a task matches
~3.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~49k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from pproenca/dot-skills at commit cf93c57, republished under its MIT licence (© pproenca). 1,414 words, ~3,652 tokens.

Download SKILL.mdSave it as .claude/skills/nextjs/SKILL.md (or your agent's skills folder). This skill also uses 51 other files; get the full folder from GitHub.
name
nextjs
description
Next.js 16 App Router performance, caching, server components, server actions, routing, and codebase-hygiene best practices — plus a category-major review/refactor algorithm with codebase-level (remove/dedup/reuse) findings. This skill should be used when writing Next.js 16 App Router code, configuring caching with 'use cache', building Server Components, setting up parallel/intercepting routes, configuring next.config.js OR proxy.ts, OR auditing/refactoring a Next.js codebase (single file or whole repo). This skill does NOT cover generic React 19 patterns (use react skill) or non-Next.js server rendering.

Next.js 16 App Router Best Practices

Comprehensive Next.js 16 App Router guide for AI agents. Contains 45 rules across 9 categories, prioritized by impact from critical (build optimization, caching strategy) through to cross-cutting codebase hygiene (dedup, dead routes, boundary coherence). Reflects Next.js 16 changes: 'use cache' directive replacing implicit caching, revalidateTag(tag, cacheLife) requirement, proxy.ts replacing middleware.ts, Turbopack persistent caching, App Router conventions.

Rule files describe pattern shapes (not API names) and open with a "Shapes to recognize" section listing 2–4 syntactic disguises the same break can wear. Selected high-value rules (those whose disguises are most common in practice — 'use cache', parallel-fetching, dynamic-imports, server-action-forms, client-boundary, server-vs-client-fetching) include an extra concrete "In disguise" incorrect/correct example pair to teach pattern detection beyond the grep-friendly cases.

When to Apply

  • Writing new Next.js 16 App Router code
  • Auditing or modernizing a Next.js codebase — single file, PR, or whole repo (see references/_review-algorithm.md)
  • Migrating from Next.js 15 to 16 (implicit caching → 'use cache', middleware.ts → proxy.ts, revalidateTag single-arg → with cacheLife)
  • Configuring caching strategies with 'use cache', unstable_cache, revalidateTag, revalidatePath
  • Implementing Server Components and parallel/colocated data fetching
  • Setting up parallel routes, intercepting routes, prefetching, proxy.ts
  • Creating Server Actions for form handling and mutations
  • Tuning 'use client' boundaries to minimize client bundle
  • Finding codebase-level issues that single-file rules can't see: duplicated server fetchers, near-duplicate routes/layouts, dead routes, 'use client' propagation across the route tree, prop-shape drift (see Category 9)

How to Review or Refactor a Codebase

When the user asks to review, refactor, modernize, or audit Next.js code — single file or whole repo — follow references/_review-algorithm.md. Do not improvise.

Four non-negotiables from that doc:

  1. Two modes — never refuse a whole-repo audit. Pick Mode A (scoped, ≤~20 files) or Mode B (whole-tree: inventory pass + targeted sweeps + full Category 9).
  2. Judgment over grep. Each rule names a pattern shape, not a syntactic marker. Read each rule's Shapes to recognize section before sweeping — grep finds the easy violations and misses the high-value ones (a layout marked 'use client' for one button; TanStack Query fetching initial page data; a route handler doing the work of a Server Action; a hand-rolled cache layer mimicking 'use cache'; sequential fetches hidden across parent/child Server Components).
  3. Category-major, not file-major — with forcing functions. Sweep one category at a time across all in-scope files in priority order (CRITICAL → … → CROSS-CUTTING). The algorithm requires a scope declaration, per-category progress lines, and a final coverage table (category × file/bucket, cells ∈ {clean, N findings, n/a}). A missing category in the output is immediately visible.
  4. Codebase-level findings come from Category 9. Single-file rules can't tell you "these two routes should be one" or "this server action is dead." Category 9 (Codebase Hygiene) sweeps the full inventory at the end and produces remove / dedup / reuse / consolidate findings.

Single-file ad-hoc questions ("is this caching strategy right?") can go straight to the relevant rule. The algorithm exists for the multi-file and whole-repo cases.

Rule Categories

#CategoryImpactRulesKey Topics
1Build & Bundle OptimizationCRITICAL5Turbopack, optimizePackageImports, dynamic imports, barrel files, serverExternalPackages
2Caching StrategyCRITICAL6'use cache', revalidateTag+cacheLife, fetch options, segment config
3Server Components & Data FetchingHIGH6Parallel fetching, streaming, colocation, preload, no-client-fetch, error handling
4Routing & NavigationHIGH5Parallel routes, intercepting routes, prefetching, proxy.ts, notFound()
5Server Actions & MutationsMEDIUM-HIGH5Server actions, useFormStatus, action-result errors, useOptimistic, revalidation
6Streaming & Loading StatesMEDIUM5Suspense placement, loading.tsx, error.tsx, skeleton matching, nested Suspense
7Metadata & SEOMEDIUM4generateMetadata, sitemap.ts, robots.ts, opengraph-image.tsx
8Client ComponentsLOW-MEDIUM4'use client' boundary, children pattern, hydration mismatch, next/script
9Codebase HygieneLOW-MEDIUM5Dedup server fetchers, route consolidation, dead routes/actions, 'use client' propagation, prop drift

Quick Reference

Critical patterns — get these right first:

  • Add 'use cache' to Server Components/functions whose results should be cached (Next.js 16 dropped implicit fetch caching)
  • Call revalidateTag(tag, cacheLife) with a profile — never the one-arg API
  • Configure optimizePackageImports for icon/utility libraries with flat-export surfaces
  • Don't disable Turbopack persistent caching
  • Wrap <form action={serverAction}> instead of POST-to-/api/...

Next.js 16 idioms (do NOT generate Next.js 15 patterns):

  • proxy.ts (Node runtime) — not middleware.ts (Edge)
  • Explicit 'use cache' — not implicit fetch caching
  • revalidateTag(tag, cacheLife) — not single-arg revalidateTag(tag)
  • Server Action + useActionState — not client fetch + useState
  • app/sitemap.ts — not hand-maintained public/sitemap.xml

Common single-file mistakes — avoid these anti-patterns:

  • Sequential await for independent data (use Promise.all or preload)
  • useEffect + fetch in a Client Component for initial page data
  • 'use client' at the layout level for one interactive button
  • Missing revalidatePath/revalidateTag after a mutating Server Action
  • Skeletons that don't match content dimensions (CLS hit)

Codebase-level patterns — surface these in Category 9 sweeps:

  • 2+ Server Components hitting the same upstream with drifting cache policies — extract to a shared cached fetcher
  • 2+ near-duplicate routes/layouts that should be one with a variant or dynamic segment — consolidate
  • Routes / route handlers / Server Actions with no inbound traffic for 90+ days — delete (after analytics check)
  • 'use client' propagating up the route tree because of one interactive leaf — demote layouts/parents to Server Components, leave a client island
  • Same concept under different route-param/search-param/prop names — converge on a canonical name (watch out for SEO redirects)
Show full SKILL.md (578 more words)Show less

Table of Contents

  1. Build & Bundle Optimization — CRITICAL
  2. Caching Strategy — CRITICAL
  3. Server Components & Data Fetching — HIGH
  4. Routing & Navigation — HIGH
  5. Server Actions & Mutations — MEDIUM-HIGH
  6. Streaming & Loading States — MEDIUM
  7. Metadata & SEO — MEDIUM
  8. Client Components — LOW-MEDIUM
  9. Codebase Hygiene — CROSS-CUTTING (multi-file findings; required for whole-repo audits)

References

  1. Next.js Documentation
  2. Next.js 16 Release Notes
  3. React Documentation
  4. Vercel Engineering Blog
  • For React 19 fundamentals (concurrent rendering, hooks, components), see react skill
  • For client-side form handling, see react-hook-form skill
  • For client data caching with TanStack Query, see tanstack-query skill

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

© pproenca, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 51 other files (references, assets) in skills/.curated/nextjs of pproenca/dot-skills.

  • SKILL.md
  • AGENTS.md
  • README.md
  • assets/templates/_template.md
  • metadata.json
  • references/_review-algorithm.md
  • references/_sections.md
  • references/action-error-handling.md
  • references/action-optimistic-updates.md
  • references/action-pending-states.md
  • references/action-revalidation.md
  • references/action-server-action-forms.md
  • references/build-barrel-files.md
  • references/build-dynamic-imports.md
  • references/build-external-packages.md
  • references/build-optimize-package-imports.md
  • references/build-turbopack-config.md
  • references/cache-fetch-options.md
  • … and 34 more

Open the folder on GitHubat commit cf93c57

Compare with similar skills

Nextjs next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Nextjs compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Nextjs this skillpproenca/dot-skills214—~3.7kAutomated safety check: PassMIT
Nuqstrycompai/crm11k1 repos~1.7kAutomated safety check: PassMIT
React Best Practicesshapeshift/web2061 repos~2kAutomated safety check: PassMIT
Nextjs App Architecturejakubwarkusz/themes1231 repos~2.5kAutomated safety check: PassMIT
Clean Code Refactorerfike/fastapi-blog101—~402Automated safety check: PassMIT
React Refactor Tournamentragnar-pwninskjold/tech-snacks136—~1.3kAutomated safety check: PassMIT

Similar skills

  • Nuqs

    trycompai/crm

    nuqs (type-safe URL query state) best practices for Next.js and other React frameworks.

    11k GitHub starsUsed in 1 repo~1.7k tokens
    DevelopmentAuto-check passed
  • React Best Practices

    shapeshift/web

    Comprehensive React and Next.js performance optimization guide with 40+ rules for eliminating waterfalls, optimizing bundles, and improving rendering.

    206 GitHub starsUsed in 1 repo~2k tokens
    DevelopmentAuto-check passed
  • Nextjs App Architecture

    jakubwarkusz/themes

    Build or audit Next.js 16 App Router apps using a next-beats-style React Server Components architecture.

    123 GitHub starsUsed in 1 repo~2.5k tokens
    DevelopmentAuto-check passed
  • Clean Code Refactorer

    fike/fastapi-blog

    Skill for identifying code smells and refactoring code using Clean Code, SOLID, and DRY principles.

    101 GitHub stars~402 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • React Refactor Tournament

    ragnar-pwninskjold/tech-snacks

    Review React/Next.js code against the real vercel-react-best-practices skill, backlog the performance findings keyed to actual rule ids + impact tiers, rank the most over-subscribed tiers, then fix…

    136 GitHub stars~1.3k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • React Performance

    affaan-m/ECC

    React and Next.js performance optimization patterns adapted from Vercel Engineering's React Best Practices (https://github.com/vercel-labs/agent-skills).

    274k GitHub starsUsed in 1 repo~4.5k tokens
    DevelopmentAuto-check passed

More from pproenca/dot-skills

All 182 skills in this repo
  • Audio Voice Recovery

    pproenca/dot-skills

    Audio forensics and voice recovery guidelines for CSI-level audio analysis.

    214 GitHub stars~3.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Codemod React Pipeline

    pproenca/dot-skills

    Guided, scripted pipeline for running JSX/TSX/React codemods safely across large legacy codebases.

    214 GitHub stars~1.6k tokensUpdated 1 mo ago
    Auto-check passed
  • Dev Rfc

    pproenca/dot-skills

    Create well-structured RFCs and technical proposals for software projects.

    214 GitHub stars~3.8k tokensUpdated 1 mo ago
    Auto-check passed
  • Dx Harness

    pproenca/dot-skills

    Developer-experience friction auditing and fixing — slow onboarding, repeated manual setup steps, missing bootstrap/reset/seed scripts, undiscoverable conventions.

    214 GitHub stars~1.5k tokensUpdated 1 mo ago
    Auto-check passed
  • Language Spec Author

    pproenca/dot-skills

    Turn a rough idea for a language into a complete, implementable specification — a DSL, query, config/data, template, or protocol language — by interviewing the author dimension by dimension until…

    214 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Python Pep Author

    pproenca/dot-skills

    Drafting Python Enhancement Proposals (PEPs) — proposing a Python language feature, a standard library change, an interoperability standard, or an informational/process document for the Python…

    214 GitHub stars~2.1k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Questions about Nextjs

What does Nextjs do?

Next.js 16 App Router performance, caching, server components, server actions, routing, and codebase-hygiene best practices — plus a category-major review/refactor algorithm with codebase-level…. Nextjs is an agent skill from pproenca/dot-skills.js 16 App Router performance, caching, server components, server actions, routing, and codebase-hygiene best practices — plus a category-major review/refactor algorithm with codebase-level (remove/dedup/reuse) findings.

When should I use Nextjs?

Nextjs fits situations like: tasks that involve Refactoring; tasks that involve Caching.

How do I install Nextjs in Claude Code?

Run `npx skills add pproenca/dot-skills --skill nextjs -a claude-code`. Or copy the skill folder (skills/.curated/nextjs in pproenca/dot-skills) into .claude/skills/nextjs in your project. Claude Code loads it when a task matches its description.

How do I install Nextjs in Codex?

Run `npx skills add pproenca/dot-skills --skill nextjs -a codex`. Or copy the skill folder (skills/.curated/nextjs in pproenca/dot-skills) into .agents/skills/nextjs in your project. Codex loads it when a task matches its description.

Can I use Nextjs in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pproenca/dot-skills --skill nextjs -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/nextjs, .gemini/skills/nextjs, .github/skills/nextjs and .opencode/skills/nextjs in your project.

What does Nextjs need to run?

SKILL.md names no scripts, command-line tools or credentials: Nextjs is instructions for the agent only.

Does Nextjs access the network?

SKILL.md names 3 domains. As links in the text: nextjs.org, react.dev and vercel.com. This is read from the text; nothing was executed.

Is Nextjs safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Nextjs use?

Nextjs is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Nextjs use?

About 3.7k tokens (SKILL.md is roughly 15k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 46k tokens, read only when the agent opens those files.

What are the alternatives to Nextjs?

Skills that share tags, products or a category with Nextjs: Nuqs (trycompai/crm, 11k stars), React Best Practices (shapeshift/web, 206 stars), Nextjs App Architecture (jakubwarkusz/themes, 123 stars) and Clean Code Refactorer (fike/fastapi-blog, 101 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Nextjs?

pproenca (a GitHub user) maintains it in pproenca/dot-skills, which has 214 GitHub stars. The repository holds 182 skills in this directory. The repository was last updated on August 15, 2026.

Source: pproenca/dot-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.