AR / VR / XR (Reality Tech)
Use this skill when the user is building or debugging:
- AR (camera passthrough overlays)
- VR (fully immersive)
- XR/MR (mixed reality, spatial computing)
- WebXR/OpenXR, Quest/Vision Pro/PCVR
- Unity/Unreal/Web (Three.js, Babylon.js, A-Frame)
First Questions (Only Ask What Blocks Progress)
Ask up to 3:
- Target platform: Web (WebXR) or native (OpenXR via Unity/Unreal)?
- Target device(s): Quest, Vision Pro, PCVR (SteamVR), mobile AR (ARKit/ARCore), other?
- Interaction + locomotion: hands, controllers, gaze, roomscale, smooth locomotion, teleport?
If the user does not know yet, default to:
- WebXR + Three.js for a fast prototype
- Teleport locomotion + snap-turn for comfort
Workflow
Define the experience mode and constraints.
- AR vs VR vs MR
- Required capabilities: 3DoF/6DoF, plane detection, meshing, hand tracking, anchors
Establish world scale and coordinate conventions early.
- 1 unit = 1 meter (recommended)
- Choose a single "up" axis and stick to it end-to-end
Build a vertical slice (minimum shippable loop).
- Tracking + session start
- One interaction (grab/select)
- One UI surface (menu, tooltip, reticle)
Budget performance from day 1.
- Stable frame time beats peak quality
- Reduce draw calls, overdraw, shader cost, and texture bandwidth
Enforce comfort defaults.
- Avoid sustained acceleration
- Prefer teleport and snap-turn
- Keep UI readable and at comfortable depth
Treat privacy and sensors as first-class.
- Camera/mic permissions, spatial maps, room meshes, biometrics
- Minimize collection, document clearly, store locally when possible
WebXR Quickstart (Three.js)
import * as THREE from 'three';
import { VRButton } from 'three/examples/jsm/webxr/VRButton.js';
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.01, 100);
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.xr.enabled = true;
document.body.appendChild(renderer.domElement);
document.body.appendChild(VRButton.createButton(renderer));
const light = new THREE.HemisphereLight(0xffffff, 0x444444, 1.0);
scene.add(light);
const floor = new THREE.Mesh(
new THREE.PlaneGeometry(10, 10),
new THREE.MeshStandardMaterial({ color: 0x222222 })
);
floor.rotation.x = -Math.PI / 2;
scene.add(floor);
renderer.setAnimationLoop(() => {
renderer.render(scene, camera);
});
Notes:
- WebXR requires HTTPS (or localhost).
- To target AR: request an
immersive-ar session and handle hit-test/anchors (framework-specific).
OpenXR Notes (Unity/Unreal)
- Unity: prefer XR Plugin Management + OpenXR plugin; use XR Interaction Toolkit for baseline interaction.
- Unreal: use the OpenXR plugin; validate input mappings per device.
When debugging native XR:
- Confirm runtime: OpenXR runtime (SteamVR, Oculus, WMR) and version
- Validate action bindings and controller profiles
- Verify frame timing on-device, not just in editor
Comfort Checklist
- Keep horizon stable; avoid camera bob unless user opts in
- Use snap-turn (30-45 deg) by default
- Teleport is the safest default locomotion
- Avoid "forced" motion tied to animations
- UI: large text, high contrast, avoid depth conflict (z-fighting)
Performance Checklist
- Measure on target device (Quest/Vision Pro/PCVR), not only desktop
- Reduce: draw calls, transparent layers, dynamic shadows, post-processing
- Prefer baked lighting where possible
- Stream assets with progressive quality (LOD), avoid blocking loads
Device Profile: Varjo XR-4
If the target device is Varjo XR-4 Series, use varjo-xr-4 for runtime/tracking/refresh-rate specifics.
Interleave With New Skills (plurigrid/asi PRs #61-64)
Use these as building blocks:
visual-design: spatial UI readability, typography, contrast, layout
svelte-components / sveltekit-structure / sveltekit-data-flow: WebXR shells, menus, settings, content pipelines
browser-navigation: XR web debugging and reproducible repro steps
bandwidth-benchmark: asset streaming, scene/texture delivery constraints
threat-model-generation + security-review: sensors, permissions, privacy, on-device data
jepsen-testing: correctness thinking for multi-user/shared-state XR backends
Jepsen For Shared-State XR
Use jepsen-testing when your experience includes a backend claim about correctness under faults (multiplayer rooms, shared anchors, inventories, authoritative physics, replicated scene graphs).
XR-specific intake:
- Define the surface: websocket RPC, REST/gRPC, realtime relay, or a persistence API.
- Define acknowledged for XR ops (e.g., "spawn confirmed", "anchor committed", "inventory write ok").
- Pick a checkable property per primitive:
- Room membership/presence: no phantom joins, monotonic session state.
- Object transforms: no lost acknowledged updates; no impossible readbacks.
- Anchors/placements: placement does not disappear after an ok, unless explicitly deleted.
Faults worth testing:
- Partitions between clients and relay/region.
- Process kill/restart of relay, authoritative host, or storage layer.
- Clock skew if you use timestamps for conflict resolution.
Minimization tip:
- Reduce to 1-2 rooms, 2-3 objects, and a single nemesis schedule until the violation is explainable.
Example Prompts This Skill Should Handle
- "Build a WebXR VR scene with teleport and grab interactions"
- "Port this Unity project to OpenXR and fix controller bindings"
- "Optimize this Quest app to hit stable 72/90 fps"
- "Design a spatial settings UI that stays readable in passthrough"
- "Threat-model an AR app that uses camera + spatial mapping"
steamvr-tracking for Lighthouse/base station setup- xr-color-management for sRGB/P3/Rec.2020 pipeline issues
1---2name: ar-vr-xr3description: Reality tech (AR/VR/XR). Build and ship spatial experiences (WebXR/OpenXR/Unity/Unreal) with strong defaults for interaction, performance, comfort, privacy, and deployment.4license: Apache-2.05---67# AR / VR / XR (Reality Tech)89Use this skill when the user is building or debugging:10- AR (camera passthrough overlays)11- VR (fully immersive)12- XR/MR (mixed reality, spatial computing)13- WebXR/OpenXR, Quest/Vision Pro/PCVR14- Unity/Unreal/Web (Three.js, Babylon.js, A-Frame)1516## First Questions (Only Ask What Blocks Progress)1718Ask up to 3:191. Target platform: Web (WebXR) or native (OpenXR via Unity/Unreal)?202. Target device(s): Quest, Vision Pro, PCVR (SteamVR), mobile AR (ARKit/ARCore), other?213. Interaction + locomotion: hands, controllers, gaze, roomscale, smooth locomotion, teleport?2223If the user does not know yet, default to:24- WebXR + Three.js for a fast prototype25- Teleport locomotion + snap-turn for comfort2627## Workflow28291. Define the experience mode and constraints.30 - AR vs VR vs MR31 - Required capabilities: 3DoF/6DoF, plane detection, meshing, hand tracking, anchors32332. Establish world scale and coordinate conventions early.34 - 1 unit = 1 meter (recommended)35 - Choose a single "up" axis and stick to it end-to-end36373. Build a vertical slice (minimum shippable loop).38 - Tracking + session start39 - One interaction (grab/select)40 - One UI surface (menu, tooltip, reticle)41424. Budget performance from day 1.43 - Stable frame time beats peak quality44 - Reduce draw calls, overdraw, shader cost, and texture bandwidth45465. Enforce comfort defaults.47 - Avoid sustained acceleration48 - Prefer teleport and snap-turn49 - Keep UI readable and at comfortable depth50516. Treat privacy and sensors as first-class.52 - Camera/mic permissions, spatial maps, room meshes, biometrics53 - Minimize collection, document clearly, store locally when possible5455## WebXR Quickstart (Three.js)5657```js58import * as THREE from 'three';59import { VRButton } from 'three/examples/jsm/webxr/VRButton.js';6061const scene = new THREE.Scene();62const camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.01, 100);63const renderer = new THREE.WebGLRenderer({ antialias: true });64renderer.setSize(window.innerWidth, window.innerHeight);65renderer.xr.enabled = true;66document.body.appendChild(renderer.domElement);67document.body.appendChild(VRButton.createButton(renderer));6869const light = new THREE.HemisphereLight(0xffffff, 0x444444, 1.0);70scene.add(light);7172const floor = new THREE.Mesh(73 new THREE.PlaneGeometry(10, 10),74 new THREE.MeshStandardMaterial({ color: 0x222222 })75);76floor.rotation.x = -Math.PI / 2;77scene.add(floor);7879renderer.setAnimationLoop(() => {80 renderer.render(scene, camera);81});82```8384Notes:85- WebXR requires HTTPS (or localhost).86- To target AR: request an `immersive-ar` session and handle hit-test/anchors (framework-specific).8788## OpenXR Notes (Unity/Unreal)8990- Unity: prefer XR Plugin Management + OpenXR plugin; use XR Interaction Toolkit for baseline interaction.91- Unreal: use the OpenXR plugin; validate input mappings per device.9293When debugging native XR:94- Confirm runtime: OpenXR runtime (SteamVR, Oculus, WMR) and version95- Validate action bindings and controller profiles96- Verify frame timing on-device, not just in editor9798## Comfort Checklist99100- Keep horizon stable; avoid camera bob unless user opts in101- Use snap-turn (30-45 deg) by default102- Teleport is the safest default locomotion103- Avoid "forced" motion tied to animations104- UI: large text, high contrast, avoid depth conflict (z-fighting)105106## Performance Checklist107108- Measure on target device (Quest/Vision Pro/PCVR), not only desktop109- Reduce: draw calls, transparent layers, dynamic shadows, post-processing110- Prefer baked lighting where possible111- Stream assets with progressive quality (LOD), avoid blocking loads112113114## Device Profile: Varjo XR-4115116If the target device is Varjo XR-4 Series, use `varjo-xr-4` for runtime/tracking/refresh-rate specifics.117118## Interleave With New Skills (plurigrid/asi PRs #61-64)119120Use these as building blocks:121- `visual-design`: spatial UI readability, typography, contrast, layout122- `svelte-components` / `sveltekit-structure` / `sveltekit-data-flow`: WebXR shells, menus, settings, content pipelines123- `browser-navigation`: XR web debugging and reproducible repro steps124- `bandwidth-benchmark`: asset streaming, scene/texture delivery constraints125- `threat-model-generation` + `security-review`: sensors, permissions, privacy, on-device data126- `jepsen-testing`: correctness thinking for multi-user/shared-state XR backends127128129## Jepsen For Shared-State XR130131Use `jepsen-testing` when your experience includes a backend claim about correctness under faults (multiplayer rooms, shared anchors, inventories, authoritative physics, replicated scene graphs).132133XR-specific intake:134- Define the surface: websocket RPC, REST/gRPC, realtime relay, or a persistence API.135- Define acknowledged for XR ops (e.g., "spawn confirmed", "anchor committed", "inventory write ok").136- Pick a checkable property per primitive:137- Room membership/presence: no phantom joins, monotonic session state.138- Object transforms: no lost acknowledged updates; no impossible readbacks.139- Anchors/placements: placement does not disappear after an ok, unless explicitly deleted.140141Faults worth testing:142- Partitions between clients and relay/region.143- Process kill/restart of relay, authoritative host, or storage layer.144- Clock skew if you use timestamps for conflict resolution.145146Minimization tip:147- Reduce to 1-2 rooms, 2-3 objects, and a single nemesis schedule until the violation is explainable.148149## Example Prompts This Skill Should Handle150151- "Build a WebXR VR scene with teleport and grab interactions"152- "Port this Unity project to OpenXR and fix controller bindings"153- "Optimize this Quest app to hit stable 72/90 fps"154- "Design a spatial settings UI that stays readable in passthrough"155- "Threat-model an AR app that uses camera + spatial mapping"156- `steamvr-tracking` for Lighthouse/base station setup- `xr-color-management` for sRGB/P3/Rec.2020 pipeline issues