Skip to main content
skill CX Codex

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

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

What 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 AudioListener to 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-code

2Manually: put the files in place

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

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

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

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-deployment Claude Code skill threejs-deployment prepares and verifies Three.js web builds, asset hosting, decoder paths, and caching. CX Codex +1 582installs threejs-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. CX Codex +1 577installs

Project sponsors

Companies that keep this analytics open