nextjs-ppr-patterns
БесплатноБез исполняемых скриптовНе проверенNext.js 16 App Router pages mixing static and dynamic content — Partial Prerendering (PPR) under the Cache Components model. Covers enabling it with…
от pproenca★ 231 звезда на GitHubОб этом скилле
Next.js 16 Partial Prerendering Patterns
Partial Prerendering (PPR) for the Next.js 16 App Router under the Cache Components model — the decisions PPR forces and how to settle them, written so an agent applies them while writing or reviewing code. Contains 21 rules across 6 categories, ordered from easy to complex: enable PPR → understand the static/dynamic boundary → cache → handle runtime data → compose whole pages → build forms and wizards. Each rule corrects a specific wrong default of a model defaulting to Next.js 14/15; there is no rule for things the model already gets right.
Version-specific. This skill targets Next.js 16 (PPR via
cacheComponents, React 19.2). The Next.js 14/15experimental.pprflag andexport const experimental_pprroute export were removed — seesetup-enable-cache-components. For migrating an existing app, see the migration guide.
Write, then verify. These rules are for authoring PPR; they can't tell you what actually rendered. To empirically deconstruct the boundary — diff the static shell against the hydrated DOM to find the dynamic holes, locate the
'use client'islands, measure loading, and explain why a route is dynamic — drivenext buildand a real browser per _debug-boundaries.md.
When to Apply
- Building or reviewing a Next.js 16 page that mixes static chrome with personalized, real-time, or per-request content
- Enabling or migrating PPR (
cacheComponents), or seeing deadexperimental.ppr/experimental_pprcode - Deciding where
<Suspense>boundaries go, or debugging anUncached data was accessed outside of <Suspense>build error - Adding
'use cache',cacheLife,cacheTag, or choosingupdateTag/revalidateTag/refreshafter a mutation - Composing forms, multi-step wizards, dashboards, or streaming server data into interactive Client Components
- Empirically verifying or debugging what actually rendered — which parts are in the static shell vs streamed, where the CSR/SSR boundary is, and why a route went dynamic
Rule Categories
| # | Category | Prefix | Covers |
|---|---|---|---|
| 1 | Setup & Mental Model | setup- |
Enabling PPR with cacheComponents; the removed experimental flags; dynamic-by-default / opt-in caching inversion |
| 2 | The Suspense Boundary | shell- |
<Suspense> as the static/dynamic seam; the build error; boundary granularity; what Suspense does not do |
| 3 | Caching with 'use cache' |
cache- |
Directive levels; automatic keys; runtime values as props; pass-through; cacheLife/cacheTag; serverless durability |
| 4 | Runtime APIs & Non-Determinism | runtime- |
Async request APIs forcing a boundary; generateStaticParams; connection() for randomness/time |
| 5 | Page Composition Recipes | compose- |
Single hole → parallel dashboard → Promise + use() streaming → not opting the whole app out of the shell |
| 6 | Forms, Mutations & Wizards | mutate- |
updateTag vs revalidateTag vs refresh; URL-driven wizard steps; <Activity> field preservation |
Quick Reference
1. Setup & Mental Model
setup-enable-cache-components— Enable PPR viacacheComponents: true; theexperimental.ppr/experimental_pprflags are removedsetup-dynamic-by-default— Everything renders at request time; caching is opt-in via'use cache'(andfetchis no longer cached)
2. The Suspense Boundary
shell-suspense-is-the-boundary—<Suspense>is the static-shell/dynamic-stream seam, not a spinnershell-wrap-uncached-data— Uncached/runtime reads must be wrapped (or'use cache'd) or the build errorsshell-suspense-does-not-force-dynamic— Suspense alone does not make synchronous work dynamicshell-place-boundaries-low— Wrap the dynamic leaf, not the whole page, so the shell stays large
3. Caching with 'use cache'
cache-use-cache-directive— Mark static/cacheable work at the function / component / page / layout / file levelcache-keys-are-automatic— Arguments and closures form the cache key; pass varying inputs as argscache-pass-runtime-values-as-props— You can't readcookies()/headers()inside a cached scope; pass values incache-pass-through-children-and-actions— Pass dynamicchildrenand Server Actions through a cached component untouched- [
cache-set-lifetime-and-tags](references/cache-set-lifetime-and-tags.m
Установить nextjs-ppr-patterns в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл nextjs-ppr-patterns?
Next.js 16 App Router pages mixing static and dynamic content — Partial Prerendering (PPR) under the Cache Components model. Covers enabling it with cacheComponents (the removed experimental.ppr / experimental_ppr flags), the dynamic-by-default rendering inversion, the Suspense static-shell/dynamic-hole boundary, the 'use cache' directive (automatic keys, cacheLife/cacheTag, children/action pass-through, runtime values as props, serverless durability), async runtime APIs and connection() for non-determinism, page composition from a single hole to parallel dashboards to streaming a Promise into a Client Component with use(), and forms/wizards with updateTag read-your-writes and Activity state preservation. Triggers on PPR, cacheComponents, 'use cache', Suspense streaming, partial prerendering, or static-shell work even when not named explicitly.
Как установить скилл nextjs-ppr-patterns?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл nextjs-ppr-patterns запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic