# optimize-web

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.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 5200 installs · ★ 1149
- Author: Unity-Technologies
- License: LicenseRef-Unknown · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Unity-Technologies/skills/tree/HEAD/skills/optimize-web/SKILL.md
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/skills/optimize-web

## What it 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.

## Requirements
- Works with: Unity

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add Unity-Technologies/skills --skill optimize-web -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/optimize-web/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/optimize-web/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add Unity-Technologies/skills --skill optimize-web -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/optimize-web/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add Unity-Technologies/skills --skill optimize-web -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/optimize-web/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install Unity-Technologies/skills optimize-web
```

2. **Manually: put the files in place**
- File: `.github/skills/optimize-web/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add Unity-Technologies/skills --skill optimize-web -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/Unity-Technologies/skills --path skills/optimize-web
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/optimize-web/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add Unity-Technologies/skills --skill optimize-web -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/Unity-Technologies/skills/tree/HEAD/skills/optimize-web/SKILL.md

## When to use it
- 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
- 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

## Similar
- [orbit-card](https://affpapa.org/en/nevibecode/skills/orbit-card.md) — skill · 10000 installs
- [cad](https://affpapa.org/en/nevibecode/skills/cad.md) — skill · 14000 installs
- [step-parts](https://affpapa.org/en/nevibecode/skills/step-parts.md) — skill · 11200 installs
- [sdf](https://affpapa.org/en/nevibecode/skills/sdf.md) — skill · 10500 installs
- [urdf](https://affpapa.org/en/nevibecode/skills/urdf.md) — skill · 10500 installs
- [hatch-pet](https://affpapa.org/en/nevibecode/skills/hatch-pet.md) — skill · 3300 installs

From the same set: [unity-technologies/skills](https://affpapa.org/en/nevibecode/by/unity-technologies/skills.md) — 31 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
