nextjs-turbopack — Claude Code skill for Next.js
This skill covers Turbopack in Next.js 16+, when webpack may be needed, and the middleware.ts to proxy.ts change. Use it while debugging development builds or checking a version upgrade.
npx skills add affaan-m/ECC --skill nextjs-turbopack -a claude-codeWhat nextjs-turbopack does
In Next.js 16+, next dev uses Turbopack by default. The skill explains its incremental Rust bundling and the file-system cache in .next, which reuses work after restarts. It also covers when to switch to webpack in development: when you hit a Turbopack bug or depend on a webpack-only plugin.
For bundle analysis, it mentions the experimental Bundle Analyzer in Next.js 16.1+. The behavior of next build depends on the Next.js version, so the skill advises checking that version's documentation. It also clarifies the filename change: use proxy.ts in Next.js 16+ and middleware.ts in earlier versions. The filename follows the Next.js version, not the bundler.
Install this skill if you develop or review Next.js 16+ apps. It is less relevant if your work does not involve Next.js.
What it helps with
- diagnose a slow
next devstartup - investigate slow HMR updates
- decide when to use webpack instead of Turbopack in development
- check whether a project should use
proxy.tsormiddleware.ts - inspect large dependencies with the Bundle Analyzer
Example prompts for the agent
- Check why `next dev` starts slowly in this project.
- For this Next.js version, should I keep `proxy.ts` or rename it to `middleware.ts`?
- When should I switch this development setup from Turbopack to webpack?
How to install nextjs-turbopack
1Skills CLI (Vercel)
npx skills add affaan-m/ECC --skill nextjs-turbopack -a claude-code2Manually: put the files in place
~/.claude/skills/nextjs-turbopack/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/nextjs-turbopack/
1Skills CLI (Vercel)
npx skills add affaan-m/ECC --skill nextjs-turbopack -a codex2Manually: put the files in place
.agents/skills/nextjs-turbopack/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add affaan-m/ECC --skill nextjs-turbopack -a cursor2Manually: put the files in place
.cursor/skills/nextjs-turbopack/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install affaan-m/ECC nextjs-turbopack2Manually: put the files in place
.github/skills/nextjs-turbopack/SKILL.md1Skills CLI (Vercel)
npx skills add affaan-m/ECC --skill nextjs-turbopack -a gemini-cli2Platform CLI
gemini skills install https://github.com/affaan-m/ECC --path skills/nextjs-turbopackManually: put the files in place
.devin/skills/nextjs-turbopack/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add affaan-m/ECC --skill nextjs-turbopack -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set146
The whole set →Similar
Questions about nextjs-turbopack
How do I install nextjs-turbopack in Claude Code?
Run npx skills add affaan-m/ECC --skill nextjs-turbopack -a claude-code. The skill file is at ~/.claude/skills/nextjs-turbopack/SKILL.md.
What does nextjs-turbopack do?
It provides guidance on Turbopack in Next.js 16+, its file-system cache, and tradeoffs with webpack. It also explains the proxy.ts and middleware.ts naming change.
Should I rename `middleware.ts` to `proxy.ts` when switching to Turbopack?
The filename depends on the Next.js version, not the bundler. Use proxy.ts with Next.js 16+ and middleware.ts with earlier versions.
Source text
SKILL.md · MIT
--- name: nextjs-turbopack description: 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. metadata: origin: ECC --- # Next.js and Turbopack 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. ## When to Use - **Turbopack (default dev)**: Use for day-to-day development. Faster cold start and HMR, especially in large apps. - **Webpack (legacy dev)**: Use only if you hit a Turbopack bug or rely on a webpack-only plugin in dev. Disable with `--webpack` (or `--no-turbopack` depending on your Next.js version; check the docs for your release). - **Production**: Production build behavior (`next build`) may use Turbopack or webpack depending on Next.js version; check the official Next.js docs for your version. Use when: developing or debugging Next.js 16+ apps, diagnosing slow dev startup or HMR, or optimizing production bundles. ## How It Works - **Turbopack**: Incremental bundler for Next.js dev. Uses file-system caching so restarts are much faster (e.g. 5–14x on large projects). - **Default in dev**: From Next.js 16, `next dev` runs with Turbopack unless disabled. - **File-system caching**: Restarts reuse previous work; cache is typically under `.next`; no extra config needed for basic use. - **Bundle Analyzer (Next.js 16.1+)**: Experimental Bundle Analyzer to inspect output and find heavy dependencies; enable via config or experimental flag (see Next.js docs for your version). ## Examples ### Commands ```bash next dev next build next start ``` ### Usage Run `next dev` 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. ## Middleware File Naming Next.js 16 introduced `proxy.ts` as the middleware filename, replacing the older `middleware.ts` convention: - **Next.js 16+**: use `proxy.ts` at the project root - **Pre-Next.js 16**: use `middleware.ts` at the project root The filename change is tied to the **Next.js version**, not to which bundler (Turbopack or webpack) is in use. Always check the official docs for the version you are reviewing. **Do not flag `proxy.ts` as a misnamed or missing middleware file in Next.js 16 projects.** The file is correct and intentional. Suggesting a rename to `middleware.ts` will break middleware execution. Reference: [Next.js proxy docs](https://nextjs.org/docs/app/getting-started/proxy) ## Best Practices - Stay on a recent Next.js 16.x for stable Turbopack and caching behavior. - If dev is slow, ensure you're on Turbopack (default) and that the cache isn't being cleared unnecessarily. - For production bundle size issues, use the official Next.js bundle analysis tooling for your version.
© affaan-m · MIT · affaan-m/ECC