Skip to content
Skills Library
Programming · Analysis

unity-optimization

/unity-optimization

Use when profiling, diagnosing, optimizing, or reviewing Unity performance, including CPU/GPU bottlenecks, GC allocations, Update/Input/UI hot paths, physics cost, rendering, shaders, batching, Addressables/loading, mobile thermal/battery constraints, memory, and before/after performance evidence.

Licence
MIT
Last repository change
22.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when profiling, diagnosing, optimizing, or reviewing Unity performance, including CPU/GPU bottlenecks, GC allocations, Update/Input/UI hot paths, physics cost, rendering, shaders, batching, Addressables/loading, mobile thermal/battery constraints, memory, and before/after performance evidence.

Original author description

Use when profiling, diagnosing, optimizing, or reviewing Unity performance, including CPU/GPU bottlenecks, GC allocations, Update/Input/UI hot paths, physics cost, rendering, shaders, batching, Addressables/loading, mobile thermal/battery constraints, memory, and before/after performance evidence.

How it works

  1. First Read
  2. Optimization Workflow
  3. Default Fix Priorities
  4. Guardrails
  5. Reference Loading
  6. Output Contract
Original SKILL.md headings · 100 lines, 544 words
SKILL.md preview
---
name: unity-optimization
model: inherit
description: Use when profiling, diagnosing, optimizing, or reviewing Unity performance, including CPU/GPU bottlenecks, GC allocations, Update/Input/UI hot paths, physics cost, rendering, shaders, batching, Addressables/loading, mobile thermal/battery constraints, memory, and before/after performance evidence.
---

# Unity Optimization

Use this skill for Unity performance work. Prefer measured fixes over generic
"optimization" changes.

## First Read

Before changing code or settings:

1. Read repository instructions: `AGENTS.md`, `CLAUDE.md`, `Assets/CLAUDE.md`,
   nearest path-scoped instructions, Unity style docs, and project performance
   notes when present.
2. Inspect `ProjectSettings/ProjectVersion.txt`, `Packages/manifest.json`, and
   relevant `Assets/` code/settings.
3. Verify the installed Unity CLI, installing it when missing, and apply
   `unity-cli`'s version gate. Unity 6+ uses exact-root/version-matched
   `unity status --json`, full `--project-path`, and built-in `unity mcp`
   when needed. Pre-Unity-6 uses
   [the exact MCP identity gate](../unity-cli/SKILL.md#exact-mcp-identity-gate)
   before selection and project-info readback before profiling. Check this
   route before pinned file evidence; other legacy MCP/UnitySkills use still
   requires an explicit user request. File evidence is not live profiler proof.
4. Identify target platform, target frame rate, device class, and the exact
   symptom before editing.

## Optimization Workflow

1. Define the budget: frame time, memory, load time, draw calls, build size, or
   device target.
2. Reproduce the issue and collect evidence: profiler markers, logs, snapshots,
   screenshots, device notes, or a concrete scenario.
3. Classify the bottleneck:
   - CPU scripting/main thread
   - GC/memory allocation
   - GPU/rendering/fill-rate/shaders
   - UI layout/rebuild/input path
   - Physics/fixed timestep/colliders/raycasting
   - Asset loading/Addressables/instantiation
   - Mobile thermal/battery/platform settings
4. Remove or reduce measured work with the smallest scoped change.
5. Re-measure and document before/after evidence.

## Default Fix Priorities

- Avoid allocations in `Update`, `LateUpdate`, `FixedUpdate`, physics callbacks,
  input callbacks, UI loops, and render paths.
- Avoid LINQ, boxing, string building, closures, iterator allocations, and new
  collections in hot paths.
- Cache component references; do not use scene-wide queries or repeated
  `GetComponent` calls in frame loops.
- Prefer event-driven or reactive flow over unnecessary polling.
- Use pooling for frequently spawned/despawned objects.
- Keep UI updates dirty-state driven; avoid rebuilding layouts every frame.
- Use Addressables and async loading for runtime asset work; release handles.
- Prefer simple data structures and predictable iteration over abstraction that
  hides cost.
- For mobile, watch fill-rate, overdraw, texture size, memory spikes, battery,
  thermal throttling, and real-device performance.

## Guardrails

- Do not optimize blindly. If there is no evidence, first add measurement or
  state the assumption clearly.
- Do not rewrite architecture for a small hot path unless measurement justifies
  the blast radius.
- Do not add legacy fallback paths unless the user explicitly asks or production
  compatibility requires it.
- Preserve behavior unless the user asked for a behavior change.
- For bug/performance fixes, explain root cause, changed files, and verification.

## Reference Loading

Load only what is relevant:

- Unity general implementation rules: use `unity-game-dev`.
- SOLID/refactoring boundaries: use `clean-oop-architecture`.
- Performance code review: use `game-code-review`.
- Pool checkout identity, material-property ownership and measured batching
  comparisons: [Unity ownership and authoring](../unity-game-dev/references/ownership-and-authoring.md#pools-and-measured-rendering).
- Local optimization PDF index:
  `optional local reference library (not included; skip if unavailable)`
- Broader Unity/game programming PDF index:
  `optional local reference library (not included; skip if unavailable)`

Search the PDF-derived Markdown with `rg` and load only relevant sections. The
repository, current Unity docs, and measured profiler evidence override older
PDF examples.

## Output Contract

For every optimization task, report:

- Bottleneck classification.
- Evidence before the change, or what evidence was unavailable.
- Changed files/settings.
- Work removed or reduced.
- Verification run and before/after result.
- Residual risk or follow-up measurement.
Files in this package (2)
  • SKILL.md 5 KB
  • agents/openai.yaml 1 KB

Versions

The database has no other skills named unity-optimization.

Database snapshot: 13.11.2026 · package version 65daa458aa69 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90unity-performance-audit
    Use when the task is to measure CPU, GPU, memory, batching, and asset-loading costs.
  • 100unity-performance
    Unity performance — Profiler, Frame Debugger, Memory Profiler, GC allocation hunting, object pooling, IL2CPP build settings, Burst, batching, LOD, GPU Resident Drawer. USE WHEN: frame drops, GC spikes, long load times, memory growth, draw-call storms, mobile thermal/battery…
  • 90dart-optimization
    Use when profiling CPU hot paths, optimizing memory allocations, or enforcing static typing performance in Dart.
  • 100unity-performance
    Unity 6 performance profiling and optimization guide. Use when profiling, optimizing frame rate, reducing memory usage, debugging performance bottlenecks, or using the Profiler, Memory Profiler, or Frame Debugger. Based on Unity 6.3 LTS documentation.
  • 100mobile-game-performance
    Use when establishing or enforcing mobile-game frame-time, memory, loading, storage, network, battery, thermal, rendering, physics, AI, audio, and asset budgets through physical-device profiling; not for speculative optimisation.
  • 90unity-addressables-design
    Use when the task is to plan Addressables groups, labels, profiles, and dependency boundaries.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.