r3f-fundamentals — Claude Code skill: React Three Fiber scene setup
Skill that teaches the agent to build React Three Fiber scenes: Canvas, typed JSX, render-loop hooks, and resource ownership. For scene architecture, not detailed materials.
npx skills add EnzeD/r3f-skills --skill r3f-fundamentals -a claude-codeWhat r3f-fundamentals does
The agent learns how to assemble R3F scenes: create a Canvas component, type props with ThreeElements['mesh'] and refs as useRef<Mesh>(null), animate via useFrame by mutating refs instead of state. The skill covers type boundaries (hooks only inside Canvas, DOM elements outside), object ownership (automatic dispose on unmount, <primitive> leaves the passed object untouched), and render-loop modes (frameloop="demand" for static scenes with manual invalidate() calls).
Fiber and Three.js versions are read from the project's package.json — the skill does not force upgrades. The default WebGL renderer uses sRGB output and ACES filmic tone mapping; flat and linear flags alter the color space but do not generically fix washed-out textures. On Three.js r182+, use shadows="percentage" for shadows.
For projects on Fiber 8 + React 18 or Fiber 10 alpha, the APIs differ — the skill checks the lockfile before picking syntax.
What it helps with
- build a typed R3F scene with Canvas, lights, and a rotating mesh
- animate an object via useFrame without recreating it every frame
- configure frameloop demand mode and invalidate for a static scene
- type mesh props and refs with ThreeElements and useRef
- embed a DOM element inside a Three.js scene using Drei Html
Example prompts for the agent
- Create an R3F scene with a rotating cube, ambientLight, and directionalLight
- Add a component with useFrame that moves the camera along a sine wave
- Switch render to demand and call invalidate() on mesh click
How to install r3f-fundamentals
1Skills CLI (Vercel)
npx skills add EnzeD/r3f-skills --skill r3f-fundamentals -a claude-code2Manually: put the files in place
~/.claude/skills/r3f-fundamentals/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/r3f-fundamentals/
1Skills CLI (Vercel)
npx skills add EnzeD/r3f-skills --skill r3f-fundamentals -a codex2Manually: put the files in place
.agents/skills/r3f-fundamentals/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add EnzeD/r3f-skills --skill r3f-fundamentals -a cursor2Manually: put the files in place
.cursor/skills/r3f-fundamentals/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install EnzeD/r3f-skills r3f-fundamentals2Manually: put the files in place
.github/skills/r3f-fundamentals/SKILL.md1Skills CLI (Vercel)
npx skills add EnzeD/r3f-skills --skill r3f-fundamentals -a gemini-cli2Platform CLI
gemini skills install https://github.com/EnzeD/r3f-skills --path skills/r3f-fundamentalsManually: put the files in place
.devin/skills/r3f-fundamentals/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add EnzeD/r3f-skills --skill r3f-fundamentals -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-fundamentals
How to install r3f-fundamentals in Claude Code?
Run npx skills add EnzeD/r3f-skills --skill r3f-fundamentals -a claude-code; the skill will be placed in ~/.claude/skills/r3f-fundamentals/SKILL.md.
What does r3f-fundamentals do?
Teaches the agent to build React Three Fiber scenes: create Canvas, type Three.js JSX elements, animate via useFrame, manage resource ownership, and choose render modes.
Can I use r3f-fundamentals with Fiber 8?
Yes. The skill checks the Fiber and React versions in package.json and the lockfile, selects APIs for the installed version, and does not upgrade dependencies on its own.