Skip to content

laguagu/claude-code-nextjs-skills / skills/next-best-practices

next-best-practices

Verified

Next.js App Router best practices covering file conventions, RSC boundaries, async APIs, data patterns, hydration errors, metadata, route handlers, image/font optimization, and bundling. Use when writing or reviewing Next.js code to prevent hydration errors, RSC violations, data waterfalls, and configuration mistakes.

FileKindSize
SKILL.mdskill md6.5 KB
async-patterns.mdmarkdown788 B
bundling.mdmarkdown1.4 KB
data-patterns.mdmarkdown1.3 KB
debug-tricks.mdmarkdown872 B
directives.mdmarkdown785 B
error-handling.mdmarkdown1.4 KB
file-conventions.mdmarkdown1.1 KB
font.mdmarkdown821 B
functions.mdmarkdown911 B
hydration-error.mdmarkdown1.2 KB
image.mdmarkdown1.1 KB
metadata.mdmarkdown1.2 KB
parallel-routes.mdmarkdown1.1 KB
route-handlers.mdmarkdown1.2 KB
rsc-boundaries.mdmarkdown1.1 KB
runtime-selection.mdmarkdown849 B
scripts.mdmarkdown788 B
self-hosting.mdmarkdown1.7 KB
suspense-boundaries.mdmarkdown1.1 KB

self-hosting.md

View on GitHub
# Self-hosted runtime contracts

Use the installed [self-hosting guide](https://nextjs.org/docs/app/guides/self-hosting)
and the project's adapter/deploy scripts. Standalone output is useful for
containers but is not required for every host.

Standalone tracing does not copy `public` or `.next/static` automatically.
Serve/copy them at the correct app/workspace path and verify the runtime has
needed native dependencies. Monorepo tracing roots can change emitted paths.

Build-time `NEXT_PUBLIC_*` values are bundled; they cannot become runtime
configuration merely by changing the container environment. Read server-only
configuration at runtime where supported.

Multiple instances need deliberate cache storage and invalidation coordination.
The singular `cacheHandler` (prerender/ISR output, Route Handler responses, fetch
cache; optimized images via `images.customCacheHandler` from 16.2) and Cache
Components `cacheHandlers` are different contracts. A multi-instance app may need
both. Use a maintained adapter or implement against current types; a toy
Redis/S3 get/set example omits important tags/expiry semantics.
For Cache Components, `updateTags()` writes shared invalidation events and
`refreshTags()` synchronizes them before requests. A shared entry store alone
does not synchronize each instance's tag state.

Coordinate build IDs, action encryption keys and deployment skew where the app
needs it. Preserve streaming through the real proxy/load balancer. Readiness
checks should fit the service's dependencies.

Verify the actual runtime artifact, assets, a write followed by read and
cross-instance behavior where applicable. Local `next dev` cannot establish
deployment readiness.
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall