agentleFS
yaaabsyaaabs/nextjs-16-boilerplate/.claude/skills/nextjs-quality/SKILL.md

nextjs-quality

Skill4 starsChanged 5 months agoMITView on GitHub

Next.js 16 App Router best practices for this repo. Use when creating routes, layouts, data fetching, metadata, or anything touching the Next.js framework surface.

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. Paldom/node-skills★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository7 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Server Components by default: Add "use client" only when the component needs state, effects, event handlers, or browser APIs — and push …

    line 14
  2. Very specific:

    Fetch data on the server: Prefer async Server Components and route handlers over client-side useEffect fetching.

    line 19
  3. Very specific:

    Use the special files for their purpose: layout.tsx (persistent shell), loading.tsx (Suspense fallback), error.tsx (error boundary, must be …

    line 29
  4. Very specific:

    After framework-level changes, run npm run build — it type-checks generated route types and catches invalid segment configs that dev mode …

    line 55

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “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 Quality

This repo runs Next.js 16 — newer than most training data. When in doubt about an API, read the bundled docs in node_modules/next/dist/docs/ instead of guessing from memory. Heed deprecation notices.

Golden rules

  • Server Components by default. Add "use client" only when the component needs state, effects, event handlers, or browser APIs — and push that directive as deep into the tree as possible (leaf components, not layouts).
  • next lint does not exist in Next 16. Linting is the plain eslint CLI (npm run lint). Never add next lint to scripts or docs.
  • Fetch data on the server. Prefer async Server Components and route handlers over client-side useEffect fetching. Cache deliberately — know whether each fetch is static, revalidated, or dynamic.
  • Never leak server code to the client. Secrets, DB clients, and privileged logic stay in Server Components, server actions, or route.ts handlers.

Routing conventions

  • New route = src/app/<segment>/page.tsx. Route-specific components live next to the route; shared components go in src/components/.
  • Use the special files for their purpose: layout.tsx (persistent shell), loading.tsx (Suspense fallback), error.tsx (error boundary, must be a client component), not-found.tsx.
  • Dynamic params and searchParams are async in Next 16 — await them: const { slug } = await params.
  • Navigation uses next/link; programmatic navigation uses useRouter from next/navigation (never next/router).

Framework features over hand-rolling

  • Images: next/image (automatic sizing/optimization) — never bare <img>.
  • Fonts: next/font (already configured with Geist in the root layout).
  • Metadata: export metadata or generateMetadata from pages/layouts — never manual <head> tags.
  • Env vars: server-side via process.env.X; browser-visible only with NEXT_PUBLIC_ prefix. Document new variables in .env.example.

Legacy patterns — never introduce

  • pages/ directory, getServerSideProps, getStaticProps, getInitialProps
  • next/head, next/router
  • useEffect + fetch for data that could be fetched on the server
  • API routes under pages/api/ (use src/app/**/route.ts)

Verify

After framework-level changes, run npm run build — it type-checks generated route types and catches invalid segment configs that dev mode tolerates.

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.