skills/unity-optimize/SKILL.md
Optimize Unity project performance — code hot paths, build settings, rendering, memory, physics, and platform-specific tuning. Auto-triages: Code (GC elimination, allocation-free patterns, Jobs/Burst migration in specific scripts), Settings (Player Settings, Quality Settings, Physics Settings, platform config for target hardware), Audit (full project performance sweep with ranked findings and applied fixes). MUST use for ANY Unity optimization request — "make this faster," "reduce GC," "optimize for mobile," "reduce build size," "too many draw calls," "memory issues," "frame drops during gameplay," "performance pass," "optimize my project," "why is my game slow," even when the user doesn't say "optimize" explicitly but describes performance symptoms. Do not use for profiler data analysis (unity-profiler), code refactoring without perf focus (unity-code), or general code writing (unity-code).
npx skillsauth add cuozg/oh-my-skills unity-optimizeInstall 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.
Analyze performance bottlenecks, apply targeted fixes, verify improvement. Always measure before and after.
| Signal | Mode | |--------|------| | Specific script(s), "optimize this Update," "reduce GC in this code" | Code | | Build size, Player/Quality Settings, platform config, "optimize for mobile" | Settings | | "Performance audit," "full sweep," general "why is my game slow" | Audit |
State triage: "This is [mode] — [reason]."
references/code-scan-patterns.md + unity-standards/review/performance-checklist.md:
new)GetComponent/Find/FindObjectOfTypesealed on leaf MonoBehavioursreferences/gc-allocation-patterns.md + references/allocation-free-cookbook.md:
Awake/Start · Replace LINQ with loops · Use NonAlloc physics · Pool objectsProfilerMarkers via references/profiling-instrumentation.mdlsp_diagnostics on every changed fileoptimization/<topic>.mdProjectSettings/ if accessible; else ask user about current settingsSettings mode provides recommendations only — user applies in Unity Editor.
.cs for hot-path anti-patterns (see references/code-scan-patterns.md)ProjectSettings/ against platform best practicesreferences/asset-optimization.mdreferences/audit-report-template.mdlsp_diagnostics after every code changeunity-code · For profiler analysis → unity-profiler| Purpose | Tool |
|---------|------|
| Baseline GC (all frames) | Unity.Profiler_GetOverallGcAlloca |
| Baseline frame time | Unity.Profiler_GetFrameRangeTopTimeSummary |
| Verify GC reduction | Unity.Profiler_GetFrameGcAllocati |
| Verify time improvement | Unity.Profiler_GetFrameTopTimeSam |
Full tool decision tree: read_skill_file("unity-standards", "references/other/unity-mcp-routing-matrix.md") → Profiling Branch.
Via read_skill_file("unity-standards", "references/<path>"):
review/checklist.md §4 · quality/performance-audit.md · code-standards/performance-data.mdoptimization/build-settings.md · optimization/rendering-settings.md · optimization/memory-settings.mdoptimization/physics-settings.md · optimization/mobile-settings.md · optimization/jobs-burst-migration.mdVia read_skill_file("unity-optimize", "references/<path>"):
gc-allocation-patterns.md · allocation-free-cookbook.md · code-scan-patterns.mddraw-call-reduction.md · asset-optimization.md · platform-targets.mdprofiling-instrumentation.md · benchmark-template.md · audit-report-template.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.