Repository navigation
skill: add Partial Prefetching optimizer - #96471
Merged
Merged
Conversation
Contributor
Stats from current PR🟢 1 improvement
📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
Build Cache
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📝 Changed Files (33 files)Files with changes:
View diffsapp-page-exp..ntime.dev.jsfailed to diffapp-page-exp..time.prod.jsfailed to diffapp-page-tur..ntime.dev.jsfailed to diffapp-page-tur..time.prod.jsfailed to diffapp-page-tur..ntime.dev.jsfailed to diffapp-page-tur..time.prod.jsDiff too large to display app-page.runtime.dev.jsfailed to diffapp-page.runtime.prod.jsDiff too large to display app-route-ex..ntime.dev.jsDiff too large to display app-route-ex..time.prod.jsDiff too large to display app-route-tu..ntime.dev.jsDiff too large to display app-route-tu..time.prod.jsDiff too large to display app-route-tu..ntime.dev.jsDiff too large to display app-route-tu..time.prod.jsDiff too large to display app-route.runtime.dev.jsDiff too large to display app-route.ru..time.prod.jsDiff too large to display dev-validati..ntime.dev.jsfailed to diffdev-validati..ntime.dev.jsfailed to diffdev-validati..ntime.dev.jsfailed to diffdev-validati..ntime.dev.jsfailed to diffpages-api-tu..ntime.dev.jsDiff too large to display pages-api-tu..time.prod.jsDiff too large to display pages-api.runtime.dev.jsDiff too large to display pages-api.ru..time.prod.jsDiff too large to display pages-turbo...ntime.dev.jsDiff too large to display pages-turbo...time.prod.jsDiff too large to display pages.runtime.dev.jsDiff too large to display pages.runtime.prod.jsDiff too large to display server.runtime.prod.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display use-cache-pr..ntime.dev.jsDiff too large to display 📎 Tarball URLCommit: 598df91 |
Contributor
Tests PassedCommit: c8ab0c1 |
aurorascharff
changed the base branch from
canary
to
codex/ai-agent-skills-guide
August 2, 2026 10:28
aurorascharff
added a commit
that referenced
this pull request
Aug 3, 2026
## Summary - clarify how runtime foundations, interactive workflows, and unattended loops fit into the AI agents and Instant Navigation guides - harden the Cache Components and Partial Prefetching Skills around capability checks, trustworthy `instant()` tests, route scope, and real-app verification failures - add migration-guide comments to temporary Partial Prefetching route config and update `remove-partial-prefetch` to remove only generated comments while preserving runtime-prefetch TODOs and user comments This keeps the experimental Partial Prefetching optimizer in #96471 separate. ## Testing - `pnpm --filter @next/codemod build` - `pnpm --filter @next/codemod test -- transforms/__tests__/remove-partial-prefetch.test.js --runInBand`
m-kawafuji
pushed a commit
to m-kawafuji/next.js
that referenced
this pull request
Aug 8, 2026
## Summary - clarify how runtime foundations, interactive workflows, and unattended loops fit into the AI agents and Instant Navigation guides - harden the Cache Components and Partial Prefetching Skills around capability checks, trustworthy `instant()` tests, route scope, and real-app verification failures - add migration-guide comments to temporary Partial Prefetching route config and update `remove-partial-prefetch` to remove only generated comments while preserving runtime-prefetch TODOs and user comments This keeps the experimental Partial Prefetching optimizer in vercel#96471 separate. ## Testing - `pnpm --filter @next/codemod build` - `pnpm --filter @next/codemod test -- transforms/__tests__/remove-partial-prefetch.test.js --runInBand`
aurorascharff
changed the base branch from
canary
to
codex/adoption-skill-evals
August 27, 2026 17:06
aurorascharff
force-pushed
the
codex/partial-prefetching-optimizer
branch
from
September 7, 2026 13:27
395cb1b to
623fb93
Compare
aurorascharff
force-pushed
the
codex/partial-prefetching-optimizer
branch
from
September 8, 2026 18:06
522ef2a to
0c3d0fe
Compare
Contributor
|
All broken links are now fixed, thank you! |
aurorascharff
marked this pull request as ready for review
September 9, 2026 10:14
…tching-optimizer-rebased # Conflicts: # evals/lib/setup.ts # run-evals.js
…tching-optimizer-rebased
…zer' into codex/partial-prefetching-optimizer-rebased
aurorascharff
force-pushed
the
codex/partial-prefetching-optimizer
branch
from
September 9, 2026 15:22
66a8ab2 to
71c4358
Compare
icyJoseph
reviewed
Sep 10, 2026
gaojude
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
instant()loop, differential verification, and mutation freshness when an optimization adds a cache around mutable dataunstable_prefetch()andunstable_navigation()docs instead of explaining the APIs again in the SkillThis follows the same guide/Skill split as #97737. Partial Prefetching adoption preserves existing behavior; this optimizer is the later decision about what is worth preparing before a click and what should wait for navigation.
Related: #97712, #97737, #97759, #98122, #98175
Eval
One run per treatment with Claude Opus 4.8 and Claude Sonnet 4.5, using a fixed Claude Haiku 4.5 judge. The bundled-guide and Skill treatments use a local Next.js tarball containing the new guide and API references.
Token totals count each unique model message once and include uncached input, cache creation, cache reads, and output. Cache reads account for most of the total in every treatment. Total run cost applies the current AI Gateway base rates to each token category: Opus 4.8 costs $5/M input, $6.25/M cache writes, $0.50/M cache reads, and $25/M output; Sonnet 4.5 costs $3/M input, $3.75/M cache writes, $0.30/M cache reads, and $15/M output. The six agent runs cost $11.78 in total.
Compared with baseline, the Opus Skill run maintained a 100% criteria pass rate while reducing cost by 26.7%. The Sonnet Skill run improved the criteria pass rate from 20% to 80%, a 60 percentage-point increase, while reducing cost by 27.3%.
The stronger model could solve the fixture without the Skill, although it independently searched the bundled Next.js documentation and took slightly longer than the Skill treatment. The Opus guide-only run implemented the correct behavior but missed the required RED-before-GREEN proof.
The Sonnet treatments show a clearer progression. Baseline did not implement the required caching, navigation stage,
instant()contract, or cache invalidation. The bundled guide added the cached summary and production test, but missed the navigation stage, deferred-state assertions, tag invalidation, and RED-before-GREEN proof. The Skill treatment completed theinstant()RED-to-GREEN loop and final production behavior, but leftconnection()in the related-sessions read and used path revalidation instead of tagging the cached read. It therefore passed 8 of 10 criteria but failed the overall eval.All six measured runs completed through grading. Chromium and its system dependencies are provisioned before the agent starts, so missing browser libraries did not determine these results.
Verification
pnpm --filter=next buildpnpm prettier --checkfor the changed guide, prompt, Skill, and eval fixturepnpm exec tsc -p evals/evals/agent-051-optimize-partial-prefetching/tsconfig.json --noEmitnode --check run-evals.jsgit diff --checknavigation()andprefetch()referencesnavigation()contract in the minimal reproduction and NextBeats on Next.js 16.4.0-canary.22canary, preserving both generic fixture setup and Playwright provisioning