skills/next-bundle-analyzer/SKILL.md
Analyze and quality-check this project's Next.js 16 (Turbopack) bundle sizes using `pnpm analyze:output` (i.e. `next experimental-analyze --output`). Use when the user wants to: inspect bundle sizes, find large dependencies, detect duplicate modules, quality-check production builds, or get optimization recommendations. Triggers on requests like "analyze the bundle", "check bundle size", "find large packages", "bundle quality check", "バンドル分析", "バンドルサイズ確認", or when the user mentions `next experimental-analyze`.
npx skillsauth add airRnot1106/skills next-bundle-analyzerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Analyze Turbopack bundle output from next experimental-analyze --output for this repository.
Use the pre-defined pnpm script (see package.json):
pnpm analyze:output
This runs next experimental-analyze --output and writes results to .next/diagnostics/analyze/.
Note: Next.js 16 is a breaking-change release. If the command is missing or the output path changes, consult
node_modules/next/dist/docs/before adjusting.
uv run .claude/skills/next-bundle-analyzer/scripts/analyze_bundle.py .next/diagnostics/analyze
The script has PEP 723 inline metadata (requires-python = ">=3.11"), so uv provisions its own interpreter automatically — no venv needed.
| Section | What to look for |
| ---------------------- | ------------------------------------------------------------ |
| Total bundle size | Compressed size matters for network; raw size for parse time |
| Top output files | Files >100KB (raw) are candidates for investigation |
| Top npm packages | User-land packages unexpectedly large (not next/react) |
| Duplicate packages | Same package at multiple versions = wasted bytes |
| Recommendations | Auto-detected optimization opportunities |
The script is pnpm-aware and correctly attributes packages from node_modules/.pnpm/<name>@<version>/.
[client-fs] — shipped to the browser. Focus optimization here.[output] — server-only artifacts (SSR / RSC runtime).[pkg] — internal next/dist/compiled/*. A gzip size of 2 B is a marker that the file is not a shipped compressed chunk; usually framework overhead, not actionable.When the ">100KB candidate" rule from the table above triggers on [pkg] / [output] entries, it's almost always framework weight. Real wins come from trimming [client-fs] entries.
The script's auto-recommendations only fire on user-land packages crossing a size threshold. Empty = no obviously large user-land package. This is not a signal that nothing can be optimized — cross-reference package.json and manually flag icon / UI / utility libraries (e.g. lucide-react, @base-ui/react) that may still benefit from optimizePackageImports.
Reference: node_modules/next/dist/docs/01-app/02-guides/package-bundling.md (read this before editing config to confirm API names for Next.js 16).
Large packages with many named exports → Add to optimizePackageImports in next.config.ts:
experimental: {
optimizePackageImports: ['icon-library', 'utility-library'],
}
Candidates in this project are typically: lucide-react, @base-ui/react, or similar icon/utility-heavy packages.
Heavy client-side libraries that could run server-side → Move logic to a Server Component (e.g. markdown parsing, date formatting, syntax highlighting).
Duplicate packages → Run pnpm dedupe.
Server-only packages leaking into client → Add to serverExternalPackages in next.config.ts:
serverExternalPackages: ['package-name'],
# Save current state
cp -r .next/diagnostics/analyze ./analyze-before
# Make changes, then re-analyze
pnpm analyze:output
# Compare
uv run .claude/skills/next-bundle-analyzer/scripts/analyze_bundle.py ./analyze-before
uv run .claude/skills/next-bundle-analyzer/scripts/analyze_bundle.py .next/diagnostics/analyze
Key diff signals to compare:
pnpm dedupe.[client-fs] output file crossed 100KB → candidate for code-splitting or optimizePackageImports.For browser-based exploration (no --output flag):
pnpm analyze
# Opens http://localhost:4000
development
明名の思想に基づくフロントエンドのディレクトリ構成設計と BCD Design によるコンポーネント命名のガイドライン。 ディレクトリ構成の設計・リファクタリング、コンポーネントの命名・配置、新規フロントエンドプロジェクトのセットアップ、 ファイルやコンポーネントの配置判断時にトリガー。package by feature、ドメイン駆動のディレクトリ設計、 BCD Design、明名、後方一致に関する質問や作業で使用する。
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.