Official Next.js agent skill that reads Turbopack's module graph to find client JavaScript that could be deferred, duplicated dependencies and failed tree shaking, then reports or applies the fixes.
Shipped with Next.js 16.4 and needs Turbopack. Install it with npx skills add vercel/next.js --skill next-bundle-optimizer and run /next-bundle-optimizer in your agent. The skill has the agent export saved next analyze snapshots as JSON, rebuild the module and chunk graphs, and trace import chains. It uses a minimum cut to find the few import boundaries that would defer a large group of modules, such as a lazy() component that still loads upfront because another module imports it statically.
Audit is the default: it reports candidates and leaves the code alone. /next-bundle-optimizer fix applies the changes, reruns the analysis and compares before/after snapshots. It also looks for logic that could move to React Server Components and for duplicate versions of large dependencies. Vercel says agents using it cut nearly 2 MB of compressed JavaScript across v0 and vercel.com.