/unity-dev:unity-web-releasefrom unity-dev
Optimizes Unity WebGL/WebGPU builds for production: Brotli compression, server headers, Safari stutter, iPhone memory crashes, and release settings.
Ships in unity-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Half of compression lives outside Unity, and it undoes everything inside. The format is chosen in the Player Settings and delivered by the web server: without the right
Content-Encodingheader the browser downloads a.brfile it cannot read, and either the build fails to start or Unity's fallback decompressor runs — costing ~150 KB of JavaScript and a slower start, to undo work you already did. Check the headers before touching a single Unity setting.
| Symptom | Go to |
|---|---|
| "The web build is huge" | reference/release-settings.md §2, then §3 |
| "It takes forever to load", size looks fine; "Brotli isn't working"; configure the server for a Unity web build | §1 — compression is not being delivered |
| "It stutters in Safari but not Chrome" | §5 |
| "It crashes on iPhone", or reloads | §4 |
| Memory climbs until it dies | §4 |
| "Which one of these actually helped?" | §6 |
| Setting up web player settings for release | reference/release-settings.md §2 |
| Settings were applied, the build ignores them | reference/release-settings.md §0 — the save, not the assignment |
| CI builds bigger than the local build | reference/release-settings.md §0 — codeOptimization never left the machine |
-executeMethod aborts on compile errors after web work | reference/release-settings.md §0 — wasmStreaming is obsolete-as-error |
| Which browser tool to open | reference/settings-and-verification.md |
reference/release-settings.md §0Applying settings by script: a value assigned and never saved is ignored — save, then quote the
stored values; codeOptimization lives under ignored Library/, so it never reaches CI; and
wasmStreaming is obsolete-as-error under -executeMethod.
| Compression | When | Note |
|---|---|---|
| Brotli | HTTPS or localhost | Best ratio. Browsers only accept it in a secure context |
| Gzip | Plain HTTP, legacy CDNs | Universal |
| None | Local dev only | Never ship it |
The server must:
.br as Content-Encoding: br, .gz as Content-Encoding: gzip;Content-Type: application/wasm for .wasm;Decompression Fallback = Off once that is true. Turn it on only when the host genuinely cannot set headers — it is a cost, not a safety net.
Verify with the network, not with the setting:
curl -sI https://host/Build/app.wasm.br | grep -i 'content-encoding\|content-type'
reference/release-settings.md §2The release value for each player setting — compression, stripping, code optimisation, exceptions, memory, frame pacing — and which six are already the factory value.
Project Settings > Graphics): Lightmap Modes and Fog Modes to
Automatic, Instancing Variants to Strip Unused, Batch Renderer Group Variants to Strip All if
you do not use BRG, and audit Always Included Shaders — every entry there ships all of its
variants whether or not anything references it. Test afterwards for a shader you actually
needed.Packages/manifest.json against what the game really uses. The
Input System is a notable contributor when it is present and unused.com.unity.web.stripping-tool) analyses the built Wasm and
identifies whole engine submodules the game never touches — 3D graphics in a 2D game, for
instance. It reaches further than Managed Stripping Level can, because it works on the binary
rather than on managed code..data file into Addressables or AssetBundles, so the first load
fetches only what the first screen needs. Textures loaded that way should be KTX2/Basis —
the target GPU is unknown at build time on the web, so one file that transcodes at load is the
only way to ship a native format to every device. Mechanism and the encode-vs-baked rule:
unity-3d-models (SKILL, the KTX2/Basis paragraph); toktx and the runtime load calls:
reference/settings-and-verification.md.Budget first: under 30 MB to first playable, bundles under 51 MB, canvas resolution clamped in
the template →
reference/settings-and-verification.md.
Web memory is not a soft limit; exceeding it kills the tab.
Two platform facts that surprise people:
unity-audio).Application.targetFrameRate = 60. On
Safari that fights the browser's own pacing; -1 is correct. Second, Safari's WebGL and Wasm
runtimes differ from Chromium's and some GLSL constructs behave differently — that one needs a
device.about:config key and safe bundle size are below.The short version: Chrome DevTools Performance for hitching, Memory for a climbing heap,
Network for slow first load; Safari Web Inspector for Safari-only rendering; Unity's own
profiler over WebSocket for a development build. Symptom by symptom, and readable C# names in a
Wasm flamegraph:
reference/settings-and-verification.md.
Lower quality levels are the cheapest remaining win (Very Low or Low as the web default, or a
web-specific level with real-time shadows, post-processing and high particle counts disabled),
and OnDemandRendering.renderFrameInterval on idle screens saves a laptop's battery.
But none of it counts without a pair of numbers:
ls -l Build/*.wasm* Build/*.data* # transferred size, per file
curl -sI https://host/Build/app.wasm.br | head # is compression actually delivered?
Record size and cold-load time before and after, on the same connection. At most three adjust-and-verify rounds — past that the remaining wins are architectural (what loads first) rather than settings.
Firefox's about:memory breaks a tab into Wasm code, heap, .data and web audio — read the heap
against §4's ceilings. That, and why python3 -m http.server can never show a Brotli win:
reference/settings-and-verification.md.
Report after each round, then wait before the next. Say the size delta per file, which settings changed with their before and after values, and what the server headers actually returned — not "optimised the web build".
| Not here | Go to |
|---|---|
| Android artifacts, signing, stripping fallout | unity-android-release |
The unity CLI, licences, CI wiring for the build itself | unity-cli |
| Reaching a live Editor, or one that will not start | unity-debug |
| Audio import settings and codecs | unity-audio |
| Mesh and texture optimisation at the asset level | unity-3d-models |
| Which render pipeline is actually in force | unity-render-urp |
| Sprite packing, and atlas variants for the web | unity-sprite-atlas |
| In-game frame windows and counters | unity-profiling |
templates/WebOptimizer.cs — the ten release settings as one
menu item, saved and read back ·
reference/settings-and-verification.md — proving the
write landed, browser profiling, local servers, toktx encoding.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub tipoli5890/game-studio --plugin unity-dev51 skills in this plugin
/unity-2d-animationSkeletal 2D characters: PSB rig, bones and weights, sprite swaps, 2D IK (2D Animation package)./unity-2d-controllerMove a 2D character: platformer jump, slopes, coyote time, moving platforms, top-down movement./unity-2d-gridGrid tactics and tile puzzles, hex or square: move range, A* paths, line of sight, turns, undo./unity-2d-level2D level layout as data: Tiled/LDtk import, rooms, endless chunks, seeded levels, jump reachability.