# Intlayer bundle optimization

> Intlayer bundle optimization is an open-source agent skill for developer tools. Shrinks Intlayer translation dictionaries in production builds by purging and minifying. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/aymericzip/intlayer/tree/main/.agents/skills/intlayer-bundle-optimization
- **Repository:** https://github.com/aymericzip/intlayer
- **GitHub stars:** 869
- **License:** Apache-2.0
- **Skill name:** intlayer-bundle-optimization
- **Collection:** https://github.com/aymericzip/intlayer
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill guides an agent through reducing the size of Intlayer i18n dictionaries that end up in production bundles. It walks through the build options for purging unused fields, minifying keys, and choosing import modes such as dynamic loading, and explains how each one interacts with the optimize flag and the editor.

The core of the guidance is writing code that static analysis can follow. The skill shows how reading fields by name or destructuring keeps optimization working, how to replace dynamic key lookups with select, enu, cond or gender helpers, and how to avoid passing or spreading the whole content object. It also explains the common build warnings about dictionaries that cannot be purged or minified, and when keeping a dictionary whole is acceptable, such as for framework loaders that need the content as a value.

It expects an Intlayer project with an intlayer.config file and a bundler where the agent can run the build. Examples are in TypeScript and JSX. The skill points to a bundler analyzer such as rollup-plugin-visualizer or webpack-bundle-analyzer to confirm which dictionaries are heavy.

## When your agent uses it

> Keeps Intlayer dictionaries small in production bundles (purge, minify, import modes). Use when the user asks to "reduce bundle size", "optimize dictionaries", fix "cannot be purged or minified" / "Opaque field" build warnings, or configure `build.optimize`, `build.purge`, `build.minify` or `importMode`.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/aymericzip/intlayer/tree/HEAD/.agents/skills/intlayer-bundle-optimization)
- [License: Apache-2.0](https://github.com/aymericzip/intlayer/tree/HEAD/.agents/skills/intlayer-bundle-optimization)

## Features

- **Purge unused fields:** Configures removal of dictionary fields that the source code never reads.
- **Minify dictionary keys:** Renames field keys to short aliases to reduce the size of shipped content.
- **Import mode selection:** Covers static, dynamic and fetch loading so only the needed locale is shipped.
- **Analyzer-friendly code patterns:** Shows how to read fields by name and avoid dynamic keys that block optimization.
- **Build warning fixes:** Explains the cannot be purged and opaque field warnings and how to resolve them.
- **Bundle size inspection:** Points to bundler analyzers for finding heavy dictionaries.

## Good for

- Reduce the bundle size of my Intlayer translations
- Fix the Opaque field warning in my production build
- Switch my dictionaries to dynamic import mode
- Refactor a component so its dictionary can be purged
- Configure build.purge and build.minify in intlayer.config

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/intlayer-bundle-optimization` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/aymericzip/intlayer.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/intlayer-bundle-optimization &&
cp -R "$tmp/.agents/skills/intlayer-bundle-optimization" ~/.claude/skills/intlayer-bundle-optimization &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/intlayer-bundle-optimization` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/intlayer-bundle-optimization` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/aymericzip/intlayer.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/intlayer-bundle-optimization &&
cp -R "$tmp/.agents/skills/intlayer-bundle-optimization" ~/.agents/skills/intlayer-bundle-optimization &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/intlayer-bundle-optimization` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/intlayer-bundle-optimization` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/aymericzip/intlayer.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/intlayer-bundle-optimization &&
cp -R "$tmp/.agents/skills/intlayer-bundle-optimization" ~/.cursor/skills/intlayer-bundle-optimization &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/intlayer-bundle-optimization` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/aymericzip/intlayer.git --path .agents/skills/intlayer-bundle-optimization
```

Or copy the folder to `~/.gemini/skills/intlayer-bundle-optimization` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/intlayer-bundle-optimization`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/aymericzip/intlayer.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/intlayer-bundle-optimization &&
cp -R "$tmp/.agents/skills/intlayer-bundle-optimization" ~/.copilot/skills/intlayer-bundle-optimization &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/intlayer-bundle-optimization` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/aymericzip/intlayer.git
```

Then copy `intlayer/.agents/skills/intlayer-bundle-optimization` into your agent's skills folder as `intlayer-bundle-optimization`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Intlayer bundle optimization trigger?

It applies when the user asks to reduce bundle size or optimize dictionaries, mentions the cannot be purged or Opaque field warnings, or asks to configure build.optimize, build.purge, build.minify or importMode.

### Does purge or minify work when optimize is false?

No. Purge and minify do nothing when optimize is set to false.

### Does minify apply to every dictionary?

No. Key renaming is skipped while editor.enabled is true and for dictionaries using importMode fetch.

### What code patterns prevent optimization?

Spreading the content object, iterating over it, passing it to helpers, passing it as a prop, and reading fields with dynamic keys all keep fields or whole dictionaries unoptimized.

### What does the skill need to run?

It needs no scripts. It works with an Intlayer project and a bundler that can run builds and optionally an analyzer plugin.

### How do I install Intlayer bundle optimization in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/intlayer-bundle-optimization to use it in all your projects, or to .claude/skills/intlayer-bundle-optimization in one project.

### Does Intlayer bundle optimization run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Intlayer bundle optimization?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Intlayer bundle optimization?

The closest alternatives to Intlayer bundle optimization are Intlayer vanilla, Intlayer usage, Intlayer svelte, Intlayer CLI and Intlayer compiler.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Intlayer vanilla](https://ai-powered.com/skills/intlayer-vanilla): Intlayer vanilla is an open-source agent skill for developer tools.
- [Intlayer usage](https://ai-powered.com/skills/intlayer-usage): Intlayer usage is an open-source agent skill for developer tools.
- [Intlayer svelte](https://ai-powered.com/skills/intlayer-svelte): Intlayer svelte is an open-source agent skill for developer tools.
- [Intlayer CLI](https://ai-powered.com/skills/intlayer-cli): Intlayer CLI is an open-source agent skill for developer tools.
- [Intlayer compiler](https://ai-powered.com/skills/intlayer-compiler): Intlayer compiler is an open-source agent skill for developer tools.
- [Intlayer dev tools](https://ai-powered.com/skills/intlayer-dev-tools): Intlayer dev tools is an open-source agent skill for developer tools.
- [Intlayer react](https://ai-powered.com/skills/intlayer-react): Intlayer react is an open-source agent skill for developer tools.
- [Intlayer vue](https://ai-powered.com/skills/intlayer-vue): Intlayer vue is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/intlayer-bundle-optimization
