threejs-audio — Claude Code skill: what it does, how to install
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.
MIT 583 installs ★ 26 updated 2026-09-10
npx skills add cesartevisual/threejs-skills --skill threejs-audio -a claude-codeWhat threejs-audio does
The skill guides an agent through configuring spatial audio in Three.js projects. It ensures audio starts from a direct user interaction to avoid autoplay rejection, while attaching the listener to the active viewpoint without duplicate output paths.
Positional sources receive explicit distance rolloff and directional cones matching scene units. A positional source does not automatically simulate wall occlusion, so physical obstacles require separate logic. The skill also requires asynchronous loading, audio buffer reuse, and throttling collision sounds instead of triggering them every frame.
Lifecycle hooks coordinate playback with visibility changes, route changes, and XR session transitions. When cleaning up components, the skill requires disconnecting owned sources and releasing listeners without closing a shared AudioContext.
What it helps with
- attach an
AudioListenerto the active camera without duplicate listeners - configure directional cones and distance rolloff for 3D scene objects
- handle browser autoplay rejection on initial scene load
- clean up positional audio sources and listeners during component unmount
Example prompts for the agent
- Add positional footstep audio to the character model in Three.js
- Handle user interaction to resume audio and provide a mute button in the UI
- Coordinate audio pause and resume when the browser tab visibility changes
How to install threejs-audio
1Skills CLI (Vercel)
npx skills add cesartevisual/threejs-skills --skill threejs-audio -a claude-code2Manually: put the files in place
~/.claude/skills/threejs-audio/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/threejs-audio/
1Skills CLI (Vercel)
npx skills add cesartevisual/threejs-skills --skill threejs-audio -a codex2Manually: put the files in place
.agents/skills/threejs-audio/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add cesartevisual/threejs-skills --skill threejs-audio -a cursor2Manually: put the files in place
.cursor/skills/threejs-audio/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install cesartevisual/threejs-skills skills/threejs-audio2Manually: put the files in place
.github/skills/threejs-audio/SKILL.md1Skills CLI (Vercel)
npx skills add cesartevisual/threejs-skills --skill threejs-audio -a gemini-cli2Platform CLI
gemini skills install https://github.com/cesartevisual/threejs-skills --path skills/threejs-audioManually: put the files in place
.devin/skills/threejs-audio/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add cesartevisual/threejs-skills --skill threejs-audio -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-audio
How to install threejs-audio in Claude Code?
Run npx skills add cesartevisual/threejs-skills --skill threejs-audio -a claude-code in your project terminal.
What does threejs-audio do?
It instructs the agent on implementing Three.js spatial audio, managing listeners, avoiding autoplay blocks, and handling component lifecycle events.
Does threejs-audio simulate wall occlusion?
No, Three.js positional audio does not simulate wall occlusion automatically, meaning obstacles require custom attenuation handling.
Source text
SKILL.md · MIT
--- name: threejs-audio description: "Add Three.js spatial audio, user-controlled playback, listener movement, and audio lifecycle handling." --- # Spatial Audio 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. Establish whether audio communicates information or provides optional ambience. Expose mute/volume and any required textual equivalent in HTML. Start or resume audio from a user interaction and handle autoplay rejection without breaking the scene. Attach the listener to the active viewpoint and handle camera changes without duplicating listeners or output paths. For positional sources, choose distance/rolloff and directional cones in the scene's units. A positional source does not automatically simulate wall occlusion. Load and decode asynchronously with explicit failure and stale-result handling. Bound concurrent sources and reuse buffers where appropriate. Avoid replaying a sound on every frame of a collision; trigger from meaningful state transitions. Coordinate pause, visibility changes, route transitions, and XR session transitions with playback. Stop/disconnect owned sources and release listeners. Do not close an AudioContext shared with another part of the application. Verify blocked autoplay, first interaction, mute persistence, moving-camera attenuation, rapid retriggers, and repeated mount/unmount. Measure perceived volume on actual output devices when spatial audio matters. ## API reference Consult the [official documentation](https://threejs.org/docs/pages/PositionalAudio.html) 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