
Analyze Bundle
Turn pre-generated Next.js bundle analyzer NDJSON under .next/diagnostics/analyze into jq-friendly evidence so you can prioritize bundle slimming before release.
Install
npx skills add https://github.com/vercel-labs/dev3000 --skill analyze-bundleWhat is this skill?
- Reads pre-built NDJSON: routes, sources, output_files, module_edges, modules, chunk_parts
- jq recipes to sort routes by total_compressed_size and surface top heavy sources
- Maps analyzer binary .data workflow to grep-friendly line-oriented outputs
- Uses Bash node, head, tail, grep, jq, and Read per allowed-tools
- Prioritizes changes from diagnostic evidence rather than guessing imports
Adoption & trust: 103 installs on skills.sh; 1.5k GitHub stars; 3/3 security scanners passed (skills.sh audits).
Recommended Skills
Frontend Designanthropics/skills
Vercel React Best Practicesvercel-labs/agent-skills
Remotion Best Practicesremotion-dev/skills
Vercel Composition Patternsvercel-labs/agent-skills
Develop Userscriptsxixu-me/skills
Next Best Practicesvercel-labs/next-skills
Journey fit
Common Questions / FAQ
Is Analyze Bundle safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Analyze Bundle
# analyze-to-ndjson Converts Next.js bundle analyzer binary `.data` files into grep/jq-friendly NDJSON. ## Analyze artifacts This workflow pre-generates analyzer artifacts in: - `.next/diagnostics/analyze/ndjson/routes.ndjson` - `.next/diagnostics/analyze/ndjson/sources.ndjson` - `.next/diagnostics/analyze/ndjson/output_files.ndjson` - `.next/diagnostics/analyze/ndjson/module_edges.ndjson` - `.next/diagnostics/analyze/ndjson/modules.ndjson` Focus on reading these files and using their evidence to prioritize changes. ## Output files | File | What's in it | |---|---| | `modules.ndjson` | Global module registry (`id`, `ident`, `path`) | | `module_edges.ndjson` | Module dependency graph (`from`, `to`, `kind`: sync/async) | | `sources.ndjson` | Per-route source tree with sizes and environment flags | | `chunk_parts.ndjson` | Granular size data: one line per (source, output_file) pair | | `output_files.ndjson` | Per-route output files with aggregated sizes | | `routes.ndjson` | Route-level summaries | ## Browsing the output ### Route overview ```bash jq -s 'sort_by(-.total_compressed_size)' .next/diagnostics/analyze/ndjson/routes.ndjson ``` ### Find large sources ```bash jq -s ' group_by(.full_path) | map(max_by(.compressed_size)) | sort_by(-.compressed_size) | .[0:10] | .[] | {full_path, compressed_size, size, route} ' .next/diagnostics/analyze/ndjson/sources.ndjson ``` ### Client-side JS ```bash grep '"client":true' .next/diagnostics/analyze/ndjson/sources.ndjson \ | grep '"js":true' \ | jq -s 'sort_by(-.compressed_size) | .[0:10] | .[] | {full_path, compressed_size}' ``` ### Module dependencies ```bash grep '"from":42,' .next/diagnostics/analyze/ndjson/module_edges.ndjson | jq .to grep '"to":42,' .next/diagnostics/analyze/ndjson/module_edges.ndjson | jq .from grep 'react-dom' .next/diagnostics/analyze/ndjson/modules.ndjson | jq '{id, path}' ``` ### Output files for a route ```bash grep '"route":"/"' .next/diagnostics/analyze/ndjson/output_files.ndjson \ | jq -s 'sort_by(-.total_compressed_size) | .[0:10] | .[] | {filename, total_compressed_size, num_parts}' ``` ### Directory tree for a route ```bash grep '"route":"/"' .next/diagnostics/analyze/ndjson/sources.ndjson \ | jq 'select(.parent_id == null)' ```