BundlePhobia scans your JavaScript and TypeScript projects for oversized dependencies, duplicate packages, tree-shaking failures, barrel file anti-patterns, and bundle configuration issues. It uses 90+ detection patterns covering 5 categories of bundle bloat. 100% local, zero telemetry.
bundlephobia scan [file|dir]
One-shot bundle bloat scan of your project (5 file limit on free tier).
How to execute:
bash "<SKILL_DIR>/scripts/bundlephobia.sh" scan [file|dir]
What it does:
Example usage scenarios:
bundlephobia scan .
bundlephobia scan .
bundlephobia scan src/
bundlephobia scan package.json
bundlephobia status
Show license info and current configuration.
bash "<SKILL_DIR>/scripts/bundlephobia.sh" status
bundlephobia patterns
List all 90+ detection patterns.
bash "<SKILL_DIR>/scripts/bundlephobia.sh" patterns
bundlephobia hooks install
Install git hooks that scan for bundle bloat on every commit.
bash "<SKILL_DIR>/scripts/bundlephobia.sh" hooks install
What it does:
bundlephobia hooks uninstall
Remove BundlePhobia git hooks.
bash "<SKILL_DIR>/scripts/bundlephobia.sh" hooks uninstall
bundlephobia report [dir]
Generate a detailed markdown bundle health report.
bash "<SKILL_DIR>/scripts/bundlephobia.sh" report [dir]
bundlephobia audit [dir]
Deep dependency audit — analyzes every dependency for size, alternatives, and optimization opportunities.
bash "<SKILL_DIR>/scripts/bundlephobia.sh" audit [dir]
bundlephobia budget [dir]
Enforce size budgets — fails if bundle exceeds configured thresholds.
bash "<SKILL_DIR>/scripts/bundlephobia.sh" budget [dir]
bundlephobia sarif [dir]
Generate SARIF JSON output for CI/CD integration (GitHub Code Scanning, etc.).
bash "<SKILL_DIR>/scripts/bundlephobia.sh" sarif [dir]
bundlephobia ci [dir]
CI mode — non-interactive scan with machine-readable output and exit codes.
bash "<SKILL_DIR>/scripts/bundlephobia.sh" ci [dir]
| Category | Patterns | What It Detects |
|----------|----------|-----------------|
| Oversized Dependencies | 20 | moment.js, lodash full import, faker in prod, aws-sdk v2, etc. |
| Duplicate & Redundant | 18 | axios + node-fetch, moment + dayjs, jest + mocha, etc. |
| Tree-Shaking Failures | 20 | import *, require(), barrel re-exports, namespace imports, etc. |
| Bundle Configuration | 18 | Missing splitChunks, no code splitting, missing externals, etc. |
| Dependency Hygiene | 14+ | Pinned versions, deprecated packages, devDeps in deps, etc. |
Add to ~/.openclaw/openclaw.json:
{
"skills": {
"entries": {
"bundlephobia": {
"enabled": true,
"apiKey": "YOUR_LICENSE_KEY",
"config": {
"maxBundleSize": "500KB",
"ignoredPackages": [],
"severityThreshold": "high",
"checkTreeShaking": true,
"checkDuplicates": true
}
}
}
}
}
The user might say things like:
共 1 个版本