Bundle analyze

From berkcangumusisik/claude-code-practices · View interactive version

Bundle analyze is an AI agent skill from the GitHub repository berkcangumusisik/claude-code-practices. Analyzes frontend bundle size and suggests optimizations

How to use this skill

Skill file

Bundle Analysis

  1. Check build tool:
cat package.json | grep -E '"build"|vite|webpack|rollup|esbuild|next'
  1. Generate bundle stats:
# Next.js
npx next build --analyze 2>/dev/null

# Vite
npx vite-bundle-visualizer 2>/dev/null

# Generic build size
bun run build 2>&1 | grep -E "\.js|\.css|kB|MB"
  1. Identify heavy dependencies:
cat package.json | grep -E '"dependencies"' -A 50
# Check bundle phobia for top suspects
  1. Find optimization opportunities:
  1. Report:
Total bundle: X KB (gzipped: Y KB)

Top 5 contributors:
  react-dom         45 KB
  chart-library    120 KB  ← consider lighter alternative
  ...

Potential savings: ~Z KB with recommended changes
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.