Unity optimization

From furkantokkan/agent-foundry · View interactive version

Unity optimization is an AI agent skill from the GitHub repository furkantokkan/agent-foundry. 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 to use this skill

Skill file

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.

  1. Inspect ProjectSettings/ProjectVersion.txt, Packages/manifest.json, and

relevant Assets/ code/settings.

  1. 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

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.

  1. 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.

  1. Reproduce the issue and collect evidence: profiler markers, logs, snapshots,

screenshots, device notes, or a concrete scenario.

  1. Classify the bottleneck:
  1. Remove or reduce measured work with the smallest scoped change.
  2. Re-measure and document before/after evidence.

Default Fix Priorities

input callbacks, UI loops, and render paths.

collections in hot paths.

GetComponent calls in frame loops.

hides cost.

thermal throttling, and real-device performance.

Guardrails

state the assumption clearly.

the blast radius.

compatibility requires it.

Reference Loading

Load only what is relevant:

comparisons: Unity ownership and authoring.

optional local reference library (not included; skip if unavailable)

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:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.