Skip to main content
skill CX Codex

threejs-xr — Claude Code skill for Three.js XR

The threejs-xr Claude Code skill guides VR and AR work in Three.js projects. It covers XR input, reference spaces, hit testing, and session handling.

MIT 577 installs ★ 26 updated 2026-09-10

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add cesartevisual/threejs-skills --skill threejs-xr -a claude-code
Open on GitHub

What threejs-xr does

The skill helps implement XR sessions in Three.js while following the project’s existing structure and installed library versions. Its guidance covers VR or AR entry, support checks, input, reference spaces, and handling a reset to the origin.

It also covers controller and hand events, AR hit testing, session exit, and restoring desktop controls. Entering XR requires a user gesture, and the browser must run in a secure context. Emulation can exercise flows, but headset tracking, placement, input, and comfort need testing on the target hardware.

What it helps with

  • add VR or AR session entry to a Three.js project
  • handle controller and hand input in XR
  • place AR content through hit testing
  • restore desktop controls after an XR session

Example prompts for the agent

  • Add VR session entry and exit handling to this Three.js project.
  • Set up XR input for controllers and hands, including handedness.
  • Place the AR object through hit testing and confirm its position.

How to install threejs-xr

1Skills CLI (Vercel)

npx skills add cesartevisual/threejs-skills --skill threejs-xr -a claude-code

2Manually: put the files in place

~/.claude/skills/threejs-xr/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/threejs-xr/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about threejs-xr

How do I install threejs-xr in Claude Code?

Run npx skills add cesartevisual/threejs-skills --skill threejs-xr -a claude-code. The skill file is at ~/.claude/skills/threejs-xr/SKILL.md.

What does threejs-xr do?

It guides implementation of Three.js VR and AR sessions, XR input, reference spaces, and session shutdown.

Does testing threejs-xr require a headset?

The skill calls for testing on the target hardware to check tracking, input, object placement, and comfort. Emulation can exercise flows but cannot establish headset usability.

Source text

SKILL.md · MIT
---
name: threejs-xr
description: "Implement Three.js VR or AR sessions, XR input, reference spaces, hit testing, and session lifecycle."
---

# WebXR

Use the project's installed versions and existing architecture. These instructions supplement the user's task; they do not authorize unrelated changes or external actions.

Confirm requested VR/AR mode, target hardware/browser, secure context, and current installed XR APIs. Feature-detect session support and request sessions from a user gesture. Distinguish required and optional session features so an optional capability does not unnecessarily block entry.

Let the XR-compatible renderer loop own session frames and poses. Use XR cameras/reference spaces rather than overwriting their pose with ordinary orbit controls. Establish meters, world origin, and floor assumptions; handle reference-space reset.

Separate target-ray input from grip/controller models. Define select, squeeze, handedness, disconnect, and hand-tracking behavior as needed. For AR hit testing, handle missing hits and choose intentional placement confirmation rather than continuously teleporting content.

Provide entry, exit, unsupported, denied, and interrupted states. Restore desktop controls and scene state on session end. Keep asset and shadow/effect costs within the headset's frame requirements; test comfort, text legibility, and locomotion choices.

Release session-owned listeners and transient resources. Test on actual requested hardware for tracking, input, placement, and comfort. Emulation can exercise flows but is not evidence of headset usability. Keep an ordinary browser view available when it serves the product.

## API reference

Consult the [official documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API) for exact signatures and revision-specific behavior. If documentation access is unavailable, inspect installed types/source and state any remaining uncertainty.

© cesartevisual · MIT · cesartevisual/threejs-skills

Similar skills

All skills for Game dev and 3D: Unity, Unreal, Godot, Blender →

From the same set24

The whole set →
threejs-geometry This Claude Code skill creates and refines Three.js geometry. It activates for work on BufferGeometry, procedural meshes, and instanced objects. CX Codex +1 638installs threejs-product-viewer This Claude Code skill guides the creation of interactive Three.js product viewers. It comes into play when a project needs material choices, camera presets, or model hotspots. CX Codex +1 621installs threejs-physics threejs-physics — a skill for Claude Code guides the integration of Three.js with Rapier or other physics engines. It handles colliders, fixed simulation timesteps, and render transform synchronization. CX Codex +1 611installs threejs-html threejs-html — a skill for Claude Code that integrates Three.js canvases into responsive HTML and Next.js apps. It sets up overlays, scroll containers, and multi-view layouts safely. CX Codex +1 597installs threejs-spatial-data threejs-spatial-data — a skill for Claude Code helps integrate BIM, GIS, and CAD models into Three.js scenes. Manages large coordinates, clipping planes, and measurement tools without losing GPU floating-point precision. CX Codex +1 587installs threejs-webgpu The threejs-webgpu Claude Code skill helps build or migrate Three.js projects using WebGPURenderer, TSL node materials, and GPU compute. It applies to tasks where renderer backends and device support need explicit testing. CX Codex +1 585installs threejs-audio threejs-audio — a skill for Claude Code guides the setup of Three.js spatial audio. It manages listener attachment, browser autoplay restrictions, and audio lifecycle during scene transitions. CX Codex +1 583installs threejs-deployment Claude Code skill threejs-deployment prepares and verifies Three.js web builds, asset hosting, decoder paths, and caching. CX Codex +1 582installs

Project sponsors

Companies that keep this analytics open