agentleFS
Ghost7802Ghost7802/awesome-api-skills/skills/nextjs/SKILL.md

nextjs

Skill13 starsChanged 26 days agoMITView on GitHub

The React Framework for the Web. Alternatives: nuxt Works Well With: trpc Deploys To: vercel

49 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use declarative-infra, screenshots-in-prs and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • davidvornholtSkill

    declarative-infra

    Use when changing hosted infrastructure, such as server NixOS configurations, OpenTofu, cloud resources, infrastructure secrets, deployments, or provider credentials, even when another repository owns them.

    Also in 3 projects that use this

  • davidvornholtSkill

    screenshots-in-prs

    Use when opening or editing a pull request for a change to rendered UI.

    Also in 3 projects that use this

  • cordanaLLMSkill

    standards-sync

    Synchronize and reconcile local repository configurations, DevContainers, and universal agent harnesses with the governed repositories governance lattice.

    Also in 3 projects that use this

  • poorvith-mpSkill

    ci-pipelines

    Build CI/CD with build, test, security scan and deploy stages across common providers. Use when setting up GitHub Actions, GitLab CI, or build pipelines.

    Also in 3 projects that use this

  • jnotsknabSkill

    ux-ui

    Design usable, accessible, humane interfaces — interaction patterns, component states, forms, feedback, and WCAG compliance. Use when making decisions about how UI behaves, not just how it looks.

    Also in 3 projects that use this

  • thongdn-itSkill

    nuqs

    nuqs (type-safe URL query state) best practices for Next.js applications. This skill should be used when writing, reviewing, or refactoring code that uses nuqs for URL state management. Triggers on tasks involving useQueryState, useQueryStates, search params, URL state, query parameters, nuqs parsers, or Next.js routing with state.

    Also in 3 projects that use this

  • +1 more from davidvornholt

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 44 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use error.tsx at the segment level to catch unexpected runtime errors in Server Components.

    line 33
  2. Very specific:

    Never expose environment variables to the browser unless they are strictly prefixed with NEXT_PUBLIC_.

    line 36
  3. Distinctive:

    Use this when your agent works with nextjs — structured patterns beat pasted docs and prevent common hallucinations.

    line 51

“Common” is measured: kept by at least 6 in 10 of the 44 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Next.js Skill

The React Framework for the Web.

Ecosystem Graph

graph LR
  nextjs["Next.js"]
  nextjs -- "depends on" --> react
  nextjs -- "deploys to" --> vercel
  nextjs -- "authenticates with" --> clerk
  nextjs -- "alternative to" --> nuxt
  nextjs -- "works well with" --> trpc

Quick Start

Next.js 14+ emphasizes the App Router and React Server Components. Server Components execute exclusively on the server, drastically reducing client-side JavaScript bundles.

npx create-next-app@latest

Production Patterns

Cache Invalidation

The App Router aggressively caches data. Do not rely on time-based revalidation (revalidate: 60) for highly dynamic, user-specific data. Instead, use On-Demand Revalidation (revalidateTag or revalidatePath) triggered directly from your Server Actions after a database mutation.

Architecture & Scaling

Edge vs Node.js Runtimes

Next.js allows specifying export const runtime = 'edge' on a per-route basis. The Edge runtime boots in milliseconds but strictly prohibits native Node.js APIs (like fs or crypto). For heavy backend processing, stick to the default Node.js runtime.

Error Recovery

Use error.tsx at the segment level to catch unexpected runtime errors in Server Components. For expected validation errors during form submissions, return strongly-typed error objects from your Server Action rather than throwing exceptions.

Security Notes

Never expose environment variables to the browser unless they are strictly prefixed with NEXT_PUBLIC_. Treat Server Actions exactly like public API endpoints; always verify the user session (e.g., via Clerk auth()) inside the action before mutating data.

Relationships

Prerequisites: react

Alternatives: nuxt

Works Well With: trpc

Deploys To: vercel

References

Why use this skill

Use this when your agent works with nextjs — structured patterns beat pasted docs and prevent common hallucinations.

AI pitfalls

  • Using outdated SDK or API versions from training data
  • Inventing environment variable names
  • Omitting error handling and retry logic

Production checklist

  • Secrets in environment variables, not source code
  • Error handling and logging in place
  • Rate limits and timeouts configured

Related skills

  • react — depends on
  • vercel — deploys to
  • clerk — authenticates with
  • nuxt — alternative to
  • trpc — works well with

Last Verified: 2026-07-02

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.