Hz Unity Code Review logo

Hz Unity Code Review

Organization
meta-quest
hz-unity-code-review

Reviews Unity code targeting Meta Quest and Horizon OS for performance issues, rendering best practices, and common VR pitfalls. Use during code review or when diagnosing Quest performance problems in Unity projects.

Overview

Publishermeta-quest
Repositoryagentic-tools
Skill namehz-unity-code-review
Stars
195
Forks
17
Bundled files
4
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by meta-quest on GitHub. Read the source before you install it.

Installation

Install the Hz Unity Code Review AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/meta-quest/agentic-tools.git /tmp/agentic-tools
mkdir -p .claude/skills
cp -r /tmp/agentic-tools/skills/hz-unity-code-review .claude/skills/hz-unity-code-review
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Hz Unity Code Review in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Hz Unity Code Review on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Hz Unity Code Review is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Unity Code Review for Meta Quest

When to Use

Use this skill when reviewing Unity C# code or project settings that target Meta Quest headsets. This includes:

  • Reviewing scripts for VR performance issues
  • Checking rendering pipeline configuration and settings
  • Ensuring adherence to Quest-specific best practices
  • Identifying common VR development pitfalls
  • Validating input handling for controllers, hands, and eye tracking
  • Auditing memory usage and GC allocation patterns

Key Review Areas

1. Rendering Pipeline Configuration

Quest applications must use the Universal Render Pipeline (URP) with specific settings optimized for mobile VR. The Built-in Render Pipeline is not recommended for new Quest projects.

Critical settings to verify:

  • Single-pass multiview must be enabled (Player Settings > XR Plug-in Management > Oculus > Stereo Rendering Mode)
  • Vulkan should be the primary graphics API
  • Linear color space is required for correct lighting
  • HDR should be disabled in URP asset settings
  • Post-processing should be minimal or disabled

2. Draw Call Budgets and Batching

Quest has draw call budgets that vary by workload complexity. Every draw call has CPU overhead that directly impacts frame timing.

MetricQuest 2 / Quest ProQuest 3 / Quest 3S
Draw calls (busy simulation)80-200200-300
Draw calls (medium simulation)200-300400-600
Draw calls (light simulation)400-600700-1000
Triangles per frame750K-1M1M-2M
SetPass calls< 50< 80

Enable and verify:

  • Static batching for non-moving geometry
  • GPU instancing for repeated objects
  • SRP batcher for URP materials
  • Dynamic batching for small meshes (< 300 vertices)

3. Shader Complexity

Mobile GPUs on Quest cannot handle desktop-class shaders. Review all materials for:

  • Use of URP/Lit or URP/Simple Lit instead of Standard shader
  • Custom shaders that minimize texture samples and ALU operations
  • Avoidance of real-time shadows where possible (bake instead)
  • No screen-space effects (SSAO, SSR, screen-space shadows)

4. Memory Management

GC allocations cause frame hitches and must be eliminated from hot paths.

csharp
// BAD: Allocates every frame
void Update() {
    string label = "Score: " + score.ToString();
    var enemies = FindObjectsOfType<Enemy>();
    var filtered = enemies.Where(e => e.IsAlive).ToList();
}

// GOOD: Zero allocations in Update
private StringBuilder _sb = new StringBuilder(32);
private List<Enemy> _enemyCache = new List<Enemy>();
private Enemy[] _enemyArray;

void Start() {
    _enemyArray = FindObjectsOfType<Enemy>();
}

void Update() {
    _sb.Clear();
    _sb.Append("Score: ");
    _sb.Append(score);
}

5. Input Handling

Quest supports multiple input modalities. Code should handle:

  • Controllers: Use Unity's Input System Package for new projects (recommended); OVRInput is maintained for legacy support
  • Hand tracking: OVRHand and OVRSkeleton for hand pose data
  • Eye tracking: OVREyeGaze (Quest Pro / Quest 3, requires permission)
  • Graceful switching between controller and hand tracking modes

6. Physics Configuration

Physics simulation is expensive on mobile. Review for:

  • Physics timestep set to match target frame rate (72/90/120 Hz)
  • Simplified collision meshes (use primitives, not mesh colliders)
  • Reduced solver iterations (4-6 is usually sufficient)
  • Layer-based collision matrix to minimize pair checks
  • Rigidbody sleep thresholds configured appropriately

