nextjs
Skill2 starsChanged 5 months agoMITView on GitHub
Use when project is Next.js (App Router or Pages Router). Covers Server vs Client Components, Server Actions, Suspense boundaries, route handlers, middleware, next/image discipline, revalidation. Round 9 B.
39 other projects use a version of this.
Adopted by
Most recently taken up by
- RuneStone-Tech/optimize-anythingtheir own version, first seen Nov 8, 2026
- LuisSambrano/antigravity-configtheir own version, first seen Nov 8, 2026
- davidvornholt/mail-mcptheir own version, first seen Nov 5, 2026
- davidvornholt/mailboxtheir own version, first seen Nov 5, 2026
- hmj1026/dhpktheir own version, first seen Nov 1, 2026
- thongdn-it/react-agent-skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use nuqs, msw 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.
thongdn-itSkillnuqs
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
thongdn-itSkillmsw
MSW (Mock Service Worker) best practices for API mocking in tests (formerly test-msw). This skill should be used when setting up MSW, writing request handlers, or mocking HTTP APIs. This skill does NOT cover general testing patterns (use test-vitest or test-tdd skills) or test methodology.
Also in 3 projects that use this
VercelSkillreact
React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.
Also in 10 projects that use this
rawvegSkilllaravel
Laravel v12 - The PHP Framework For Web Artisans
Also in 3 projects that use this
MicrosoftSkilltypescript
TypeScript best practices for this monorepo. Use this skill when: (1) writing new TypeScript code, (2) reviewing TypeScript code, (3) working with API responses, fetch calls, or JSON parsing, (4) adding or modifying types and interfaces.
Also in 5 projects that use this
klauswgSkillshadcn-ui
Expert guidance for integrating and building applications with shadcn/ui components, including component discovery, installation, customization, and best practices.
Also in 4 projects that use this
- +3 more from thongdn-it
Other versions39 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 39
- openai/plugins★ 7.8ksame name
- udecode/better-convex★ 452same name
- leonvanzyl/agentic-coding-starter-kit★ 447same name
- kid-sid/claude-spellbook★ 190same name
- faqndo97/ai-skills★ 33same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- PyModel/react-frontend-skills★ 23same name
- G1Joshi/Agent-Skills★ 15same name
- ulpi-io/browse★ 15same name
- wpank/ai★ 11same name
29 more not listed
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 repository60 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- analyzeSkill
- animation-disciplineSkill
- api-versioningSkill
- autopilotSkill
- browser-e2eSkill
- characterizeSkill
- clarifySkill
- codemodSkill
- constitution-compactSkill
- constitutionSkill
- context-budgetSkill
- creative-webSkill
- db-migrationSkill
- debugSkill
- detect-stackSkill
- dispatch-criteriaSkill
- dreamSkill
- experimentSkill
- fastapiSkill
- flag-cleanupSkill
- flag-rolloutSkill
- flask-realtimeSkill
- framework-detectorSkill
- front-end-designSkill
- grill-meSkill
- handoffSkill
- image-generationSkill
- implementSkill
- initiativeSkill
- instinctSkill
- loopSkill
- observabilitySkill
- okr-alignSkill
- parallel-swarmSkill
- pivotSkill
- planSkill
- pr-bodySkill
- prime-disciplineSkill
- prod-observabilitySkill
- react-nodeSkill
- react-viteSkill
- release-trainSkill
- researchSkill
- reviewSkill
- security-guardSkill
- self-healSkill
- shipSkill
- skill-creatorSkill
- specifySkill
- tailwind-disciplineSkill
- tasksSkill
- tdd-loopSkill
- token-budgetSkill
- typographySkill
- verify-loopSkill
- verifySkill
- wip-checkpointSkill
- <kebab-case-skill-name>Skill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 3 are distinctive, and 10 are very specific to this project.
0
Common
Most of the 35 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
When working in a Next.js codebase, enforce App Router idioms (RSC by default), Suspense + error boundary co-location, next/image for all …
- Very specific: line 19
Server Components by default: Add "use client" ONLY at leaf interactivity (form, hook, event handler).
- Very specific: line 20
Server Actions for mutations: No client-side fetch to /api/route for form posts.
- Very specific: line 22
Suspense boundaries co-located: Every route segment ships loading.tsx + error.tsx next to page.tsx.
- Distinctive: line 23
Middleware sparingly: Only for auth gating, header injection, redirects.
- Very specific: line 51
Create page.tsx (RSC by default) — fetch data with async/await, no useEffect
- Very specific: line 53
If interactivity needed → split into Client Component leaf, mark "use client"
- Distinctive: line 56
Test: Playwright covers user journey.
- Very specific: line 60
Use next/image for raster.
- Very specific: line 61
Use next/font for fonts; never link to Google Fonts CDN (privacy + perf)
- Very specific: line 62
Use Server Actions for mutations.
- Very specific: line 64
Run next build locally before merging — production-only optimizations catch issues next dev doesn't
- Distinctive: line 84
All new routes use App Router unless explicitly migrating from Pages
“Common” is measured: kept by at least 6 in 10 of the 35 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.
Files
Next.js
Mandate
When working in a Next.js codebase, enforce App Router idioms (RSC by default), Suspense + error boundary co-location, next/image for all raster, Server Actions for mutations, and pinned framework version.
Decisions encoded
- App Router default. Pages Router only if the project is already there and a migration is out of scope.
- Server Components by default. Add
"use client"ONLY at leaf interactivity (form, hook, event handler). - Server Actions for mutations. No client-side
fetchto/api/routefor form posts; use action functions +revalidatePath/revalidateTag. next/imagealways. Raw<img>is an anti-pattern (no LCP optimization, no AVIF/WebP).- Suspense boundaries co-located. Every route segment ships
loading.tsx+error.tsxnext topage.tsx. - Middleware sparingly. Only for auth gating, header injection, redirects. NOT for data transforms (use route handlers).
- Pinned Next version. No "latest" in package.json; bump deliberately via
/upgrade nextjs --to <ver>.
Project structure (App Router)
src/app/
├── layout.tsx # root layout (must export metadata, fonts)
├── page.tsx # /
├── loading.tsx + error.tsx # global Suspense + error boundaries
├── (marketing)/ # route group (no URL segment)
│ ├── about/page.tsx
│ └── pricing/page.tsx
├── (app)/ # authed
│ ├── dashboard/
│ │ ├── page.tsx
│ │ ├── loading.tsx
│ │ ├── error.tsx
│ │ └── actions.ts # Server Actions
│ └── settings/page.tsx
├── api/
│ └── webhooks/route.ts # route handlers (NOT for app-internal data)
└── middleware.ts # auth/redirect gating onlyProcedure (new feature)
- Determine route segment + group (
(marketing),(app), etc.) - Create
page.tsx(RSC by default) — fetch data withasync/await, nouseEffect - Co-locate
loading.tsx+error.tsx - If interactivity needed → split into Client Component leaf, mark
"use client" - Mutations → Server Action in
actions.ts, return revalidation tag - Images →
next/imagewith explicit width/height;priorityfor above-fold - Test: Playwright covers user journey; Vitest covers Server Action logic
Hard rules
- Use
next/imagefor raster; never<img> - Use
next/fontfor fonts; never link to Google Fonts CDN (privacy + perf) - Use Server Actions for mutations; not
fetch('/api/...')from forms - Match React 19's
use()hook for promise unwrapping in Client Components - Run
next buildlocally before merging — production-only optimizations catch issuesnext devdoesn't - Pin
nextexact version in package.json; bumps require/upgrade nextjs
Common pitfalls
- Adding
"use client"to the root layout — kills the whole RSC tree. Apply at leaves only. useEffectin RSC — won't even compile. Symptom: "useEffect is not defined in server components."- Mutating in route handlers when Server Action would do — splits the surface area; Server Actions also auto-revalidate.
<img>slipping through — set ESLint rule@next/next/no-img-elementto error.- Forgetting
revalidatePath/revalidateTagafter mutation — UI stays stale. - Edge runtime for data-heavy work — Edge has no Node APIs; use
runtime: 'nodejs'for DB queries.
References
- Official docs: https://nextjs.org/docs/app
- App Router migration: https://nextjs.org/docs/app/building-your-application/upgrading/app-router-migration
- Server Actions: https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations
Done means
- All new routes use App Router unless explicitly migrating from Pages
next/imageeverywhere; no<img>- Suspense + error boundaries co-located with every page
next buildpasses locally before push
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
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.

