hz-android-2d-porting
Guides porting existing Android 2D apps to Meta Quest and Horizon OS — input adaptation, panel layout, and design requirements. Use when adapting a mobile…
Analyzes Meta Quest and Horizon OS VR performance using Perfetto traces — frame timing, CPU/GPU bottlenecks, render pass analysis. Use when profiling frame drops, jank, or thermal issues on Quest devices.
$ npx -y skills add meta-quest/agentic-tools --skill hz-perfetto-debug --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/hz-perfetto-debugContext preview
The summary Claude sees to decide when to auto-load this skill.
Analyzes Meta Quest and Horizon OS VR performance using Perfetto traces — frame timing, CPU/GPU bottlenecks, render pass analysis. Use when profiling frame drops, jank, or thermal issues on Quest devices.
name: hz-perfetto-debug license: Apache-2.0 description: Analyzes Meta Quest and Horizon OS VR performance using Perfetto traces — frame timing, CPU/GPU bottlenecks, render pass analysis. Use when profiling frame drops, jank, or thermal issues on Quest devices. allowed-tools: Bash(metavr:*) Bash(hzdb:*) Bash(npx:*)
Use this skill when investigating VR performance issues on Meta Quest devices:
These are the hard deadlines for each refresh rate. If a frame exceeds its target, the compositor must reproject or the user sees a stale frame.
| Refresh Rate | Frame Time Budget | Notes | |-------------|------------------|-------| | 120 Hz | 8.3 ms | Supported on Quest 2, Quest 3, Quest 3S | | 90 Hz | 11.1 ms | Supported on Quest 2, Quest Pro, Quest 3, Quest 3S | | 72 Hz | 13.9 ms | Default on all Quest devices | | 60 Hz | 16.7 ms | Media apps only (Quest 2); interactive apps must use 72 Hz+ |
Missing a frame deadline by even 1 ms causes a stale frame (reprojection). Stale frames above 10% of total frames indicate a serious performance problem.
Perfetto tracing is powered by the metavr CLI. Invoke via `npx` — no install required:
npx -y metavr --version
Examples below use the bare `metavr` command for brevity; if it is not installed globally, replace `metavr` with `npx -y metavr`. Connect your Quest via USB with developer mode enabled before capturing traces.
# Capture a 5-second trace from the currently running VR app metavr perf capture # Specify duration and target app metavr perf capture --duration 10000 --app com.example.myapp # Enable GPU render stage tracing for detailed pass analysis metavr perf capture --gpu-render-stage # Enable XR runtime metrics metavr perf capture --xr-runtime # Custom output name metavr perf capture -o my-session-name
The capture auto-detects the foreground VR app if `--app` is not specified. CPU scheduling and GPU metrics tracing are enabled by default. The trace is pulled to your local machine automatically.
metavr perf traces
Returns `.pftrace` files sorted by modification time (newest first). Searches standard directories including `~/Documents`, `~/Downloads`, and the current working directory.
metavr perf load <trace-file>
Loads and processes the trace for analysis. Accepts a hex session ID, filename (with or without `.pftrace` extension), or a full/relative path.
metavr perf context
Returns a structured performance analysis including:
metavr perf query <session-id> "SELECT ts, dur, name FROM slice WHERE name LIKE '%PlayerLoop%' LIMIT 20"
Executes arbitrary SQL against the loaded Perfetto trace database. All Perfetto tables are available: `slice`, `thread_track`, `thread`, `process`, `counter`, `counter_track`, `args`, `sched_slice`, and more.
metavr perf thread-state <session-id> <utid> # With time range metavr perf thread-state <session-id> <utid> --start-ts 1000000 --end-ts 5000000000
Returns a thread state breakdown showing how much time the thread spent running, sleeping, blocked, or waiting for CPU. Useful for identifying whether a thread is CPU-bound, I/O-bound, or starved.
metavr perf gpu-counters <session-id> --start-ts 100,200,300 --end-ts 150,250,350
Returns GPU metric counters (mean, standard deviation, quantiles) for GPU frame ranges. Requires at least 20 frames for statistical accuracy. Metrics include texture fetch rates, shader ALU capacity, vertex processing, and fragment shading statistics.
Follow these steps in order for a thorough performance investigation.
Before analyzing, confirm the trace is usable:
SELECT (MAX(ts) - MIN(ts)) / 1e9 AS duration_seconds, COUNT(*) AS total_slices FROM slice
If the trace has fewer than 1000 slices or is under 1 second, it may not contain enough data for meaningful analysis. Capture a new trace with `metavr perf capture`.
Find the application process (not system services):
SELECT upid, pid, name FROM process WHERE name NOT LIKE 'com.oculus%' AND name NOT LIKE '/system%' AND name NOT LIKE 'com.android%' AND name IS NOT NULL ORDER BY pid
For known apps, filter directly by package name.
Look for engine-specific markers:
| Engine | Key Markers | |--------|------------| | Unity | `PlayerLoop`, `UnityMain`, `PhaseSync`, `PostLateUpdate.FinishRendering` | | Unreal | `UGameEngine::Tick`, `FEngineLoop::Tick`, `RHI Thread` | | Native OpenXR | `xrWaitFrame`, `xrBeginFrame`, `xrEndFrame` without engine markers |
Identify the threads that matter for VR rendering:
SELECT t.utid, t.tid, t.name, p.name AS process_name FROM thread t JOIN process p USING(upid) WHERE p.name = '<target-process>' ORDER BY t.name
Critical threads to locate:
| Thread | Purpose | |--------|---------| | Main thread (UnityMain / GameThread) | Game logic, physics, scripts
Agentic skills and tools for Meta Quest and Horizon OS development.
Repo: meta-quest/agentic-tools
Guides porting existing Android 2D apps to Meta Quest and Horizon OS — input adaptation, panel layout, and design requirements. Use when adapting a mobile…
Upgrades Meta Quest apps to newer Horizon OS SDK versions — migration guides, deprecated API replacements, changelog. Use when updating SDK versions or fixing…
Guides design of comfortable, intuitive VR/MR experiences for Meta Quest and Horizon OS — comfort guidelines, interaction patterns, spatial layout,…
Builds WebXR experiences for Meta Quest and Horizon OS using the Immersive Web SDK (IWSDK) — ECS architecture, Three.js integration, spatial UI. Use when…
Scaffolds new Meta Quest and Horizon OS projects with recommended settings for Unity, Unreal, Android/Spatial SDK, or WebXR. Use when creating a new Quest app…
Guides integration of the Horizon Platform SDK for Meta Quest and Horizon OS Android/Kotlin apps — achievements, IAP, users, leaderboards, presence,…