hz-iwsdk-webxr
Skill200 starsChanged 53 days agoApache-2.0View on GitHub
Builds WebXR experiences for Meta VR and Horizon OS using the Immersive Web SDK (IWSDK) — ECS architecture, Three.js integration, spatial UI. Use when creating web-based VR/MR apps for Quest Browser.
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- mirzaaghazadeh/iwsdk-webxr-skillsword for word, first seen Oct 17, 2026
Other versions1 project uses a version of this.
Word for word · 1
- mirzaaghazadeh/iwsdk-webxr-skills★ 1100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository37 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- hz-android-2d-portingSkill
- hz-api-upgradeSkill
- hz-immersive-designerSkill
- hz-metavrx-layout-sdkSkill
- hz-metavrx-ui-setSkill
- hz-new-project-creationSkill
- hz-perfetto-debugSkill
- hz-platform-sdkSkill
- hz-psdk-integrationSkill
- hz-quest-verify-firstSkill
- hz-react-native-expoSkill
- hz-simpleperf-debugSkill
- hz-spatial-sdkSkill
- hz-store-pwaSkill
- hz-store-submitSkill
- hz-unity-code-reviewSkill
- hz-unity-device-readinessSkill
- hz-unity-face-trackingSkill
- hz-unity-fbx-importSkill
- hz-unity-meta-core-sdkSkill
- hz-unity-meta-interaction-sdkSkill
- hz-unity-meta-mixed-reality-utility-kitSkill
- hz-unity-meta-movement-sdk-retargetingSkill
- hz-unity-meta-quest-uiSkill
- hz-unity-passthrough-camera-accessSkill
- hz-unity-placementSkill
- hz-unity-platform-sdkSkill
- hz-unity-project-analyzerSkill
- hz-unity-sdk-upgradeSkill
- hz-unity-tmp-resourcesSkill
- hz-vr-debugSkill
- hz-xr-simulator-controlSkill
- hz-xr-simulator-install-and-configureSkill
- metavr-cliSkill
- portalSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 10 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Use this skill when you need to:
- Very specific: line 20
Create 3D scenes using the ECS architecture on top of Three.js
- Distinctive: line 23
Run a closed-loop edit, reload, observe, and fix workflow for IWSDK apps
- Distinctive: line 72
If you are starting from the official create flow, it can also install dependencies and initialize git for you.
- Very specific: line 81
If you are setting up manually, use @iwsdk/core, three, @iwsdk/vite-plugin-dev, and vite-plugin-mkcert instead of the old @meta-quest/iwsdk …
- Distinctive: line 100
IWSDK dev tooling: use the Vite plugin's emulator/dev browser path for quick desktop iteration
- Distinctive: line 115
Verify API and platform details against current docs before coding
- Distinctive: line 121
If you are pairing a native Meta VR frontend with a host-side coding agent, keep the frontend thin.
- Very specific: line 250
Use World.create(...), world.launchXR(), and world.exitXR() as the runtime control surface
- Distinctive: line 252
Keep HTTPS enabled for Quest Browser development because WebXR is gated on secure contexts
- Very specific: line 254
Start with @iwsdk/vite-plugin-dev and Quest Browser validation, then layer in emulator/dev browser workflows for faster iteration
- Distinctive: line 256
Search and fetch Meta docs before coding against APIs you have not verified recently
- Distinctive: line 258
Test on a real Meta VR device early and often because desktop emulation does not capture all input, comfort, and performance issues
- Distinctive: line 260
Keep draw calls low (roughly under 100) for smooth performance on Meta VR hardware
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
IWSDK WebXR Skill
Build immersive WebXR experiences for Meta VR using Meta's Immersive Web SDK (IWSDK). This skill covers the current package layout, ECS architecture, Three.js integration, spatial UI development, XR input handling, and the recommended Vite-based development loop.
When to Use This Skill
Use this skill when you need to:
- Build a WebXR experience targeting Meta VR using IWSDK
- Create 3D scenes using the ECS architecture on top of Three.js
- Design spatial UI panels with UIKitML and
PanelUI - Handle XR input from controllers, hands, and world-space pointers
- Run a closed-loop edit, reload, observe, and fix workflow for IWSDK apps
- Optimize WebXR performance for Meta VR hardware
- Debug and test WebXR applications with IWSDK's Vite dev tooling and Quest Browser
This skill applies to Meta VR Glasses with gaze-pinch input, and to all Meta Quest headsets with Quest Browser.
What Is IWSDK
The Immersive Web SDK (IWSDK) is Meta's framework for building WebXR experiences. It provides:
- Entity Component System (ECS): a data-oriented architecture built on typed component storage and query-driven systems
- Three.js integration: IWSDK manages the renderer, scene, camera, and XR session lifecycle so app code can focus on content
- Spatial UI toolkit: UIKitML plus
PanelUI,PanelDocument, andUIKitDocumentfor in-world and screen-space UI - XR input management: unified handling of controllers, hand tracking, pointers, and grabbing
- Locomotion and interaction systems: opt-in grabbing, teleport, slide, and turning features
- Asset management: manifest-based preloading and keyed access through
AssetManager
IWSDK runs in the browser via the WebXR Device API. Applications are standard web pages that are usually served by Vite during development and opened in Quest Browser for on-device validation.
Current Packaging And Tooling
These details are important because older pre-release guidance is now wrong:
- The main runtime package is
@iwsdk/core - The official scaffold command is
npm create @iwsdk@latest - The default dev loop uses
@iwsdk/vite-plugin-dev - Local HTTPS is typically handled with
vite-plugin-mkcert - Current IWSDK packages require Node.js
>=20.19.0 @iwsdk/corere-exports@iwsdk/xr-inputand@iwsdk/locomotor
Quick Start
1. Create A New Project
npm create @iwsdk@latest my-project
cd my-projectIf you are starting from the official create flow, it can also install dependencies and initialize git for you.
2. Install Dependencies
npm installIf you are setting up manually, use @iwsdk/core, three,
@iwsdk/vite-plugin-dev, and vite-plugin-mkcert instead of the old
@meta-quest/iwsdk package.
3. Start The Dev Server
npm run devThe standard IWSDK Vite setup gives you a secure local dev server, hot module
replacement, and an emulator/dev browser workflow through
@iwsdk/vite-plugin-dev.
4. Test In XR
There are two normal validation paths:
- Quest Browser: open the secure dev URL on the headset and launch XR there
- IWSDK dev tooling: use the Vite plugin's emulator/dev browser path for quick desktop iteration
Quest Browser testing requires HTTPS. If the app works on desktop but will not
enter XR on-device, confirm that the dev server URL is secure and headset
reachable. When XR still won't enter, metavr log from the headset often names
the failing check (HTTPS, WebXR flags, GPU process).
AI-Assisted Development Loop
IWSDK is a strong fit for coding agents because the development loop is already web-native: edit source, reload the page, observe behavior, and iterate.
Recommended loop:
- Verify API and platform details against current docs before coding
- Edit the code and run the Vite dev server
- Reload in Quest Browser or the IWSDK emulator/dev browser
- Observe logs, screenshots, and runtime state
- Iterate until runtime behavior matches the request
If you are pairing a native Meta VR frontend with a host-side coding agent, keep the frontend thin. Let the host machine own the repository, file edits, dependency installs, tests, build steps, and metavr tool calls.
Project Structure
A typical IWSDK project looks like this:
my-project/
src/
index.ts # Entry point: World.create, scene setup, XR controls
systems/ # Optional ECS systems
movement.ts
components/ # Optional ECS components
velocity.ts
public/
models/ # GLTF / GLB assets
textures/ # Textures and images
audio/ # Audio assets
ui/ # Compiled UIKitML JSON output
ui/
welcome.uikitml # Source UIKitML files
vite.config.ts
package.json
tsconfig.jsonKey Patterns
Creating A Component
import { Types, createComponent } from '@iwsdk/core';
export const Velocity = createComponent(
'Velocity',
{
x: { type: Types.Float32, default: 0 },
y: { type: Types.Float32, default: 0 },
z: { type: Types.Float32, default: 0 },
},
'Linear velocity in meters per second',
);Writing A System
import { createSystem } from '@iwsdk/core';
import { Velocity } from './components/velocity';
export class MovementSystem extends createSystem({
moving: { required: [Velocity] },
}) {
update(delta: number) {
this.queries.moving.entities.forEach((entity) => {
if (!entity.object3D) {
return;
}
entity.object3D.position.x += Velocity.data.x[entity.index] * delta;
entity.object3D.position.y += Velocity.data.y[entity.index] * delta;
entity.object3D.position.z += Velocity.data.z[entity.index] * delta;
});
}
}Spawning An Entity With A Three.js Mesh
import * as THREE from 'three';
import { Velocity } from './components/velocity';
function spawnCube(world) {
const mesh = new THREE.Mesh(
new THREE.BoxGeometry(0.5, 0.5, 0.5),
new THREE.MeshStandardMaterial({ color: 0x00aaff }),
);
const entity = world.createTransformEntity(mesh);
entity.object3D!.position.set(0, 1.5, -2);
entity.addComponent(Velocity, { x: 0, y: 0, z: 0 });
}Creating The World And Launching XR
import {
ReferenceSpaceType,
SessionMode,
World,
} from '@iwsdk/core';
const container = document.getElementById('scene-container') as HTMLDivElement;
const world = await World.create(container, {
xr: {
sessionMode: SessionMode.ImmersiveVR,
referenceSpace: ReferenceSpaceType.LocalFloor,
offer: 'none',
},
});
world.registerSystem(MovementSystem);
world.launchXR();World.create(...) already wires the renderer, core systems, asset loading, and
render loop. Do not teach agents to use new World(), createWorld(),
world.start(), or the older enterXR(...) path.
Gotchas
These are common pitfalls that cause unexpected failures or wasted debugging time when building IWSDK WebXR apps for Meta VR.
- HTTPS required for WebXR on device -- The WebXR Device API only works over HTTPS (or localhost). If you serve your dev build over plain HTTP and open it on the Quest Browser, the "Enter VR" button will not appear. Use
ngrok, a self-signed cert, or the--httpsflag in Vite to tunnel HTTPS during development. - Quest Browser is Chromium, not desktop Chrome -- Feature support differs.
SharedArrayBuffer, certain WebGL2 extensions, andOffscreenCanvasmay behave differently or be unavailable. Always test on actual Quest Browser, not just desktop Chrome with the IWER emulator. - 72 Hz default, not 90 Hz -- Quest Browser defaults to 72 Hz for WebXR sessions. You must explicitly request a higher framerate via
xrSession.updateTargetFrameRate(90)after session start. Forgetting this is the most common reason a WebXR app feels "sluggish" compared to a native build. - Draw call budget is much lower than native -- Aim for under 50-80 draw calls on Quest 2 and under 100-120 on Quest 3. JavaScript overhead per draw call is higher than native. Batch geometries, use instanced rendering, and merge materials aggressively.
- Texture memory limits -- Quest Browser has a lower GPU memory ceiling than native apps. Large uncompressed textures (4K+) can cause silent OOM crashes or visual corruption. Use compressed textures (KTX2 with Basis Universal or ETC2) and keep total texture memory under 256 MB.
requestAnimationFramevs. XR frame loop -- Once an XR session starts, you must usexrSession.requestAnimationFrame, notwindow.requestAnimationFrame. Using the wrong one causes the scene to freeze or render at the wrong rate.- Hand tracking pinch threshold -- The WebXR hand tracking API reports pinch as a continuous value (0.0-1.0). Many developers threshold at 0.5, but on Meta VR devices the reliable activation threshold is closer to 0.7-0.8. Lower thresholds cause false positives, especially during pointing gestures.
- HMR can break XR sessions -- Hot module replacement sometimes fails to properly tear down and recreate the WebXR session. If your scene goes black after an HMR update, do a full page reload rather than debugging phantom rendering issues.
- CORS blocks asset loading in VR -- When loading GLTF/GLB models or textures from a CDN, ensure proper CORS headers are set. Quest Browser enforces CORS strictly. Missing headers cause silent asset load failures that are hard to diagnose without DevTools connected.
- Lighthouse cannot produce LCP-dependent results for a canvas-only WebXR page --
<canvas>is never an LCP candidate, so Lighthouse'slargest-contentful-paint,interactive/TTI, andtotal-blocking-timeaudits abort withLanternError: NO_LCP. Compute TTI yourself from CDP long-task and network data, and launch headless Chromium with a hardware ANGLE backend (--use-angle=d3d11on Windows,--use-angle=glon Linux) or it silently profiles the SwiftShader software rasterizer at 10x the real frame time. See Desktop Load Profiling.
Development Tips
- Use
World.create(...),world.launchXR(), andworld.exitXR()as the runtime control surface - Keep HTTPS enabled for Quest Browser development because WebXR is gated on secure contexts
- Start with
@iwsdk/vite-plugin-devand Quest Browser validation, then layer in emulator/dev browser workflows for faster iteration - Search and fetch Meta docs before coding against APIs you have not verified recently
- Test on a real Meta VR device early and often because desktop emulation does not capture all input, comfort, and performance issues
- Keep draw calls low (roughly under 100) for smooth performance on Meta VR hardware
References
Skill References
- AI-Assisted Development -- closed-loop edit/reload/observe workflows, Quest Browser testing, host-agent architecture
- ECS Architecture -- Components, entities, systems, queries, and the World
- Spatial UI -- UIKitML, PanelUI, PanelDocument, layout, and UI best practices
- Input Handling -- Controllers, hands, pointers, grabbing, and locomotion
- Performance Tips -- Frame rate targets, optimization techniques, and profiling tools
- Desktop Load Profiling -- Headless Playwright/Lighthouse, computing TTI for a canvas-only page, and hardware GPU flags
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

