next-partial-prefetching-adoption

Guides enabling Partial Prefetching in Next.js apps and resolving its development insights.

1|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/Ech0xff/personal-site --skill next-partial-prefetching-adoption-ech0xff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-partial-prefetching-adoption
Source: https://github.com/Ech0xff/personal-site/tree/main/.agents/skills/next-partial-prefetching-adoption
Command: npx skills add https://github.com/Ech0xff/personal-site --skill next-partial-prefetching-adoption-ech0xff

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @next/playwright, @playwright/test, @next/codemod, and includes references (resource) components.

What problem does it solve? Migrating a Next.js app to Partial Prefetching requires auditing every prefetched link, preserving the UI users already see instantly, and resolving new development insights — a multi-step process that is easy to get wrong without a structured workflow. ## Core Features & Use Cases - Link Prefetch Audit: Enumerates every <Link prefetch={true}> and router.prefetch() call across the source tree and decides which prefetched UI must be preserved. - Test-Backed Preservation: Builds a production-mode Playwright rig using the @next/playwright instant() helper to lock the legacy prefetched UI as a regression suite before enabling the flag. - Insight-Driven Sweep: Walks routes in next dev to resolve the instant-link-prefetch-partial and instant-shell-url-data insights, then enables partialPrefetching globally and strips temporary route exports with the remove-partial-prefetch codemod. - Use Case: A team on Next.js 16.3 with Cache Components enabled wants instant navigations; this skill sequences the audit, baseline tests, per-route adoption, flag enablement, and production verification. ## Quick Start Ask the AI to adopt Partial Prefetching in your Next.js app, starting with an audit of all prefetched links and a passing flag-off instant() test baseline.

Frequently Asked Questions about next-partial-prefetching-adoption

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable Partial Prefetching in a Next.js app?

Set partialPrefetching: true in next.config alongside cacheComponents: true, after opting each destination route in with export const prefetch = 'partial'. Audit existing Link prefetch={true} navigations first so the prefetched UI users rely on is preserved.

How do I test prefetched UI with Playwright in Next.js?

Use the instant() helper from the @next/playwright package against a production build with experimental.exposeTestingApiInProductionBuild enabled. Run the suite with partialPrefetching disabled first to lock the legacy baseline, then rerun it after each route adopts.

Does Partial Prefetching require Cache Components in Next.js?

Yes, both the partialPrefetching flag and the route-level prefetch export require cacheComponents: true with a passing build. It also requires Next.js 16.3 or later, where the flag, route config, and prefetch insights were introduced.

What is the instant-shell-url-data insight in Next.js?

It fires in next dev when a params or searchParams read sits too high in the suspended subtree, tying the shared App Shell to one URL. Fix it by moving the read behind a deeper Suspense boundary so the shell stays shared across URLs.

Why do prefetch insights not appear in the Next.js dev overlay?

The Insights tab only appears after an insight has fired, so a clean route shows no tab at all. Confirm the clean state from the dev server log, and check for blocking-prerender errors, which replace insights on their route.

When should I use Link prefetch={true} with Partial Prefetching?

Use it only when a specific link should resolve URL-specific content before the click, since each per-link prefetch costs a server invocation. Default links already prefetch the shared App Shell, so keep prefetch={true} for routes where instant URL data justifies the cost.