{"slug":"nextjs-turbopack","title":"nextjs-turbopack","summary":"Next.js 16+ and Turbopack guidance — incremental Rust bundling, file-system caching, faster dev startup and HMR, Turbopack vs webpack tradeoffs, and the middleware.ts to proxy.ts filename change. Use when developing or debugging Next.js 16+ apps, diagnosing slow dev startup or ho","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-12-02T16:53:43.77016Z","repo":{"url":"https://github.com/beginwithu/agent-skills","stars":11,"forks":2,"license":"MIT","updatedAt":"2026-12-02T16:37:11Z"},"bodyHtml":"<hr>\n<h2>name: nextjs-turbopack\ndescription: Next.js 16+ and Turbopack guidance — incremental Rust bundling, file-system caching, faster dev startup and HMR, Turbopack vs webpack tradeoffs, and the middleware.ts to proxy.ts filename change. Use when developing or debugging Next.js 16+ apps, diagnosing slow dev startup or hot reload, choosing between bundlers, or reviewing middleware/proxy file naming.\nmetadata:\norigin: ECC</h2>\n<h1>Next.js and Turbopack</h1>\n<p>Next.js 16+ uses Turbopack by default for local development: an incremental bundler written in Rust that significantly speeds up dev startup and hot updates.</p>\n<h2>When to Use</h2>\n<ul>\n<li><strong>Turbopack (default dev)</strong>: Use for day-to-day development. Faster cold start and HMR, especially in large apps.</li>\n<li><strong>Webpack (legacy dev)</strong>: Use only if you hit a Turbopack bug or rely on a webpack-only plugin in dev. Disable with <code>--webpack</code> (or <code>--no-turbopack</code> depending on your Next.js version; check the docs for your release).</li>\n<li><strong>Production</strong>: Production build behavior (<code>next build</code>) may use Turbopack or webpack depending on Next.js version; check the official Next.js docs for your version.</li>\n</ul>\n<p>Use when: developing or debugging Next.js 16+ apps, diagnosing slow dev startup or HMR, or optimizing production bundles.</p>\n<h2>How It Works</h2>\n<ul>\n<li><strong>Turbopack</strong>: Incremental bundler for Next.js dev. Uses file-system caching so restarts are much faster (e.g. 5–14x on large projects).</li>\n<li><strong>Default in dev</strong>: From Next.js 16, <code>next dev</code> runs with Turbopack unless disabled.</li>\n<li><strong>File-system caching</strong>: Restarts reuse previous work; cache is typically under <code>.next</code>; no extra config needed for basic use.</li>\n<li><strong>Bundle Analyzer (Next.js 16.1+)</strong>: Experimental Bundle Analyzer to inspect output and find heavy dependencies; enable via config or experimental flag (see Next.js docs for your version).</li>\n</ul>\n<h2>Examples</h2>\n<h3>Commands</h3>\n<pre><code>next dev\nnext build\nnext start\n</code></pre>\n<h3>Usage</h3>\n<p>Run <code>next dev</code> for local development with Turbopack. Use the Bundle Analyzer (see Next.js docs) to optimize code-splitting and trim large dependencies. Prefer App Router and server components where possible.</p>\n<h2>Middleware File Naming</h2>\n<p>Next.js 16 introduced <code>proxy.ts</code> as the middleware filename, replacing the older <code>middleware.ts</code> convention:</p>\n<ul>\n<li><strong>Next.js 16+</strong>: use <code>proxy.ts</code> at the project root</li>\n<li><strong>Pre-Next.js 16</strong>: use <code>middleware.ts</code> at the project root</li>\n</ul>\n<p>The filename change is tied to the <strong>Next.js version</strong>, not to which bundler (Turbopack or webpack) is in use. Always check the official docs for the version you are reviewing.</p>\n<p><strong>Do not flag <code>proxy.ts</code> as a misnamed or missing middleware file in Next.js 16 projects.</strong> The file is correct and intentional. Suggesting a rename to <code>middleware.ts</code> will break middleware execution.</p>\n<p>Reference: <a href=\"https://nextjs.org/docs/app/getting-started/proxy\">Next.js proxy docs</a></p>\n<h2>Best Practices</h2>\n<ul>\n<li>Stay on a recent Next.js 16.x for stable Turbopack and caching behavior.</li>\n<li>If dev is slow, ensure you're on Turbopack (default) and that the cache isn't being cleared unnecessarily.</li>\n<li>For production bundle size issues, use the official Next.js bundle analysis tooling for your version.</li>\n</ul>\n","files":[{"path":"LICENSE","sizeBytes":1071,"isText":false},{"path":"SKILL.md","sizeBytes":3141,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-12-02T16:57:41.420719Z","sha256":"9B80B4725803378F784AD591265787A4C7653E76140C3755205CE9719E252F37","sizeBytes":2201},"review":null,"source":{"repositoryUrl":"https://github.com/beginwithu/agent-skills","path":"skills/nextjs-turbopack","license":"MIT","commit":"a960304c52212f2e845067047f5cefc0c594d787","subtreeSha":"98CBCD82B9DD116054AB86298D95FCBE0427DFB32965C91096BA9D3305FDB681","lastSyncedAt":"2026-12-02T16:52:59.20206Z"},"reviewedAt":"2026-12-02T17:05:15.190726Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/beginwithu/agent-skills/tree/main/skills/nextjs-turbopack"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install beginwithu-agent-skills@llmmart"},{"target":"git","command":"git clone https://github.com/beginwithu/agent-skills.git"}]}