r3f-physics — Claude Code skill for React Three Fiber
Guides an AI coding agent through adding Rapier physics to React Three Fiber. Use it for collision-based movement, sensors, forces, and joints.
npx skills add EnzeD/r3f-skills --skill r3f-physics -a claude-codeWhat r3f-physics does
The skill covers how to connect Rapier simulation to a React Three Fiber scene. It explains dynamic and fixed bodies, collider choices, impulses and forces, sensor events, joints, and character controllers. It also addresses simulation timing, sleeping bodies, and continuous collision detection.
Check your Fiber, React, and Rapier versions first: Rapier 2 targets Fiber 9 and React 19, while older projects need a compatible package line. Physics loads WASM asynchronously, so examples that use it should be wrapped in Suspense. A simulated mesh should not have its position animated with useFrame; the physics world can overwrite that change.
What it helps with
- Set up collisions between bodies and surfaces
- Choose colliders for moving objects and static scenery
- Apply forces at simulation-aligned points
- Handle sensor entry and exit events
- Connect bodies with a joint constraint
Example prompts for the agent
- Add a falling React Three Fiber body that gets an upward impulse when clicked.
- Show me how to configure colliders for moving bodies and a fixed floor.
- Set up Rapier sensor events for objects entering and leaving the sensor.
How to install r3f-physics
1Skills CLI (Vercel)
npx skills add EnzeD/r3f-skills --skill r3f-physics -a claude-code2Manually: put the files in place
~/.claude/skills/r3f-physics/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/r3f-physics/
1Skills CLI (Vercel)
npx skills add EnzeD/r3f-skills --skill r3f-physics -a codex2Manually: put the files in place
.agents/skills/r3f-physics/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add EnzeD/r3f-skills --skill r3f-physics -a cursor2Manually: put the files in place
.cursor/skills/r3f-physics/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install EnzeD/r3f-skills r3f-physics2Manually: put the files in place
.github/skills/r3f-physics/SKILL.md1Skills CLI (Vercel)
npx skills add EnzeD/r3f-skills --skill r3f-physics -a gemini-cli2Platform CLI
gemini skills install https://github.com/EnzeD/r3f-skills --path skills/r3f-physicsManually: put the files in place
.devin/skills/r3f-physics/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add EnzeD/r3f-skills --skill r3f-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 r3f-physics
How do I install r3f-physics in Claude Code?
Run npx skills add EnzeD/r3f-skills --skill r3f-physics -a claude-code. The skill file is installed at ~/.claude/skills/r3f-physics/SKILL.md.
What does r3f-physics do?
It guides an AI agent in adding Rapier physics to React Three Fiber, including bodies, colliders, forces, sensors, and joints.
Which versions does Rapier 2 target?
The skill pairs Rapier 2 with Fiber 9 and React 19. Older projects need a package line compatible with their versions.