Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/kensaurus-audit-bundle-size
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: frontend, security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/audit-bundle-size
What's inside
- Skill name
audit-bundle-size- Description
- Analyse and shrink a web app's JavaScript bundle. Use when "reduce bundle size", "code splitting", "slow initial load", or "why is the bundle so big". Runtime → audit-performance.
- License
- MIT
- Instructions
- 296 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# audit-bundle-size — Find and Eliminate Bundle Bloat
**Degree of freedom: MIXED** — Offender triage and swap choice `[HIGH freedom]`;
Phase 1 production build + analyser `[LOW freedom — run exactly]`.
> **Audit-and-fix exception.** Measure the payload, then shrink it. Runtime
> slowness → `audit-performance`.
>
> Fix only what the measurement named, in the files it named; a repo-wide
> dependency sweep the report did not list is a different session. Edit
> surgically — the offending import, `dynamic()` boundary, or chunk config —
> rather than rewriting whole files. Pre-existing bugs met on the way go in
> the report as follow-ups. Add or change tests only where the repo already
> keeps them for that surface; scratch checks and generated analyser reports
> (`client.html`, `bundle-report.html`) stay out of the commit. An
> `ANALYZE=true`-guarded analyser config stays only if the repo already keeps one.
**Every kilobyte of JavaScript the browser must download, parse, and compile
before showing anything costs real users real time.** A large initial bundle is
the #1 avoidable cause of slow LCP and poor Core Web Vitals. Find exactly what
is bloating it and fix each item.
## This skill vs neighbors
| Skill | Owns |
|---|---|
| **audit-bundle-size** (this) | Analyse and shrink the JavaScript bundle: code splitting, initial load |
| `audit-performance` | Audit and fix runtime performance: Core Web Vitals, load priority |
| `workflow-quality-gate` | Pre-release gate across red-team, security, bundle, performance, unit tests |
| `workflow-launch-ready` | Launch-preparation sweep for a new app or major release |
## How to reason — Observe → Interpret → Classify → Severity
1. **Observe** — quote First Load JS / chunk gzip and the treemap contributor (`file` + package)
2. **Interpret** — is this unused code on the critical path, a duplicate, or a missing split?
3. **Classify** — giant-vendor / full-library import / missing-lazy / unused-dep / dev-in-prod / duplicate
4. **Severity** — by gzip on the initial route: >250 KB First Load JS = review; do not delete a feature to save KB
## Worked example
> **Observe:** Next.js First Load JS 420 KB gzip. Treemap: default `lodash`
> import in `lib/utils.ts`; `moment` with all locales in the shared layout.
> **Interpret:** two libraries pull unused code onto every route.
> **Classify:** full-library import + oversized date lib.
> **Severity:** High — over the 250 KB review threshold.
> **Finding:** named `lodash/debounce` + replace `moment` with `dayjs`; remesure
> First Load JS before claiming a save.
---
## Phase 0: Detect bundler and existing setup [HIGH freedom]
```
package.json scripts.build → build command and framework
vite.config.* → Vite + rollupOptions
next.config.* → Next.js (webpack / Turbopack)
webpack.config.* → standalone Webpack
astro.config.* → Astro (islands, Vite underneath)
```
Identify:
- **Bundler**: Vite / Webpack / Rollup / esbuild / Turbopack / Next.js built-in
- **Analyser available**: `rollup-plugin-visualizer`, `webpack-bundle-analyzer`,
`@next/bundle-analyzer`, `source-map-explorer`
- **Framework**: Next.js (App / Pages), SvelteKit, Astro, Remix, Nuxt, Vite SPA
---
## Phase 1: Run a production build with analysis [LOW freedom — run exactly]
### Vite / Rollup
If `rollup-plugin-visualizer` is not installed:
```bash
npm install --save-dev rollup-plugin-visualizer
```
Add temporarily to `vite.config.ts`:
```typescript
import { visualizer } from 'rollup-plugin-visualizer';
// in plugins array:
visualizer({ open: false, filename: 'dist/bundle-report.html', gzipSize: true })
```
Then build:
```bash
npm run build 2>&1 | tail -40
```
Read `dist/bundle-report.html` for the treemap, or parse `dist/stats.json` if
the plugin is configured to output JSON.
### Next.js
```bash
ANALYZE=true npm run build 2>&1 | tail -60
```
This requires `@next/bundle-analyzer` in `next.config.*`:
```javascript
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
module.exports = withBundleAnalyzer({ /* your config */ });
```
Read the generated `client.html` report. Key number: **First Load JS** per route.
Next.js prints this in the build output — capture it for before/after comparison.
### If no analyser is installed
Use `source-map-explorer` on the build output:
```bash
npx source-map-explorer 'dist/**/*.js' --html dist/bundle-report.html
```
Or for a quick size summary:
```bash
find dist -name '*.js' | xargs ls -lh | sort -k5 -hr | head -20From kensaurus/skills, MIT.
More from kensaurus/skills
- 0.633score
create-skill
kensaurus
Guide users through creating effective Agent Skills for Cursor.
SkillAFreshness: A★ 9Claude Code +9 - 0.633score
audit-agent-speed
kensaurus
Measure and fix a slow coding-agent setup: status line, hooks, instruction bloat, effort, worktree pile-up, antivirus and indexer scans.
SkillAFreshness: A★ 9Claude Code +9 - 0.629score
audit-backend-architecture
kensaurus
Read-only backend-architecture audit and pattern advisor, gated by stack.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
audit-analytics
kensaurus
Read-only audit of product-analytics events (PostHog, Amplitude, Mixpanel, GA4): taxonomy, funnels, consent-gated firing, dead or duplicate events.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
create-rule
kensaurus
Create Cursor rules for persistent AI guidance.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
split-to-prs
kensaurus
Split current work into small reviewable PRs.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
update-cursor-settings
kensaurus
Modify Cursor/VSCode user settings in settings.json.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
audit-accessibility
kensaurus
WCAG 2.2 AA audit via playwright-cli: axe-core, keyboard, contrast, target size, focus, ARIA.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
audit-auth-flows
kensaurus
Read-only audit of app-layer auth: route×gate matrix, session lifecycle, OAuth, provider traps (getSession vs getUser, middleware-only gates, CVE-2025-29927).
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
audit-cicd
kensaurus
Audit GitHub Actions CI/CD for cost, speed, and safety.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
audit-code-quality
kensaurus
Detect and fix repo-wide anti-patterns and consistency drift (naming, organisation, repeated smells).
SkillAFreshness: A★ 9Claude Code +9 - 0.625score
create-hook
kensaurus
Create Cursor hooks.
SkillAFreshness: A★ 9Claude Code +9
Signals
- Stars
- 9
- Forks
- 1
- Open issues
- 0
- Last commit (this folder)
- Oct 19, 2026 (10 days ago)
- Last release
- Oct 19, 2026 (10 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/kensaurus/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from kensaurus
- 0.633score
audit-agent-speed
kensaurus
Measure and fix a slow coding-agent setup: status line, hooks, instruction bloat, effort, worktree pile-up, antivirus and indexer scans.
SkillAFreshness: A★ 9Claude Code +9 - 0.633score
create-skill
kensaurus
Guide users through creating effective Agent Skills for Cursor.
SkillAFreshness: A★ 9Claude Code +9 - 0.629score
audit-backend-architecture
kensaurus
Read-only backend-architecture audit and pattern advisor, gated by stack.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
create-rule
kensaurus
Create Cursor rules for persistent AI guidance.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
split-to-prs
kensaurus
Split current work into small reviewable PRs.
SkillAFreshness: A★ 9Claude Code +9 - 0.628score
audit-analytics
kensaurus
Read-only audit of product-analytics events (PostHog, Amplitude, Mixpanel, GA4): taxonomy, funnels, consent-gated firing, dead or duplicate events.
SkillAFreshness: A★ 9Claude Code +9
Cite this page
audit-bundle-size skill. Agent Mart. https://agentmart.dev/skills/kensaurus-audit-bundle-size (last updated 2026-10-24)