mcpbeat Sign in

Unity Performance Agent Skill

Advises on Unity performance red flags — Update/allocation/pooling/physics hot paths, frame drops, and GC pressure. Use when reviewing performance, diagnosing frame drops or stutter, reducing allocations, or planning pooling/optimization, even if the user just says "太卡了" or "怎么优化". 为 Unity 性能红线提供建议(Update/分配/对象池/物理热路径、掉帧、GC 压力);当用户要做性能审查、诊断掉帧或卡顿、减少内存分配、或规划对象池/优化时使用。

1k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
1536
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/Besty0728/Unity-Skills --skill unity-performance

The instruction itself

8 sections, as written by the author

Unity Performance Red Flags

Use this skill for a high-signal review of likely Unity performance issues. Focus on red flags, not speculative micro-optimizations.

Check For

  • Too many unrelated Update / LateUpdate / FixedUpdate loops
  • Repeated Find, GetComponent, Camera.main, or tag lookups in hot paths
  • Frequent Instantiate / Destroy suitable for pooling
  • Avoidable per-frame allocations:
  • LINQ
  • string formatting
  • closures
  • boxing
  • Reflection in runtime hot paths
  • Expensive editor-only helpers leaking into runtime code
  • Physics, animation, or UI updates happening at the wrong cadence

Hidden Costs: Possibility ≠ Actuality

Three counter-intuitive traps where what seems "free" is actually expensive. Each cost is paid for *possibility* of work, not for work actually performed — which is why profilers rarely catch them directly.

Write permission costs, even without writing

A component whose Update *can* mutate transform.position pays the cost whether the branch runs or not: dirty-flag and serialization systems treat write permission as a reason to poll every frame. Similarly, a [SerializeField] field that is never modified at runtime still sits on the serialization path. The fix is to remove the permission, not tighten the branch — split the rarely-needed writer into its own component and AddComponent only when needed. *Source: NetcodeSamples/HelloNetcode/2_Intermediate/07_Optimization/Optimization.md — "a system with the possibility of writing to a component, regardless of whether it writes to it or not, will always have to be serialized".*

Sequential seeds produce correlated random streams

Seeding N RNG instances with baseSeed + i gives N *similar* streams — patrol paths line up, spawn jitter clumps, loot rolls cluster. Hash the index before seeding:

// Wrong — N correlated streams
for (int i = 0; i < N; i++) rngs[i] = new System.Random(baseSeed + i);

// Correct — hash decorrelates adjacent seeds
for (int i = 0; i < N; i++)
    rngs[i] = new System.Random((int)((uint)baseSeed * 2654435761u ^ (uint)i));

Unity.Mathematics.Random.CreateFromIndex(i) applies this internally and is preferred when the math package is available. *Source: Dots101/Entities101/Assets/HelloCube/3. Prefabs/SpawnSystem.cs:37-39 and its comment.*

Logging fires in release builds by default

Debug.Log is not stripped in Player builds; only methods marked [Conditional("UNITY_EDITOR")] (such as Debug.DrawLine) have their arguments elided at the call site. That means a log line with interpolation or helper calls runs every frame in shipped games:

// Wrong — GetPlayerInfo() and string interpolation execute in release
Debug.Log($"Player {GetPlayerInfo()} at {Time.time}");

// Better — guard the whole expression
if (Debug.isDebugBuild) Debug.Log($"Player {GetPlayerInfo()} at {Time.time}");

The same principle as the "possibility write" rule above — the runtime pays for the *possibility* of work, not only for the work.

Output Format

  • Confirmed red flags
  • Likely red flags
  • Changes worth doing now
  • Changes not worth doing now
  • Expected gain category: clarity / frame time / GC / scalability

Guardrails

> Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

  • Do not recommend large refactors without a meaningful hotspot.
  • Do not replace simple code with unreadable “optimized” code unless the hot path is real.

Other skills for the same job

different authors, same section of the catalogue
Doc Coauthoring
by anthropics
vendor ×10

Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.

4k tokens
File Organizer
by frostant
×10

Intelligently organizes your files and folders across your computer by understanding context, finding duplicates, suggesting better structures, and automating cleanup tasks. Reduces cognitive load and keeps your digital workspace tidy without manual effort.

3k tokens
Domain Name Brainstormer
by frostant
×8

Generates creative domain name ideas for your project and checks availability across multiple TLDs (.com, .io, .dev, .ai, etc.). Saves hours of brainstorming and manual checking.

1k tokens
Brainstorming
by ZhanlinCui
×4

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

626 tokens
Planning With Files
by ZhanlinCui
×3

Implements Manus-style file-based planning for complex tasks. Creates task_plan.md, findings.md, and progress.md. Use when starting complex multi-step tasks, research projects, or any task requiring >5 tool calls.

9k tokens scripts
Scientific Brainstorming
by christophacham
×3

Creative research ideation and exploration. Use for open-ended brainstorming sessions, exploring interdisciplinary connections, challenging assumptions, or identifying research gaps. Best for early-stage research planning when you do not have specific observations yet. For formulating testable hypotheses from data use hypothesis-generation.

5k tokens
GitHub Project Management
by ComeOnOliver
×3

Comprehensive GitHub project management with swarm-coordinated issue tracking, project board automation, and sprint planning

14k tokens
Grill Me
by ComeOnOliver
×3

Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".

3k tokens

How to use it

Copy the folder

Take besty0728/unity-performance from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.