Webpack Config Refactoring Tool skill for Claude and Codex
Splits a tangled webpack config into common, development, and production parts in your chosen module format, with the original build output preserved and a…
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 working webpack config has grown into one tangled file and needs splitting into common, development, and production parts in a chosen module format without changing the build output. Do not use for generating a config from scratch, tuning bundle size, or diagnosing a failing build. Related topics: coding, webpack.
What it will ask you for
- Current config (longer free text)
- Config file location (free text, e.g. "./webpack.config.js")
- Target environment (choose one: development, production, both)
- Module format (choose one: CommonJS, ESModules, UMD)
- Plugins to keep or add (choose any: HtmlWebpackPlugin, MiniCssExtractPlugin, DefinePlugin, CleanWebpackPlugin, BundleAnalyzerPlugin)
- Source maps (choose one: enabled, disabled)
- Extra loaders (longer free text)
How it works
- Inventory what the current config builds: entries, output names, loader-to-file mapping, and every plugin with options, as the contract the refactor must keep.
- Split the config into a common part and per-environment parts, merged with webpack-merge, so development and production settings stop leaking into each other.
- Extract repeated loader chains into named helpers, group rules by file type, and lift paths, ports, and the public path into constants at the top.
- Replace deprecated plugin usage with its current equivalent and apply the chosen module format consistently, including the export.
- Return the new files in code blocks with a bullet list of the major changes and a JSON summary of the options chosen.
What you get
One fenced javascript code block per resulting config file, then a bullet list explaining each structural change, then a JSON object with keys environment, moduleFormat, plugins, sourceMaps, and extraLoaders.
What it watches out for
- Dropping a loader option or plugin flag during the split, so the build still runs but emits different output.
- Merging environment configs with Object.assign instead of webpack-merge, which overwrites the rules array instead of concatenating it.
- Mixing require and import in one file when the module format is ESModules, which fails under node ESM resolution.
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.