/turbopack
Turbopack expert guidance. Use when configuring the Next.js bundler, optimizing HMR, debugging build issues, or understanding the Turbopack vs Webpack differences.
$ npx -y skills add vercel-labs/vercel-plugin --skill turbopack --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/turbopack
Context preview
The summary Claude sees to decide when to auto-load this skill.
Turbopack expert guidance. Use when configuring the Next.js bundler, optimizing HMR, debugging build issues, or understanding the Turbopack vs Webpack differences.
SKILL.md
turbopack.SKILL.mdname: turbopack
description: Turbopack expert guidance. Use when configuring the Next.js bundler, optimizing HMR, debugging build issues, or understanding the Turbopack vs Webpack differences.
metadata:
priority: 4
docs:
- "https://turbo.build/pack/docs"
- "https://nextjs.org/docs/architecture/turbopack"
sitemap: "https://turbo.build/sitemap.xml"
pathPatterns:
- 'next.config.*'
bashPatterns:
- '\bnext\s+dev\s+--turbo\b'
- '\bnext\s+dev\s+--turbopack\b'
retrieval:
aliases:
- next bundler
- turbopack
- fast bundler
- hmr
intents:
- enable turbopack
- fix build issue
- speed up dev server
- configure bundler
entities:
- Turbopack
- HMR
- bundler
- next dev --turbopack
chainTo:
-
pattern: 'webpack\s*:\s*\(|webpack\s*\(config'
targetSkill: nextjs
message: 'Webpack config detected — loading Next.js guidance for migrating webpack customizations to Turbopack top-level config in Next.js 16.'
-
pattern: 'turbopack\s*:\s*\{|experimental\.turbopack'
targetSkill: nextjs
message: 'Turbopack configuration detected — loading Next.js guidance for top-level turbopack config syntax in Next.js 16 (moved from experimental.turbopack).'Turbopack
You are an expert in Turbopack — the Rust-powered JavaScript/TypeScript bundler built by Vercel. It is the default bundler in Next.js 16.
Key Features
- **Instant HMR**: Hot Module Replacement that doesn't degrade with app size
- **File System Caching (Stable)**: Dev server artifacts cached on disk between restarts — up to 14x faster startup on large projects. Enabled by default in Next.js 16.1+, no config needed. Build caching planned next.
- **Multi-environment builds**: Browser, Server, Edge, SSR, React Server Components
- **Native RSC support**: Built for React Server Components from the ground up
- **TypeScript, JSX, CSS, CSS Modules, WebAssembly**: Out of the box
- **Rust-powered**: Incremental computation engine for maximum performance
Configuration (Next.js 16)
In Next.js 16, Turbopack config is top-level (moved from `experimental.turbopack`):
// next.config.ts
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
turbopack: {
// Resolve aliases (like webpack resolve.alias)
resolveAlias: {
'old-package': 'new-package',
},
// Custom file extensions to resolve
resolveExtensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
},
}
export default nextConfigCSS and CSS Modules Handling
Turbopack handles CSS natively without additional configuration.
Global CSS
Import global CSS in your root layout:
// app/layout.tsx
import './globals.css'
CSS Modules
CSS Modules work out of the box with `.module.css` files:
// components/Button.tsx
import styles from './Button.module.css'
export function Button({ children }) {
return <button className={styles.primary}>{children}</button>
}PostCSS
Turbopack reads your `postcss.config.js` automatically. Tailwind CSS v4 works with zero config:
// postcss.config.js
module.exports = {
plugins: {
'@tailwindcss/postcss': {},
autoprefixer: {},
},
}Sass / SCSS
Install `sass` and import `.scss` files directly — Turbopack compiles them natively:
npm install sass
import styles from './Component.module.scss'
Common CSS pitfalls
- **CSS ordering differs from webpack**: Turbopack may load CSS chunks in a different order. Avoid relying on source-order specificity across files — use more specific selectors or CSS Modules.
- **`@import` in global CSS**: Use standard CSS `@import` — Turbopack resolves them, but circular imports cause build failures.
- **CSS-in-JS libraries**: `styled-components` and `emotion` work but require their SWC plugins configured under `compiler` in next.config.
Tree Shaking
Turbopack performs tree shaking at the module level in production builds. Key behaviors:
- **ES module exports**: Only used exports are included — write `export` on each function/constant rather than barrel `export *`
- **Side-effect-free packages**: Mark packages as side-effect-free in `package.json` to enable aggressive tree shaking:
{
"name": "my-ui-lib",
"sideEffects": false
}- **Barrel file optimization**: Turbopack can skip unused re-exports from barrel files (`index.ts`) when the package declares `"sideEffects": false`
- **Dynamic imports**: `import()` expressions create async chunk boundaries — Turbopack splits these into separate chunks automatically
Diagnosing large bundles
**Built-in analyzer (Next.js 16.1+, experimental)**: Works natively with Turbopack. Offers route-specific filtering, import tracing, and RSC boundary analysis:
// next.config.ts
const nextConfig: NextConfig = {
experimental: {
bundleAnalyzer: true,
},
}**Legacy `@next/bundle-analyzer`**: Still works as a fallback:
ANALYZE=true next build
// next.config.ts
import withBundleAnalyzer from '@next/bundle-analyzer'
const nextConfig = withBundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
})({
// your config
})Custom Loader Migration from Webpack
Turbopack does not support webpack loaders directly. Here is how to migrate common patterns:
| Webpack Loader | Turbopack Equivalent | |----------------|---------------------| | `css-loader` + `style-loader` | Built-in CSS support — remove loaders | | `sass-loader` | Built-in — install `sass` package | | `postcss-loader` | Built-in — reads `postcss.config.js` | | `file-loader` / `url-loader` | Built-in static asset handling | | `svgr` / `@svgr/webpack` | Use `@svgr/webpack` via `turbopack.rules` | | `raw-loader` | Use `import x from './file?raw'` | | `graphql-tag/loader` | Use a build-time codegen step instead | | `worker-loader` | Use native `new Worker(new URL(...))` syntax |
Configuring custom rules (loader replacement)
For loaders that ha
Read more
name: turbopack
description: Turbopack expert guidance. Use when configuring the Next.js bundler, optimizing HMR, debugging build issues, or understanding the Turbopack vs Webpack differences.
metadata:
priority: 4
docs:
- "https://turbo.build/pack/docs"
- "https://nextjs.org/docs/architecture/turbopack"
sitemap: "https://turbo.build/sitemap.xml"
pathPatterns:
- 'next.config.*'
bashPatterns:
- '\bnext\s+dev\s+--turbo\b'
- '\bnext\s+dev\s+--turbopack\b'
retrieval:
aliases:
- next bundler
- turbopack
- fast bundler
- hmr
intents:
- enable turbopack
- fix build issue
- speed up dev server
- configure bundler
entities:
- Turbopack
- HMR
- bundler
- next dev --turbopack
chainTo:
-
pattern: 'webpack\s*:\s*\(|webpack\s*\(config'
targetSkill: nextjs
message: 'Webpack config detected — loading Next.js guidance for migrating webpack customizations to Turbopack top-level config in Next.js 16.'
-
pattern: 'turbopack\s*:\s*\{|experimental\.turbopack'
targetSkill: nextjs
message: 'Turbopack configuration detected — loading Next.js guidance for top-level turbopack config syntax in Next.js 16 (moved from experimental.turbopack).'Turbopack
You are an expert in Turbopack — the Rust-powered JavaScript/TypeScript bundler built by Vercel. It is the default bundler in Next.js 16.
Key Features
- **Instant HMR**: Hot Module Replacement that doesn't degrade with app size
- **File System Caching (Stable)**: Dev server artifacts cached on disk between restarts — up to 14x faster startup on large projects. Enabled by default in Next.js 16.1+, no config needed. Build caching planned next.
- **Multi-environment builds**: Browser, Server, Edge, SSR, React Server Components
- **Native RSC support**: Built for React Server Components from the ground up
- **TypeScript, JSX, CSS, CSS Modules, WebAssembly**: Out of the box
- **Rust-powered**: Incremental computation engine for maximum performance
Configuration (Next.js 16)
In Next.js 16, Turbopack config is top-level (moved from `experimental.turbopack`):
// next.config.ts
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
turbopack: {
// Resolve aliases (like webpack resolve.alias)
resolveAlias: {
'old-package': 'new-package',
},
// Custom file extensions to resolve
resolveExtensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
},
}
export default nextConfigCSS and CSS Modules Handling
Turbopack handles CSS natively without additional configuration.
Global CSS
Import global CSS in your root layout:
// app/layout.tsx import './globals.css'
CSS Modules
CSS Modules work out of the box with `.module.css` files:
// components/Button.tsx
import styles from './Button.module.css'
export function Button({ children }) {
return <button className={styles.primary}>{children}</button>
}PostCSS
Turbopack reads your `postcss.config.js` automatically. Tailwind CSS v4 works with zero config:
// postcss.config.js
module.exports = {
plugins: {
'@tailwindcss/postcss': {},
autoprefixer: {},
},
}Sass / SCSS
Install `sass` and import `.scss` files directly — Turbopack compiles them natively:
npm install sass
import styles from './Component.module.scss'
Common CSS pitfalls
- **CSS ordering differs from webpack**: Turbopack may load CSS chunks in a different order. Avoid relying on source-order specificity across files — use more specific selectors or CSS Modules.
- **`@import` in global CSS**: Use standard CSS `@import` — Turbopack resolves them, but circular imports cause build failures.
- **CSS-in-JS libraries**: `styled-components` and `emotion` work but require their SWC plugins configured under `compiler` in next.config.
Tree Shaking
Turbopack performs tree shaking at the module level in production builds. Key behaviors:
- **ES module exports**: Only used exports are included — write `export` on each function/constant rather than barrel `export *`
- **Side-effect-free packages**: Mark packages as side-effect-free in `package.json` to enable aggressive tree shaking:
{
"name": "my-ui-lib",
"sideEffects": false
}- **Barrel file optimization**: Turbopack can skip unused re-exports from barrel files (`index.ts`) when the package declares `"sideEffects": false`
- **Dynamic imports**: `import()` expressions create async chunk boundaries — Turbopack splits these into separate chunks automatically
Diagnosing large bundles
**Built-in analyzer (Next.js 16.1+, experimental)**: Works natively with Turbopack. Offers route-specific filtering, import tracing, and RSC boundary analysis:
// next.config.ts
const nextConfig: NextConfig = {
experimental: {
bundleAnalyzer: true,
},
}**Legacy `@next/bundle-analyzer`**: Still works as a fallback:
ANALYZE=true next build
// next.config.ts
import withBundleAnalyzer from '@next/bundle-analyzer'
const nextConfig = withBundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
})({
// your config
})Custom Loader Migration from Webpack
Turbopack does not support webpack loaders directly. Here is how to migrate common patterns:
| Webpack Loader | Turbopack Equivalent | |----------------|---------------------| | `css-loader` + `style-loader` | Built-in CSS support — remove loaders | | `sass-loader` | Built-in — install `sass` package | | `postcss-loader` | Built-in — reads `postcss.config.js` | | `file-loader` / `url-loader` | Built-in static asset handling | | `svgr` / `@svgr/webpack` | Use `@svgr/webpack` via `turbopack.rules` | | `raw-loader` | Use `import x from './file?raw'` | | `graphql-tag/loader` | Use a build-time codegen step instead | | `worker-loader` | Use native `new Worker(new URL(...))` syntax |
Configuring custom rules (loader replacement)
For loaders that ha
Comprehensive Vercel ecosystem plugin — relational knowledge graph, skills for every major product, specialized agents, and Vercel conventions. Turns any AI agent into a Vercel expert.
Repo: vercel-labs/vercel-plugin
Other skills on vercel.
- /benchmark-agents
Advanced AI agent benchmark scenarios that push Vercel's cutting-edge platform features — Workflow DevKit, AI Gateway, MCP, Chat SDK, Queues, Flags, Sandbox, and multi-agent orchestration. Designed to stress-test skill injection for complex, multi-system builds.
Open skill - /benchmark-e2e
End-to-end benchmark suite for vercel-plugin. Runs realistic projects through skill injection, launches dev servers, verifies everything works, analyzes conversation logs, and produces an improvement report for overnight self-improvement loops.
Open skill - /benchmark-sandbox
Run vercel-plugin eval scenarios in Vercel Sandboxes instead of local WezTerm panels. Provisions ephemeral microVMs with Claude Code + plugin pre-installed, runs benchmark prompts, extracts hook artifacts, and produces coverage reports.
Open skill - /benchmark-testing
Create and launch benchmark test projects to exercise vercel-plugin skill injection across realistic scenarios. Sets up isolated directories, installs the plugin, and spawns WezTerm panes running Claude Code with crafted prompts.
Open skill - /plugin-audit
Audit vercel-plugin performance on real-world projects. Extracts tool calls from Claude Code conversation logs, tests hook matching against actual inputs, identifies pattern coverage gaps, and checks plugin cache staleness. Use when asked to audit, test, or investigate plugin
Open skill - /release
Release vercel-plugin — run gates, bump version, generate artifacts, commit, and push. Use when asked to "release", "ship", "bump and push", or "cut a release".
Open skill

