Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add affaan-m/ECC --skill nextjs-turbopack -a claude-code
Open on GitHub

What 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 dev startup
  • investigate slow HMR updates
  • decide when to use webpack instead of Turbopack in development
  • check whether a project should use proxy.ts or middleware.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-code

2Manually: put the files in place

~/.claude/skills/nextjs-turbopack/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/nextjs-turbopack/

From the same set146

The whole set →
video-editing affaan-m AI-assisted workflow for editing, trimming, and enriching real footage. Connects raw recordings with FFmpeg cuts, Remotion overlays, and ElevenLabs voiceovers. Claude Code CX Codex Cursor +1 6,500installs docker-patterns affaan-m A skill with Dockerfile and Docker Compose patterns: local dev stacks, networking, volumes, container hardening. Claude Code CX Codex Cursor +1 6,300installs frontend-patterns affaan-m A skill for React and Next.js work: component patterns, state, data fetching, and render performance. Use it when building or reviewing UI. Claude Code CX Codex Cursor +1 5,900installs backend-patterns affaan-m A skill with backend patterns for Node.js, Express and Next.js API routes: layering, caching, transactions, error handling. Claude Code CX Codex Cursor +1 5,900installs coding-standards affaan-m Baseline cross-project coding conventions for naming, immutability, and clean code principles. Useful for code reviews and refactoring. Claude Code CX Codex Cursor +1 5,600installs api-design affaan-m Provides REST API design standards covering resource naming, status codes, pagination, and error payloads. Use it when creating or auditing API contracts. Claude Code CX Codex Cursor +1 5,500installs rust-testing affaan-m A skill for writing Rust tests: unit, integration, async, property-based, mocks and coverage. Useful when the project runs on TDD. Claude Code CX Codex Cursor +1 5,500installs laravel-security affaan-m This skill reviews Laravel authentication, Eloquent safety, CSRF, XSS, APIs, and production settings. Use it for security reviews or deployment checks. Claude Code CX Codex Cursor +1 5,400installs

Similar

build-dashboard official anthropics Builds a self-contained HTML dashboard with Chart.js charts, KPI cards, and filterable tables. Useful for turning raw data or queries into a standalone browser report. Claude Code CX Codex Cursor +1 9,100installs stitch::extract-design-md official google-labs-code Extracts a complete DESIGN.md design system directly from frontend source files without building or rendering the project. Useful for styling audits and Stitch exports. Claude Code CX Codex Cursor +1 10,500installs turnstile-spin cloudflare Sets up Cloudflare Turnstile bot verification across existing frontend and backend code, including widget embedding and server-side siteverify. Claude Code CX Codex Cursor +1 92,200installs next-partial-prefetching-optimizer vercel Tunes Next.js 16.3+ client link prefetching under Partial Prefetching. Balances instant navigation against deferred data reads before the user clicks. Claude Code CX Codex Cursor +1 2,300installs better-typography jakubkrehel Reviews interface typography and applies fixes through the project’s styling system. Use it to check text hierarchy, wrapping, truncation and punctuation. Claude Code CX Codex Cursor +1 33,800installs frontend-design official anthropics This skill guides intentional visual design for new interfaces and redesigns. Use it when a generic generated UI is not enough. Claude Code Claude.ai 1,025,790installs design-taste-frontend Leonxlnx This skill directs the design of public pages and work screens, then checks the result in a browser through screenshots. Use it when an interface feels generic or unfinished. Claude Code CX Codex Cursor +1 673,100installs prototype Matt Pocock Creates throwaway prototypes for checking state logic or exploring UI before committing the decision to the main codebase. Claude Code 986,201installs

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

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor