Skip to content
Development
Skill

/optimization

Optimize project assets and scenes

From plugin
unity-skills
1.9k83 skills4 commands

Claude Code

$ npx -y skills add Besty0728/Unity-Skills --skill optimization --agent claude-code

SKILL.md

optimization.SKILL.md
name: unity-optimization
description: Optimize project assets and scenes

Unity Optimization Skills

Analyse and optimise project assets (textures, models, audio) and scene objects (static flags, LOD groups). Parameters come from the schema (`GET /skills/schema?category=Optimization&wire=v2`); execution and dryRun rules: root [SKILL.md](../../SKILL.md).

When to use

  • Reducing build size or batch-compressing assets
  • Finding large assets, duplicate materials or overdraw
  • Analysing scene polygon and material usage
  • Setting static flags or LOD groups

Rules

  • Analysis skills are read-only and run in every mode; the write skills need a grant under Approval.
  • Write skills re-import assets or change components, without a dry-run rollback. Check `filter` or `assetType` before a batch run, and review the returned `modified` list.
  • No skill here deletes or triggers a domain reload.

Pitfalls

  • `optimize_textures` `limit` is a cap on modified textures; 0 (default) means no cap.
  • `optimize_set_static_flags`: `Everything` and `Nothing` are aliases added by this API, not enum members. `Everything` is the OR of the five non-deprecated members, so `NavigationStatic` and `OffMeshLinkGeneration` must be named explicitly. A flag name that does not resolve fails the whole call.

Routing

  • Profiler metrics → `profiler` module.
  • Performance review guidance → the `performance` advisory module.

Skills

`optimize_textures`

Optimize texture settings (maxSize, compression). Returns the list of modified textures.

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | maxTextureSize | int | No | 2048 | Max texture size | | enableCrunch | bool | No | true | Enable crunch compression | | compressionQuality | int | No | 50 | Compression quality 0-100 | | filter | string | No | "" | Asset search filter | | limit | int | No | 0 | Maximum textures to modify; 0 = no limit |

**Returns:** `{ success, count, message, modified }`

`optimize_mesh_compression`

Set mesh compression for 3D models.

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | compressionLevel | string | No | "Medium" | Compression level: Off/Low/Medium/High | | filter | string | No | "" | Asset filter |

**Returns:** `{ success, count, compression, modified }`

`optimize_analyze_scene`

Analyze the scene for performance bottlenecks (high-poly meshes, excessive materials).

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | polyThreshold | int | No | 10000 | Triangle count threshold for high-poly warning | | materialThreshold | int | No | 5 | Material slot count threshold for excessive materials warning |

**Returns:** `{ success, totalRenderers, totalTriangles, totalMaterialSlots, issueCount, issues }`

`optimize_find_large_assets`

Find assets exceeding a size threshold (in KB).

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | thresholdKB | int | No | 1024 | Size threshold in KB | | assetType | string | No | "" | Asset type filter (e.g. Texture2D, AudioClip) | | limit | int | No | 50 | Maximum number of results |

**Returns:** `{ success, threshold, count, assets }`

`optimize_set_static_flags`

Set static flags on a GameObject. `flags` is comma-separated, drawn from `ContributeGI`, `OccluderStatic`, `OccludeeStatic`, `BatchingStatic`, `ReflectionProbeStatic`, plus the deprecated `NavigationStatic` and `OffMeshLinkGeneration`; the `Everything` and `Nothing` aliases are described under Pitfalls.

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | name | string | No | null | GameObject name | | entityId | string | No | null | GameObject entity ID (preferred; the only id on Unity 6000.4+) | | instanceId | int | No | 0 | GameObject instance ID | | path | string | No | null | GameObject hierarchy path | | flags | string | No | "Everything" | Comma-separated static flags, or the `Everything` / `Nothing` aliases | | includeChildren | bool | No | false | Apply to all children recursively |

**Returns:** `{ success, gameObject, flags, affectedCount }`

`optimize_get_static_flags`

Get the static flags of a GameObject.

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | name | string | No | null | GameObject name | | entityId | string | No | null | GameObject entity ID (preferred; the only id on Unity 6000.4+) | | instanceId | int | No | 0 | GameObject instance ID | | path | string | No | null | GameObject hierarchy path |

**Returns:** `{ success, gameObject, flags, isStatic }`

`optimize_audio_compression`

Batch-set audio compression. `compressionFormat`: PCM, Vorbis or ADPCM. `loadType`: DecompressOnLoad, CompressedInMemory or Streaming.

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | compressionFormat | string | No | "Vorbis" | PCM, Vorbis or ADPCM | | loadType | string | No | "CompressedInMemory" | DecompressOnLoad, CompressedInMemory or Streaming | | quality | float | No | 0.5 | Compression quality 0.0-1.0 | | filter | string | No | "" | Asset filter |

**Returns:** `{ success, count, compressionFormat, loadType, modified }`

`optimize_find_duplicate_materials`

Find materials with identical shader and properties.

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | limit | int | No | 50 | Maximum number of duplicate groups to return |

**Returns:** `{ success, duplicateGroups, groups }`

`optimize_analyze_overdraw`

Find transparent objects that may cause overdraw.

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | limit | int | No | 50

Read more
@besty0728
Ships withunity-skills

REST API-based AI-driven Unity Editor Automation Engine Let AI control Unity scenes directly through Skills 🎉 We are now indexed by DeepWiki! Got questions? Check out the AI-generated docs → The current official maintenance baseline is Unity 2022.3+.

Stars on GitHub

Momentum

stars in total
1.9k
Star history of Besty0728/Unity-Skills on GitHub, a chart by star-history.com

Other skills on unity-skills.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about optimization.

Which coding agents can use optimization?
optimization installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.