uniswap/ai-toolkit/analyze-bundle
Claude Code and agent skill by uniswap/ai-toolkit
- community
Checking that the SKILL.md file is still in the repository.
Analyze web application bundle size to find what's making it large and how to shrink it. Always use this skill whenever the user says "analyze the bundle", "what's making my bundle large", "bundle size analysis", "check my webpack output", "why is my app so big", "find heavy dependencies", "optimize the bundle", "check my Vite build size", "bundle is too large", "reduce my JS bundle", "find large modules", "tree-shaking opportunities", "what dependencies are bloating the bundle", "bundle report…
Install
npx vskill@latest install uniswap/ai-toolkit/analyze-bundleSKILL.md
Bundle Analyzer
Identify what's inflating your web application's bundle, trace it to specific dependencies and import patterns, and produce a prioritized list of optimizations with estimated size savings.
When to Activate
- User wants to understand what's making their bundle large
- Initial page load is slow and JavaScript bundle size may be a factor
- Before or after a dependency update to measure size impact
- CI is flagging a bundle size regression
- Preparing to ship a performance improvement and need a baseline
- Code-splitting, lazy loading, or tree-shaking improvements are being planned
Step 1: Detect Bundler and Stack
Scan for config files to identify the bundler and framework:
| Signal file | Bundler | Analysis approach | |
|---|---|---|---|
vite.config.ts / vite.config.js | Vite | Build with --report or vite-bundle-visualizer | |
webpack.config.* | Webpack | webpack-bundle-analyzer via stats JSON | |
next.config.* | Next.js (Webpack) | @next/bundle-analyzer or source-map-explorer on .next/static/chunks/ | |
rollup.config.* | Rollup | Build with rollup-plugin-visualizer | |
esbuild.config.* or esbuild in scripts | esbuild | --metafile flag → analyze with esbuild-bundle-analyzer | |
parcel.config.* / .parcelrc | Parcel | parcel build --detailed-report | |
turbo.json | Turbopack/Turborepo | Check individual apps in the monorepo for their bundler |
Also check package.json scripts for build commands to understand the build pipeline:
If the project uses a monorepo (nx.json, turbo.json, pnpm workspaces), identify which packages have browser bundles before proceeding.
Step 2: Check for Existing Build Artifacts
Before re-building, check whether a recent build already exists:
If fresh artifacts are present (modified within the last day), skip rebuilding and use the existing output. Note this in your report.
If no build artifacts exist, run the build in Step 3.
Step 3: Generate Bundle Report
Run the appropriate analysis tool based on the bundler detected in Step 1.
Vite
Check for vite-bundle-visualizer or use the built-in rollup options:
After building, read the manifest if present:
Webpack
Then use webpack-bundle-analyzer in stats mode:
Next.js
source-map-explorer (Universal Fallback)
When bundler-specific tools aren't available, source-map-explorer works on any build output that includes source maps:
Parse the JSON output to extract module sizes.
Raw File Sizes (Minimal Fallback)
If no analysis tool is available and source maps are absent:
Note: raw fallback provides size totals only — no per-module breakdown. Recommend the user install vite-bundle-visualizer or enable source maps for a full analysis.
Step 4: Identify Heaviest Modules and Dependencies
From the report data, extract:
Top Modules by Size
List the 15 largest modules (by parsed/compressed size). For each entry note:
- Module path or package name
- Size (raw bytes and gzip estimate if available)
- Whether it's a production dependency, dev dependency, or application code
- Whether a lighter alternative exists
Duplicate Packages
Check if the same package appears at multiple versions (common with monorepos and conflicting peer dependencies):
Duplicates that appear in multiple versions often land in the bundle multiple times. Flag any duplicate that is both large (>50 KB raw) and frequently used (React, lodash, date-fns, etc.).
Tree-Shaking Issues
Scan for import patterns that defeat tree-shaking. The head -N on each grep below truncates the listing for readability — it is not a finding filter. Re-run each with | wc -l and report the true count, so 40 namespace imports are never written up as 20. (The head -N on the ls -lhS / du | sort -rh commands above is different: those are size-sorted, so truncating genuinely keeps the largest.)
Step 5: Check for Code-Splitting Opportunities
Identify code that could be lazily loaded to reduce the initial bundle:
Flag routes and large feature components that are imported synchronously but only needed for specific user flows. These are prime candidates for React.lazy() or Next.js dynamic().
Step 6: Report
Output a structured report in three sections.
Bundle Size Summary
Top 10 Heaviest Modules
List each module with size, category (dep / app code), and a one-line note:
Actionable Recommendations
Sort by estimated size saving (largest first). Report every heavy module you found, not only the ones you have a fix for — a 90 KB dependency with no obvious replacement is still the most useful thing in the report, and dropping it at write-up time hides the biggest number on the page. Put those under a Known cost, no fix identified heading with the size and why the usual remedies do not apply, so the reader can make their own call.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/plugins/development-codebase-tools/skills/analyze-bundle/SKILL.md
Popularity
- Repository stars
- 42
- Repository forks
- 12
- 7-day trend score
- 19
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/uniswap/ai-toolkit/analyze-bundle)