ai-infrastructure-hugg…
Hugging Face Inference SDK patterns for TypeScript/Node.js — InferenceClient setup, chat completion, text generation, streaming, embeddings, image generation,…
Next.js App Router patterns (15-16) - file-based routing, Server/Client Components, streaming, Suspense, metadata API, parallel routes, Server Actions, mutations, revalidation, Cache Components
$ npx -y skills add agents-inc/skills --skill web-meta-framework-nextjs --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/web-meta-framework-nextjsContext preview
The summary Claude sees to decide when to auto-load this skill.
Next.js App Router patterns (15-16) - file-based routing, Server/Client Components, streaming, Suspense, metadata API, parallel routes, Server Actions, mutations, revalidation, Cache Components
name: web-meta-framework-nextjs description: Next.js App Router patterns (15-16) - file-based routing, Server/Client Components, streaming, Suspense, metadata API, parallel routes, Server Actions, mutations, revalidation, Cache Components
> **Quick Guide:** Server Components are the default and `"use client"` is opt-in, so keep client > components small and at the leaves of the tree. Reads happen in Server Components; writes happen in > Server Actions, which are public HTTP endpoints and revalidate the cache themselves. Two version > facts change the answers below: from 15, `params`, `searchParams`, `cookies()` and `headers()` are > Promises; in 16, `middleware.ts` became `proxy.ts`, `revalidateTag()` takes a `cacheLife` profile, > and `experimental_ppr` became `cacheComponents`.
**Detailed Resources:**
---
[examples/versions.md](examples/versions.md) before copying any cache, middleware or parallel-route pattern.
above describe it.
---
<critical_requirements>
**Write components as Server Components, and add `"use client"` only for state, effects or event handlers.** The directive is what decides whether the code ships to the browser, so keeping it at the leaves keeps the bundle small and secrets on the server.
**Import `server-only` in any module that touches a secret.** The build then fails at the offending import instead of shipping the key to the browser.
**Give data-heavy routes a `loading.tsx`, and independent sections their own `<Suspense>`.** `loading.tsx` wraps the page in a boundary automatically; a boundary per section stops the slowest fetch blocking the fastest.
**Set SEO through the `metadata` object or `generateMetadata`.** Next.js deduplicates and orders those tags, which manual `<head>` markup does not.
**Mark Server Actions with `'use server'` — at the top of the file, or at the top of the async function.** Without it the function is bundled for the client.
**Validate the input and check authorization inside every Server Action.** An action is a public HTTP endpoint reachable by its ID, so both the caller's identity and the payload's shape are unverified until the action verifies them.
**Call `revalidatePath()` or `revalidateTag()` after a mutation, and before any `redirect()`.** The cache is what the next render reads, and `redirect()` throws, so nothing after it runs.
**Await `params`, `searchParams`, `cookies()` and `headers()`.** All four are Promises from 15 onward.
</critical_requirements>
---
**Auto-detection:** page.tsx, layout.tsx, loading.tsx, error.tsx, not-found.tsx, default.tsx, template.tsx, "use client", "use server", "use cache", App Router, Server Components, Client Components, generateMetadata, generateStaticParams, parallel routes, intercepting routes, revalidatePath, revalidateTag, updateTag, useActionState, useFormStatus, useOptimistic, next/form, next/cache, next/navigation, cacheComponents, cacheLife, cacheTag, PPR, Turbopack, typedRoutes, instrumentation.ts, proxy.ts, after()
**Applies to:**
**Handled elsewhere:**
is a separate choice
---
<philosophy>
The App Router inverts React's default: components run on the server unless they say othe
The official skills marketplace for Agents Inc. 150+ skills covering everything from React and Prisma to Redis, ElevenLabs, and infrastructure tooling. Pick the skills that match your stack and install them via Claude Code. Need more control?
Repo: agents-inc/skills
Hugging Face Inference SDK patterns for TypeScript/Node.js — InferenceClient setup, chat completion, text generation, streaming, embeddings, image generation,…
LiteLLM proxy server setup, TypeScript client patterns via OpenAI SDK, model routing, fallbacks, load balancing, spend tracking, virtual keys, and production…
Serverless GPU compute platform for AI model deployment — web endpoints, GPU functions, model serving, and TypeScript client patterns
Local LLM inference with the Ollama JavaScript client -- chat, streaming, tool calling, vision, embeddings, structured output, model management, and…
Replicate SDK patterns for TypeScript/Node.js -- client setup, predictions, streaming, webhooks, file handling, model versioning, deployments, and training
Together AI SDK patterns for TypeScript — client setup, chat completions, streaming, structured output, function calling, embeddings, image generation,…