7. Audio Setup

Audio is often overlooked but can impact performance:

  • Compress audio clips (Vorbis for music, ADPCM for short SFX)
  • Use streaming load type for clips longer than 1 second
  • Limit simultaneous audio sources (target < 16)
  • Spatialize audio using Meta's audio SDK for 3D positioning

Quick Review Checklist

AreaTargetNotes
Draw calls80-200 (busy) to 400-600 (light)Use batching, instancing, atlasing
Triangles750K-1M/frameUse LODs, occlusion culling
Texture resolutionMax 2K, 4K sparinglyASTC compression required
ShaderURP mobile shadersNo Standard shader, no screen-space effects
Rendering modeSingle-pass multiviewMust be enabled in XR settings
FFREnabled (High or HighTop)Fixed foveated rendering reduces edge fragment cost
MSAA4x quality / 2x perfFree on tile-based GPU when configured correctly
Target frame rate72 Hz minimum90 Hz recommended, 120 Hz for smooth experiences
GC allocations0 B/frame in steady stateNo allocations in Update/LateUpdate/FixedUpdate
Audio sources< 16 simultaneousUse pooling for audio sources

What to Look For in Code

GC-Heavy Patterns

csharp
// Flag these patterns in code review:
Camera.main                          // Calls FindWithTag internally
GameObject.Find("name")             // Linear search every call
GetComponent<T>() in Update         // Cache the result
new List<T>() in Update             // Allocates on heap
string + string in Update           // Creates new string objects
foreach on non-List collections     // Enumerator allocation
LINQ queries (.Where, .Select)      // Multiple allocations
Boxing (int -> object)              // Heap allocation
delegate/lambda in hot paths        // Closure allocation

Update() Misuse

csharp
// BAD: Empty Update still has overhead
void Update() { }

// BAD: Logic that doesn't need per-frame execution
void Update() {
    SavePlayerPrefs();  // Should be event-driven
}

// GOOD: Use events, coroutines, or InvokeRepeating for non-per-frame logic
void OnScoreChanged(int newScore) {
    UpdateScoreUI(newScore);
}

Camera.main Anti-Pattern

csharp
// BAD: Camera.main uses FindWithTag internally
void Update() {
    transform.LookAt(Camera.main.transform);
}

// GOOD: Cache the reference
private Transform _cameraTransform;

void Start() {
    _cameraTransform = Camera.main.transform;
}

void Update() {
    transform.LookAt(_cameraTransform);
}

Find Calls in Hot Paths

csharp
// BAD: Expensive search every frame
void Update() {
    var player = GameObject.FindWithTag("Player");
    var rb = player.GetComponent<Rigidbody>();
}

// GOOD: Cache in Awake/Start or use dependency injection
private Rigidbody _playerRb;

void Awake() {
    _playerRb = GameObject.FindWithTag("Player").GetComponent<Rigidbody>();
}

Using metavr for Validation

You can use the metavr tool to validate builds and check device-side behavior. Invoke via metavr <args> (published as the npm package metavr; if metavr is not on PATH, run npx -y metavr <args>) — no install required.

bash
# Check connected Quest device
metavr device list

# Install and run a build
metavr app install path/to/build.apk
metavr app launch com.company.app

# Check device logs for errors
metavr adb logcat --tag Unity

# Monitor GPU performance
metavr perf capture

Use device-side profiling to validate that code review findings translate to real performance improvements.

Reference Documents

For detailed guidance on specific topics, see the following reference documents:

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Hz Unity Code Review AI skill do?

Reviews Unity code targeting Meta Quest and Horizon OS for performance issues, rendering best practices, and common VR pitfalls. Use during code review or when diagnosing Quest performance problems in Unity projects.

Why use Hz Unity Code Review on TypingMind?

Because you install it once and use it with any model. Hz Unity Code Review is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Hz Unity Code Review in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/meta-quest/agentic-tools/tree/main/skills/hz-unity-code-review. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Hz Unity Code Review?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Hz Unity Code Review?

As many as you like. As long as a model supports skills, you can use Hz Unity Code Review with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Hz Unity Code Review AI skill free?

Yes. It is published on GitHub by meta-quest under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