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
npx skills add cesartevisual/threejs-skills --skill threejs-xr -a claude-codeWhat 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-code2Manually: put the files in place
~/.claude/skills/threejs-xr/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/threejs-xr/
1Skills CLI (Vercel)
npx skills add cesartevisual/threejs-skills --skill threejs-xr -a codex2Manually: put the files in place
.agents/skills/threejs-xr/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add cesartevisual/threejs-skills --skill threejs-xr -a cursor2Manually: put the files in place
.cursor/skills/threejs-xr/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install cesartevisual/threejs-skills skills/threejs-xr2Manually: put the files in place
.github/skills/threejs-xr/SKILL.md1Skills CLI (Vercel)
npx skills add cesartevisual/threejs-skills --skill threejs-xr -a gemini-cli2Platform CLI
gemini skills install https://github.com/cesartevisual/threejs-skills --path skills/threejs-xrManually: put the files in place
.devin/skills/threejs-xr/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add cesartevisual/threejs-skills --skill threejs-xr -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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