Skip to main content
skill CX Codex

threejs-r3f · cesartevisual — Claude Code skill: features and installation

The threejs-r3f Claude Code skill helps build and repair React Three Fiber scenes. It covers Drei helpers, Suspense loading, events, and React lifecycle integration.

MIT 820 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-r3f -a claude-code
Open on GitHub

What threejs-r3f does

The skill guides scene work with React Three Fiber, including Drei helpers, async asset loading, and event handling. It keeps renderer and loop ownership with Canvas while connecting scene behavior to React’s lifecycle.

Its guidance covers frame updates with useFrame, error boundaries, and resources shared through loader caches. React and Fiber versions need to be checked together: an unsupported pairing breaks reconciler compatibility. The skill also discusses scene cloning, demand rendering, and positive useFrame priorities.

Suggested checks include Strict Mode mounting, route changes, rapid asset swaps, and failed loads. For demand-rendered scenes, the idle state gets a test too, and equivalent HTML actions should remain available.

What it helps with

  • build a React Three Fiber scene with Drei
  • repair asset loading with Suspense
  • update animated objects through useFrame
  • debug pointer events on overlapping meshes
  • check resource lifecycle during scene changes

Example prompts for the agent

  • Build a React Three Fiber scene with Canvas and suitable Drei helpers.
  • Fix model loading through Suspense and handle a failed load.
  • Check useFrame animation and scene updates with demand rendering.

How to install threejs-r3f

1Skills CLI (Vercel)

npx skills add cesartevisual/threejs-skills --skill threejs-r3f -a claude-code

2Manually: put the files in place

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

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

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about threejs-r3f

How do I install threejs-r3f in Claude Code?

Run npx skills add cesartevisual/threejs-skills --skill threejs-r3f -a claude-code. The skill file is at ~/.claude/skills/threejs-r3f/SKILL.md.

What does threejs-r3f do?

It helps build and fix React Three Fiber scenes, covering Drei helpers, Suspense loading, events, and React lifecycle integration.

How does threejs-r3f handle React and Fiber compatibility?

It calls for checking React, react-dom, Fiber, Drei, and Three.js versions together. The Fiber version must support the React version in use.

Source text

SKILL.md · MIT
---
name: threejs-r3f
description: "Build or fix React Three Fiber scenes, Drei helpers, Suspense loading, events, and React lifecycle integration."
---

# React Three Fiber and Drei

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 React, react-dom, Fiber, Drei, and Three.js versions and peer dependencies together. Match the reconciler to React; do not assume every Fiber major supports every React major. Read helper APIs from the installed Drei version.

Let Canvas own the renderer and loop unless an intentional custom integration requires otherwise. Use Fiber hooks within Canvas descendants. Keep browser-only canvas code behind the framework's client boundary; preserve server-rendered product content outside it.

Use declarative scene ownership and refs for continuous mutations in useFrame. Avoid React setState for per-frame motion; reserve state for meaningful UI transitions. Memoize expensive imperative resources when needed, with explicit release rules. Hook selectors reduce irrelevant subscriptions but do not make nested mutable Three.js values reactive.

Place appropriate Suspense and error boundaries around async content. Loader caches may share geometry, textures, and materials; do not mutate or dispose shared entries as if they were instance-owned. Primitives and externally supplied resources need explicit lifecycle handling. Clone scene instances, and use skeleton-aware clones for skinned models.

Use demand rendering for mostly static scenes only when all imperative changes and ongoing damping trigger invalidation. Inspect Drei helper behavior before adding a duplicate loop or control update. Positive useFrame priority takes over rendering; account for who renders afterward.

Test Strict Mode mounting, route transitions, rapid asset switching, loading failure, pointer propagation through overlapping meshes, and an idle demand-rendered scene. Keep equivalent HTML actions available.

## API reference

Consult the [official documentation](https://r3f.docs.pmnd.rs/) 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 Frontend and UI →

threejs-r3f by other authors comes first.

From the same set24

The whole set →
threejs-performance threejs-performance is a Claude Code skill that profiles and optimizes Three.js frame time, GPU workload, asset memory, and resource leaks. CX Codex +1 817installs threejs-web This Claude Code skill plans and builds Three.js web experiences or focused 3D features. It inspects the project and checks the result in a browser. CX Codex +1 776installs threejs-animation threejs-animation — a skill for Claude Code guides animation work in Three.js. It covers clips, skeletal motion, transitions, and scroll-driven timelines. CX Codex +1 753installs threejs-lighting The threejs-lighting Claude Code skill guides lighting and shadow work in Three.js scenes. It comes into play when setting up environment maps, direct lights, or shadow maps. CX Codex +1 694installs threejs-shaders threejs-shaders — a Claude Code skill for writing and debugging Three.js GLSL shaders, custom material effects, uniforms, and geometry deformation. CX Codex +1 694installs threejs-testing threejs-testing — a skill for Claude Code defines visual QA and browser testing guidelines for Three.js scenes. Focuses on deterministic fixtures, GPU checks, and teardown lifecycle tests. CX Codex +1 681installs threejs-interaction This Claude Code skill guides Three.js interaction work, from object picking to orbit controls. It applies when an agent is asked to add dragging, selection, or synchronized HTML controls. CX Codex +1 681installs threejs-assets The threejs-assets Claude Code skill guides loading and managing glTF models, textures, and user-provided 3D files. It applies to asset validation, compression, caching, and cleanup in Three.js projects. CX Codex +1 676installs

Project sponsors

Companies that keep this analytics open