Skip to main content
skill CX Codex

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

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

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

2Manually: put the files in place

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

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

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

Similar skills

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

From the same set24

The whole set →
threejs-particles Claude Code skill for building Three.js particle systems, point clouds, and GPU simulations. CX Codex +1 648installs threejs-accessibility The threejs-accessibility Claude Code skill makes Three.js interactions usable with keyboards and assistive technology. It applies when adding accessibility to 3D scenes and controls. CX Codex +1 644installs 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-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

Project sponsors

Companies that keep this analytics open