Webpack Config Optimizer skill for Claude and Codex
Production webpack settings that bring bundles under a size budget: code splitting, vendor chunks, tree shaking, caching, and minification chosen for your…
Install it once and Claude or Codex runs it for you. When your request matches, your AI loads the skill, asks for anything it is missing, and works through the template itself. Prefer to fill it in by hand? See the full prompt template.
Download the skill (.zip) · View SKILL.md
When it is used
Use when a webpack production build ships bundles over a size budget or builds too slowly and needs code splitting, vendor chunks, tree shaking, caching, and minification configured for its project type. Do not use for explaining an existing config, fixing a build error, or reorganising files without changing output. Related topics: coding, frontend, webpack.
What it will ask you for
- Project type (choose one: React SPA, Vue.js, Vanilla JS, TypeScript, Library/Package)
- Entry point (free text, e.g. "./src/index.js")
- Output path (free text, e.g. "./dist")
- Webpack version (choose one: Webpack 4, Webpack 5)
- Current config (longer free text)
- Features (choose any: Code splitting, Lazy loading, Tree shaking, CSS/SCSS modules, Asset optimisation, Source maps, Hot Module Replacement (HMR), Bundle analyser, Environment variables, PWA/Service Worker)
- Enable build caching (choose one: Yes, No)
- Bundle size warning threshold (free text, e.g. "250kb")
- Separate vendor chunks (choose one: Yes, No)
- Minification (choose one: Terser, ESBuild, Default, None)
How it works
- Set performance budgets from the size threshold so the build itself fails or warns on regressions.
- Configure splitChunks with a vendor cache group when requested and async chunks for every dynamic import, so lazy routes ship as separate files.
- Make tree shaking effective by confirming production mode, sideEffects flags, and ES module output from the transpiler.
- Wire up the chosen minifier, build caching for the webpack version, and content-hashed filenames for long-term caching.
- Add each selected feature as an exact config snippet with one line on its effect, then assemble the full config and a change table with expected gains and trade-offs.
What you get
The complete optimised webpack config in a javascript code block, followed by a table with one row per change: setting, expected effect on bundle size or build time, and trade-off.
What it watches out for
- Declaring tree shaking done while Babel still emits CommonJS, so no dead code is actually removed.
- Splitting vendors into one giant chunk that changes on every dependency bump, which defeats long-term caching.
- Bundling peer dependencies into a library build, so consumers end up with two copies of React.
- Turning on eval source maps in production for faster builds, which ships readable source to users.
How to install
Claude.ai and the Claude desktop app
- Download the skill .zip.
- Open Settings, then Capabilities, and find Skills.
- Choose Upload skill and select the .zip.
- Ask Claude for help with the task. It loads the skill when your request matches.
Claude Code
- Download the skill .zip.
- Unzip it into ~/.claude/skills/ (or .claude/skills/ inside a project).
- Start a new session. Claude Code loads the skill when your request matches.
Codex
- Download the skill .zip.
- Unzip it into ~/.agents/skills/ (or .agents/skills/ inside a project).
- Codex picks it up on its own. Type $ and the skill name to use it, or just ask for the task.
Cursor
- Download the Cursor rule (.mdc).
- Save it in .cursor/rules/ inside your project.
- Cursor's agent applies the rule when your request matches its description.
AGENTS.md (Codex, Cursor, and other coding agents)
- Copy the AGENTS.md section.
- Paste it into AGENTS.md at the root of your repository, creating the file if needed.
- Coding agents that read AGENTS.md follow it when your request fits.