Bundle budget code splitting review

From Raishin/vanguard-frontier-agentic · View interactive version

Bundle budget code splitting review is an AI agent skill from the GitHub repository Raishin/vanguard-frontier-agentic. Reviews JavaScript/CSS bundle composition against explicit numeric budgets, evaluates route- and component-level code-splitting boundaries, and requires a CI-enforced budget before endorsing any size fix as resolved.

How to use this skill

Skill file

Bundle Budget & Code-Splitting Review

Purpose

Teams routinely respond to "the bundle feels big" with an ad hoc React.lazy() here and a dynamic import() there, ship it, and call the finding closed once the build succeeds. That proves nothing: it does not show whether the total byte weight moved, whether the change reduced or inflated the request count, or whether the win survives the next dependency bump. This skill turns "bundle feels big" into a numeric, device/network-scoped budget tied to INP/TTI, ranks analyzer output by both byte weight and main-thread execution cost, classifies each contributor into a specific remediation path, and refuses to mark a size finding resolved without a CI-enforced budget check — a one-time manual fix without an enforced budget is a regression waiting to happen.

When to use

Use this skill when the user asks to:

When NOT to use

Context7 Documentation Protocol

Bundler chunking APIs are version-sensitive and have changed shape recently — do not prescribe a config from memorized training data.

  1. Call ToolSearch with query "context7" (or "select:mcp__Context7__resolve-library-id,mcp__Context7__query-docs") to load the Context7 tools if not already loaded this session.
  2. Call mcp__Context7__resolve-library-id for the bundler in scope (Vite, webpack, Rollup, esbuild, Rolldown) before prescribing any chunking configuration.
  3. Call mcp__Context7__query-docs for the specific mechanism — e.g. "manualChunks vs codeSplitting", "splitChunks cacheGroups", "dynamic import chunk naming" — before ruling on it. Do this per review; do not reuse a prior session's memory of bundler internals.
  4. Known version-sensitive trap verified via Context7 as of this skill's updated date: Vite 8 (Rolldown-powered) removes the object form of build.rollupOptions.output.manualChunks entirely and deprecates the function form; the documented replacement is build.rolldownOptions.output.codeSplitting with a groups array ({ name, test } entries). Do not hand a Vite 8+ project a manualChunks: { vendor: [...] } object-form snippet — it will not apply. For Vite <8, function-form manualChunks(id) { ... } is still valid but is itself deprecated and should be flagged as a forward-migration item, not endorsed as the long-term pattern.
  5. webpack's chunking surface (optimization.splitChunks.cacheGroups, dynamic import() with webpackChunkName magic comments) is comparatively stable across recent majors per Context7-grounded docs, but still confirm the installed webpack major before prescribing a specific cacheGroups shape, since defaults (chunks: 'async' vs 'all') affect which imports are eligible for splitting.
  6. If Context7 is unavailable or returns no relevant match for the installed bundler, fall back to official_docs and mark the claim documentation-based (Context7 unavailable) rather than presenting it as freshly verified.
  7. Never invent a bundler config key, CLI flag, or plugin option that no queried source confirms.

Lean operating rules

References

Load these only when needed:

Response minimum

Return, at minimum:

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.