nextjs-turbopack

Next.js 16+ and Turbopack — incremental bundling, FS caching, dev speed, and when to use Turbopack vs webpack.

144,923 stars
Complexity: easy

About this skill

This skill provides an AI agent with comprehensive knowledge about Next.js 16+ Turbopack, focusing on its role as the default incremental bundler for local development. It details how Turbopack, written in Rust, significantly enhances development workflows through faster cold starts and Hot Module Replacement (HMR), especially beneficial for large applications. The skill clarifies the optimal scenarios for leveraging Turbopack in daily development and provides guidance on when to consider using Webpack as a fallback for legacy compatibility or specific plugin requirements. It also touches upon how to disable Turbopack in development and notes that production build behavior (`next build`) may vary. This skill enables the AI to inform developers about best practices for modern Next.js bundling strategies.

Best use case

An AI agent can use this skill to explain the advantages of Next.js Turbopack, compare it with Webpack, and advise developers on the most efficient bundling setup for their Next.js projects, particularly regarding development speed and tooling choices.

Next.js 16+ and Turbopack — incremental bundling, FS caching, dev speed, and when to use Turbopack vs webpack.

The AI agent will provide clear, concise, and accurate information regarding Next.js Turbopack, its benefits for development, and practical guidance on choosing between Turbopack and Webpack. Users will gain a better understanding of modern Next.js bundling strategies and optimal development setups.

Practical example

Example input

Can you explain Next.js Turbopack and when I should use it over Webpack?

Example output

Next.js 16+ uses Turbopack by default for local development. Turbopack is an incremental bundler written in Rust that significantly speeds up your development server startup and Hot Module Replacement (HMR), especially for large applications. You should use Turbopack for day-to-day development to leverage these speed benefits. Webpack is generally a fallback for legacy situations, like encountering a Turbopack bug or needing a Webpack-only plugin in dev. You can disable Turbopack using flags like `--webpack` or `--no-turbopack` depending on your Next.js version. For production builds (`next build`), the bundler behavior might be different, so always check the latest Next.js docs for details.

When to use this skill

  • When explaining Next.js 16+ development tooling to a user.
  • When advising on local development setup for Next.js projects, emphasizing faster cold starts and Hot Module Replacement (HMR) in large applications (defaulting to Turbopack).
  • When asked about the differences and appropriate use cases for Turbopack vs. Webpack in a Next.js context.

When not to use this skill

  • When the user specifically asks about advanced debugging steps or intricate configurations for either bundler beyond the scope of this explanatory skill.
  • If the user requires information about Next.js versions older than 16 that do not use Turbopack by default.
  • When providing definitive instructions for production build behaviors, as the skill's description of 'Production' usage is truncated.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/nextjs-turbopack/SKILL.md --create-dirs "https://raw.githubusercontent.com/affaan-m/everything-claude-code/main/.agents/skills/nextjs-turbopack/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/nextjs-turbopack/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How nextjs-turbopack Compares

Feature / Agentnextjs-turbopackStandard Approach
Platform SupportClaudeLimited / Varies
Context Awareness High Baseline
Installation ComplexityeasyN/A

Frequently Asked Questions

What does this skill do?

Next.js 16+ and Turbopack — incremental bundling, FS caching, dev speed, and when to use Turbopack vs webpack.

Which AI agents support this skill?

This skill is designed for Claude.

How difficult is it to install?

The installation complexity is rated as easy. You can find the installation instructions above.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# 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.

## 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.

Related Skills

workspace-surface-audit

144923
from affaan-m/everything-claude-code

Audit the active repo, MCP servers, plugins, connectors, env surfaces, and harness setup, then recommend the highest-value ECC-native skills, hooks, agents, and operator workflows. Use when the user wants help setting up Claude Code or understanding what capabilities are actually available in their environment.

DevelopmentClaude

safety-guard

144923
from affaan-m/everything-claude-code

Use this skill to prevent destructive operations when working on production systems or running agents autonomously.

DevelopmentClaude

repo-scan

144923
from affaan-m/everything-claude-code

Cross-stack source code asset audit — classifies every file, detects embedded third-party libraries, and delivers actionable four-level verdicts per module with interactive HTML reports.

DevelopmentClaude

project-flow-ops

144923
from affaan-m/everything-claude-code

Operate execution flow across GitHub and Linear by triaging issues and pull requests, linking active work, and keeping GitHub public-facing while Linear remains the internal execution layer. Use when the user wants backlog control, PR triage, or GitHub-to-Linear coordination.

DevelopmentClaude

manim-video

144923
from affaan-m/everything-claude-code

Build reusable Manim explainers for technical concepts, graphs, system diagrams, and product walkthroughs, then hand off to the wider ECC video stack if needed. Use when the user wants a clean animated explainer rather than a generic talking-head script.

DevelopmentClaude

laravel-plugin-discovery

144923
from affaan-m/everything-claude-code

Discover and evaluate Laravel packages via LaraPlugins.io MCP. Use when the user wants to find plugins, check package health, or assess Laravel/PHP compatibility.

DevelopmentClaude

design-system

144923
from affaan-m/everything-claude-code

Use this skill to generate or audit design systems, check visual consistency, and review PRs that touch styling.

DevelopmentClaude

click-path-audit

144923
from affaan-m/everything-claude-code

Trace every user-facing button/touchpoint through its full state change sequence to find bugs where functions individually work but cancel each other out, produce wrong final state, or leave the UI in an inconsistent state. Use when: systematic debugging found no bugs but users report broken buttons, or after any major refactor touching shared state stores.

DevelopmentClaude

ck

144923
from affaan-m/everything-claude-code

Persistent per-project memory for Claude Code. Auto-loads project context on session start, tracks sessions with git activity, and writes to native memory. Commands run deterministic Node.js scripts — behavior is consistent across model versions.

DevelopmentClaude

canary-watch

144923
from affaan-m/everything-claude-code

Use this skill to monitor a deployed URL for regressions after deploys, merges, or dependency upgrades.

DevelopmentClaude

benchmark

144923
from affaan-m/everything-claude-code

Use this skill to measure performance baselines, detect regressions before/after PRs, and compare stack alternatives.

DevelopmentClaude

swiftui-patterns

144923
from affaan-m/everything-claude-code

SwiftUI 架构模式,使用 @Observable 进行状态管理,视图组合,导航,性能优化,以及现代 iOS/macOS UI 最佳实践。

DevelopmentClaude