threejs-physics — Claude Code skill: what it does, how to install
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.
MIT 611 installs ★ 26 updated 2026-09-10
npx skills add cesartevisual/threejs-skills --skill threejs-physics -a claude-codeWhat threejs-physics does
The skill directs the agent when connecting physics engines to Three.js scenes. It enforces WASM runtime initialization before world creation, sets gravity parameters, and establishes clear transform authority between graphics and simulation.
Simulation advances via a fixed timestep with a bounded accumulator. Kinematic bodies must move through engine APIs rather than direct writes to visual render transforms. Primitive and compound colliders take precedence over dynamic triangle meshes to keep bodies stable.
Teardown instructions require explicitly releasing world objects and listeners. Continuous collision detection applies selectively to fast-moving objects after profiling the performance impact.
What it helps with
- synchronize physics transforms with Three.js meshes
- set up a fixed timestep loop with a bounded accumulator
- configure primitive and compound colliders for 3D assets
- clean up physics world bodies and event listeners on teardown
Example prompts for the agent
- Integrate Rapier physics into this Three.js animation loop
- Set up rigid bodies and colliders with fixed timestep interpolation
- Move this kinematic platform using the physics engine API
How to install threejs-physics
1Skills CLI (Vercel)
npx skills add cesartevisual/threejs-skills --skill threejs-physics -a claude-code2Manually: put the files in place
~/.claude/skills/threejs-physics/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/threejs-physics/
1Skills CLI (Vercel)
npx skills add cesartevisual/threejs-skills --skill threejs-physics -a codex2Manually: put the files in place
.agents/skills/threejs-physics/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add cesartevisual/threejs-skills --skill threejs-physics -a cursor2Manually: put the files in place
.cursor/skills/threejs-physics/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install cesartevisual/threejs-skills skills/threejs-physics2Manually: put the files in place
.github/skills/threejs-physics/SKILL.md1Skills CLI (Vercel)
npx skills add cesartevisual/threejs-skills --skill threejs-physics -a gemini-cli2Platform CLI
gemini skills install https://github.com/cesartevisual/threejs-skills --path skills/threejs-physicsManually: put the files in place
.devin/skills/threejs-physics/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add cesartevisual/threejs-skills --skill threejs-physics -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-physics
How to install threejs-physics in Claude Code?
Run npx skills add cesartevisual/threejs-skills --skill threejs-physics -a claude-code. Alternatively, place the instruction file directly into ~/.claude/skills/threejs-physics/SKILL.md.
What does threejs-physics do?
It provides architectural rules for integrating physics runtimes like Rapier with Three.js, covering timestep loops, colliders, and mesh transform syncing.
Why does the skill restrict dynamic triangle meshes?
Visual meshes rarely make stable dynamic colliders, so the skill prefers primitives or compound shapes to prevent simulation glitches and performance issues.
Source text
SKILL.md · MIT
--- name: threejs-physics description: "Integrate Rapier or another physics engine with Three.js, including colliders, fixed timesteps, and render synchronization." --- # Physics Integration 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. Inspect the existing engine and its version; preserve it unless the requested behavior requires a change. Initialize its WASM/runtime before creating the world. Establish units, gravity direction, collider scale, and authority over each transform. Advance simulation with a fixed timestep and a bounded accumulator. Cap substeps and explicitly choose whether to discard excess elapsed time after a stall. Interpolate previous/current physics poses for rendering when needed. Avoid stepping the simulation from multiple loops. Prefer primitive or compound colliders where they reproduce the interaction adequately. Check engine restrictions for dynamic triangle meshes, scaling, and convex hulls. A visual mesh is not automatically a stable collider. Use continuous collision detection selectively for fast bodies after measuring its cost. Move kinematic bodies through engine APIs; do not write render transforms and expect physics to follow. Apply forces/impulses at the intended cadence, and handle sleeping and collision event lifetime. Keep event processing from triggering duplicate UI actions. Release world objects and listeners on teardown. Test collisions at the highest expected velocity, resting stability, low frame rates, tab resume, scale changes, and repeated resets. Do not promise deterministic cross-platform replay without testing the selected engine and configuration. ## API reference Consult the [official documentation](https://rapier.rs/docs/user_guides/javascript/integration_parameters/) 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