next-partial-prefetching-adoption

Migrates a Next.js app to Partial Prefetching with test-backed preservation of prefetched UI.

Updated Sep 16, 2026
One-click install
npx skills add https://github.com/jasonviipers/vipers --skill next-partial-prefetching-adoption-jasonviipers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-partial-prefetching-adoption
Source: https://github.com/jasonviipers/vipers/tree/main/.agents/skills/next-partial-prefetching-adoption
Command: npx skills add https://github.com/jasonviipers/vipers --skill next-partial-prefetching-adoption-jasonviipers

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Enabling Partial Prefetching in Next.js changes how links prefetch content, and without a structured migration you can silently lose prefetched UI that users relied on. This Skill sequences the entire adoption: auditing Link prefetch behavior, locking in a legacy baseline, opting routes in, enabling the flag, and sweeping for URL-data insights. ## 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 @next/playwright's instant() helper so the legacy prefetched UI is locked in as a passing flag-off baseline before any migration edits. - Guided rollout and insight sweep: Adopts routes with export const prefetch = 'partial', enables the global flag, runs the remove-partial-prefetch codemod, then sweeps dev-mode insights like instant-shell-url-data. - Use Case: A team on Next.js 16.3 with Cache Components enabled wants to turn on partialPrefetching without regressing their dashboard navigation; the Skill audits their links, writes preservation tests, migrates each route, and verifies instant navigations against a production build. ## Quick Start Ask the agent to adopt Partial Prefetching in your Next.js app, starting with an audit of all Link prefetch usage and a flag-off preservation 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 Next.js?

Set partialPrefetching: true in next.config alongside cacheComponents: true, which requires Next.js 16.3 or later. Before enabling globally, audit existing Link prefetch usage and opt routes in with export const prefetch = 'partial' so prefetched UI is preserved.

How do I test that prefetched UI survives a Next.js migration?

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

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. If Cache Components is not adopted, complete that migration first and resolve its build-blocking prerender errors.

Why don't prefetch insights 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 note that blocking-prerender errors on a route replace the insight until fixed.

What is the difference between Link prefetch true and partial prefetching?

A default link under Partial Prefetching warms only the shared App Shell, while prefetch={true} on an adopted route also resolves URL-specific data before the click. The migration audit decides which legacy full-prefetch behavior to preserve per navigation.