analyze-bundle

Convert Next.js bundle analyzer data to NDJSON and explore it

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "analyze-bundle" with this command: npx skills add andrewimm/bundle-analyzer-agentic/andrewimm-bundle-analyzer-agentic-analyze-bundle

analyze-to-ndjson

Converts Next.js bundle analyzer binary .data files into grep/jq-friendly NDJSON.

Generate the data

pnpm next experimental-analyze --output

This writes binary files to .next/diagnostics/analyze/data/.

Run the converter

node tools/analyze-to-ndjson.mjs

Options:

  • --input <dir> — source directory (default: .next/diagnostics/analyze/data)
  • --output <dir> — output directory (default: ./analyze-ndjson)

Output files

FileWhat's in it
modules.ndjsonGlobal module registry (id, ident, path)
module_edges.ndjsonModule dependency graph (from, to, kind: sync/async)
sources.ndjsonPer-route source tree with sizes and environment flags
chunk_parts.ndjsonGranular size data: one line per (source, output_file) pair
output_files.ndjsonPer-route output files with aggregated sizes
routes.ndjsonRoute-level summaries

Browsing the output

Route overview

# All routes sorted by compressed size
jq -s 'sort_by(-.total_compressed_size)' analyze-ndjson/routes.ndjson

Find large sources

# Top 10 largest sources (deduplicated by full_path)
jq -s '
  group_by(.full_path)
  | map(max_by(.compressed_size))
  | sort_by(-.compressed_size)
  | .[0:10]
  | .[] | {full_path, compressed_size, size, route}
' analyze-ndjson/sources.ndjson

Client-side JS

# Largest client JS sources
grep '"client":true' analyze-ndjson/sources.ndjson \
  | grep '"js":true' \
  | jq -s 'sort_by(-.compressed_size) | .[0:10] | .[] | {full_path, compressed_size}'

Module dependencies

# What does module 42 depend on?
grep '"from":42,' analyze-ndjson/module_edges.ndjson | jq .to

# Who depends on module 42?
grep '"to":42,' analyze-ndjson/module_edges.ndjson | jq .from

# Look up a module by path fragment
grep 'react-dom' analyze-ndjson/modules.ndjson | jq '{id, path}'

Output files for a route

# Largest output files for the "/" route
grep '"route":"/"' 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

# Top-level directories for "/"
grep '"route":"/"' analyze-ndjson/sources.ndjson \
  | jq 'select(.parent_id == null)'

Feeding to an LLM

The NDJSON files are self-contained — each line has all the context needed to understand it. You can pass a whole file or a filtered subset as context:

# Give an LLM the route summary + the top 20 client sources
cat analyze-ndjson/routes.ndjson > /tmp/context.ndjson
grep '"client":true' analyze-ndjson/sources.ndjson \
  | jq -s 'sort_by(-.compressed_size) | .[0:20] | .[]' -c \
  >> /tmp/context.ndjson

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

spaa

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

clinic-visit-prep

帮助患者整理就诊前问题、既往记录、检查清单与时间线,不提供诊断。;use for healthcare, intake, prep workflows;do not use for 给诊断结论, 替代医生意见.

Archived SourceRecently Updated
Automation

changelog-curator

从变更记录、提交摘要或发布说明中整理对外 changelog,并区分用户价值与内部改动。;use for changelog, release-notes, docs workflows;do not use for 捏造未发布功能, 替代正式合规审批.

Archived SourceRecently Updated
Automation

klaviyo

Klaviyo API integration with managed OAuth. Access profiles, lists, segments, campaigns, flows, events, metrics, templates, catalogs, and webhooks. Use this skill when users want to manage email marketing, customer data, or integrate with Klaviyo workflows. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).

Archived SourceRecently Updated