next-bundle-analyzer

Analyze Next.js 16 Turbopack bundle sizes and detect duplicate modules.

Updated Apr 11, 2026
One-click install
npx skills add https://github.com/airRnot1106/skills --skill next-bundle-analyzer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: next-bundle-analyzer
Source: https://github.com/airRnot1106/skills/tree/main/skills/next-bundle-analyzer
Command: npx skills add https://github.com/airRnot1106/skills --skill next-bundle-analyzer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Analyze and quality-check Next.js 16 (Turbopack) bundle sizes using pnpm analyze:output (i.e. next experimental-analyze --output). Use when the user wants to inspect bundle sizes, find large dependencies, detect duplicate modules, quality-check production builds, or get optimization recommendations.

Core Features & Use Cases

  • Generate analyze output using the pre-defined pnpm script (see package.json): pnpm analyze:output, which writes results to .next/diagnostics/analyze/.
  • Run the analysis script to interpret the results: uv run .claude/skills/next-bundle-analyzer/scripts/analyze_bundle.py .next/diagnostics/analyze
  • Review recommendations and identify optimization opportunities like trimming client bundles, deduping packages, and moving server-friendly logic.

Quick Start

Generate the analyze output with pnpm analyze:output, then run the analyze_bundle.py script to interpret the results.

Frequently Asked Questions about next-bundle-analyzer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze Next.js bundle sizes for Turbopack builds?

To analyze Next.js bundle sizes, run the `pnpm analyze:output` command to generate diagnostic data, then execute the `analyze_bundle.py` Python script to parse the results and identify large dependencies and duplicate modules in your Turbopack builds.

What is the best way to find large dependencies and duplicate modules in Next.js?

Finding large dependencies and duplicate modules involves running `next experimental-analyze --output` to produce diagnostics, which a Python script then parses to report bundle sizes and pinpoint specific optimization opportunities across client and server bundles.

Does the Next.js bundle analysis script require Python to run?

Yes, the bundle analysis script requires Python 3.11 or later to run. You execute the `analyze_bundle.py` script using `uv run` to interpret the diagnostic output generated by the Next.js experimental analyze command.

Can I use this bundle analysis on projects running Next.js 16?

Yes, this bundle analysis is specifically applicable to projects using Next.js 16. It focuses on detecting large dependencies, duplicate modules, and providing optimization recommendations for production-build quality checks across Turbopack client and server bundles.

How do I quality-check my Next.js production builds for optimization opportunities?

To quality-check Next.js production builds, use `pnpm analyze:output` to write results to the `.next/diagnostics/analyze/` directory, then run the analysis script to review recommendations for trimming client bundles, deduping packages, and moving server-friendly logic.