optimize-web — Claude Code skill for faster Unity Web builds
A skill that walks an AI agent through auditing a Unity WebGL or WebGPU build and cutting its download size, load time and browser stutter.
npx skills add Unity-Technologies/skills --skill optimize-web -a claude-codeWhat optimize-web does
The skill drives the agent through Player Settings, compression, stripping and server setup for a Unity Web build. Before touching anything, the agent records a baseline of current behaviour and makes a restore point, so a later result can be traced to a specific change. Everything runs through the unity cli (unity command --format json) plus the unity-cli and unity-pipeline skills.
A topic map points to Unity docs on release-grade Player Settings, a C# editor script that applies them in one pass, removing unused packages, shader variant stripping, server compression headers and MIME types, and Wasm heap memory. The API side covers UnityEditor.PlayerSettings, UnityEditor.PlayerSettings.WebGL and UnityEditor.WebGL.UserBuildSettings, checked against the project's Unity version. That version comes from ProjectSettings/ProjectVersion.txt, package versions from Packages/packages-lock.json.
Docs are read from the editor's local Data/Documentation folder when it exists, otherwise from https://docs.unity.com/en-us/engine/<VERSION>/manual/. For com.unity.cloud.ktx, com.unity.addressables and com.unity.web.stripping-tool only .md files inside Library/PackageCache are allowed — other Library folders are off limits because the search gets slow. The agent also has to name the files it read and leave unrelated assets alone.
What it helps with
- shrink a WebGL build before shipping it
- make a web build load faster in the browser
- fix stutter and frame drops on WebGPU
- cut memory use and battery drain on phones
- set up compression and MIME types on the server
Example prompts for the agent
- Audit the Player Settings for our Web build and tell me what to change to make it smaller
- The build takes forever to load in the browser — find out why and fix it
- The scene stutters on mobile, check memory and stripping
How to install optimize-web
1Skills CLI (Vercel)
npx skills add Unity-Technologies/skills --skill optimize-web -a claude-code2Manually: put the files in place
~/.claude/skills/optimize-web/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/optimize-web/
1Skills CLI (Vercel)
npx skills add Unity-Technologies/skills --skill optimize-web -a codex2Manually: put the files in place
.agents/skills/optimize-web/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Unity-Technologies/skills --skill optimize-web -a cursor2Manually: put the files in place
.cursor/skills/optimize-web/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Unity-Technologies/skills optimize-web2Manually: put the files in place
.github/skills/optimize-web/SKILL.md1Skills CLI (Vercel)
npx skills add Unity-Technologies/skills --skill optimize-web -a gemini-cli2Platform CLI
gemini skills install https://github.com/Unity-Technologies/skills --path skills/optimize-webManually: put the files in place
.devin/skills/optimize-web/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Unity-Technologies/skills --skill optimize-web -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about optimize-web
How do I install optimize-web in Claude Code?
Run npx skills add Unity-Technologies/skills --skill optimize-web -a claude-code. The skill file lands at ~/.claude/skills/optimize-web/SKILL.md.
What does optimize-web do?
It audits a Unity WebGL or WebGPU build and applies Player Settings, compression, stripping and server changes. The point is a smaller download and steadier browser performance.
What does the skill need to run?
Access to the unity cli, plus the unity-cli and unity-pipeline skills. Unity and package versions are read from ProjectSettings/ProjectVersion.txt and Packages/packages-lock.json.