skills/unity-webgl/SKILL.md
Unified Unity WebGL skill for JavaScript interop plugins, WebGL build optimization, deployment, and custom HTML templates. Auto-triages JSLib, Build, and Template work. MUST use for Unity WebGL requests: .jslib plugins, calling JS from Unity, browser APIs, build size, compression, memory, linker.xml, Player Settings, deployment, server MIME types, loading screens, templates, responsive canvas, iframe embedding, localStorage, Brotli, platform-conditional code, or issues that work in Editor but fail in WebGL. Do not use for general runtime C#, editor scripts, or non-WebGL debugging.
npx skillsauth add cuozg/oh-my-skills unity-webglInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Detect what the user needs for WebGL, select mode, deliver complete platform-specific code.
| Signal | Mode |
|--------|------|
| .jslib, call JS from C#, browser API (clipboard, localStorage, URL params, fullscreen) | JSLib |
| Build size, compression, linker.xml, memory, Player Settings, deployment, server MIME types | Build |
| HTML template, loading screen, responsive canvas, iframe, custom shell, progress bar | Template |
State triage: "This is [mode] — [reason]."
JSLib Mode:
Assets/Plugins/WebGL/ for .jslib files and patterns; read any C# bridge classes.jslib using mergeInto(LibraryManager.library, {...}) + C# class with [DllImport("__Internal")] extern methods + #if UNITY_WEBGL && !UNITY_EDITOR guards on call sitesreferences/jslib-patterns.md for marshalling ruleslsp_diagnostics on C# files; validate .jslib has valid JS syntaxBuild Mode:
ProjectSettings/, linker.xml, build scripts, compression settingsreferences/build-optimization.md for settings referencelinker.xml · For compression: recommend Brotli (HTTPS) or Gzip + server config · For memory: configure heap sizeTemplate Mode:
Assets/WebGLTemplates/ for existing templates; read current index.htmlreferences/template-customization.md for variables and patternsindex.html with Unity template variables ({{{ PRODUCT_NAME }}}) · responsive CSS · JS for error handling, mobile detection, fullscreen#if UNITY_WEBGL && !UNITY_EDITOR — must compile on all platforms.jslib files go in Assets/Plugins/WebGL/ — path matters for build pipelineUTF8ToString() for incoming strings; _malloc + stringToUTF8 for return strings — never skip buffer allocationSendMessage is legacy — prefer [DllImport("__Internal")] for C#→JS callsSystem.Threading, System.IO.File, raw System.Net.Sockets in WebGL pathslsp_diagnostics after every code change| To | When |
|----|------|
| unity-code | Work is pure C# with no JS interop |
| unity-debug | Build fails with compile errors |
| unity-uitoolkit | User wants runtime UI, not HTML shell |
| unity-debug | "Works in editor but not in WebGL" with runtime errors |
read_skill_file("unity-standards", "references/<path>"):
code-standards/architecture-systems.md · code-standards/lifecycle-async-errors.mddebug/common-unity-errors.md · other/unity-mcp-routing-matrix.mdread_skill_file("unity-webgl", "references/<path>"):
jslib-patterns.md · build-optimization.md · template-customization.mdtools
Generate Unity raster image assets through Unity MCP: game sprites, item art, backgrounds, UI icons, portraits, concept images, transparent cutouts, image edits, upscales, background removal, and Unity scene or Game View screenshots. Use when a Unity project needs image files imported under Assets or screenshots captured from the editor. Do not use for meshes, audio, animation, materials, gameplay code, UI Toolkit layout, or generic non-Unity image generation.
tools
Create Unity technical solution documents from user requirements, feature ideas, bug goals, specs, or codebase problems. Use when the user asks for a technical approach, architecture, implementation strategy, solution options, feasibility analysis, system design, or "how should we build/fix this" for Unity runtime, Editor, tools, assets, data, UI, WebGL, SDKs, or production pipelines.
tools
Orchestrate Unity Editor via MCP (Model Context Protocol) tools and resources. Use when working with Unity projects through MCP for Unity - creating/modifying GameObjects, editing scripts, managing scenes, running tests, or any Unity Editor automation. Provides best practices, tool schemas, and workflow patterns for effective Unity-MCP integration.
development
Convert a spec document into an implementation TODO list in the same spec folder. U se when the user says goal-todo, todo from spec, generate tasks from spec, turn this spec into todos, create implementation checklist, extract tasks, or asks to read a Docs/Specs design doc and produce what must be implemented. Includes UI/UX review and codebase investigation before writing the checklist. Do not use for implementing the tasks, creating new goal files, writing test cases, or verifying completed work.