# r3f-loaders

Guides 3D asset loading and reuse in React Three Fiber. Helps set up hooks, preloading, scene cloning, and fallback UI.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1800 installs · ★ 130
- Author: EnzeD
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/EnzeD/r3f-skills/tree/HEAD/skills/r3f-loaders/SKILL.md
- Updated: 2026-08-31
- HTML: https://affpapa.org/en/nevibecode/skills/r3f-loaders

## What it does

This skill teaches coding agents how to fetch and manage 3D assets in React Three Fiber. It focuses on modern setups such as Fiber 9 and React 19. The guidance directs the model to pick `useGLTF` for glTF files and `useLoader` for alternate formats. It also covers addon import locations in recent Three.js releases.

It explains how to duplicate scenes without wasting memory. Duplicated meshes share geometry and materials via Drei `Clone`. If an instance needs unique textures, you clone only those specific properties. For separate animation mixers, the instructions recommend `SkeletonUtils.clone` to retain independent control.

Decoders like Draco or KTX2 must be configured prior to triggering network fetches. Because Suspense only pauses on unresolved promises, failed requests need a dedicated error boundary. Clearing the cache with `useGLTF.clear` does not fully free GPU memory, so resource disposal requires deliberate management.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add EnzeD/r3f-skills --skill r3f-loaders -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/r3f-loaders/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/r3f-loaders/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add EnzeD/r3f-skills --skill r3f-loaders -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/r3f-loaders/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add EnzeD/r3f-skills --skill r3f-loaders -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/r3f-loaders/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install EnzeD/r3f-skills r3f-loaders
```

2. **Manually: put the files in place**
- File: `.github/skills/r3f-loaders/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add EnzeD/r3f-skills --skill r3f-loaders -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/EnzeD/r3f-skills --path skills/r3f-loaders
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/r3f-loaders/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add EnzeD/r3f-skills --skill r3f-loaders -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/EnzeD/r3f-skills/tree/HEAD/skills/r3f-loaders/SKILL.md

## When to use it
- import GLB assets with useGLTF safely
- replicate 3D meshes while sharing geometry via Drei Clone
- initialize Draco and KTX2 decoders before network requests
- isolate asset fetch failures using dedicated error boundaries

## Example prompts
- Show how to load a GLB model with useGLTF and place several clones in the scene.
- Configure KTX2Loader for compressed textures in React Three Fiber.
- How do I catch 3D asset fetch failures using an Error Boundary?

## Similar
- [threejs-r3f](https://affpapa.org/en/nevibecode/skills/threejs-r3f.md) — skill · 1000 installs
- [threejs-loaders](https://affpapa.org/en/nevibecode/skills/threejs-loaders.md) — skill · 12900 installs
- [react-three-fiber](https://affpapa.org/en/nevibecode/skills/react-three-fiber.md) — skill · 3800 installs
- [threejs-animation](https://affpapa.org/en/nevibecode/skills/iart-ai-threejs-animation.md) — skill · 1400 installs
- [git-city-3d-github-visualization](https://affpapa.org/en/nevibecode/skills/git-city-3d-github-visualization.md) — skill · 1300 installs
- [threejs-webgl](https://affpapa.org/en/nevibecode/skills/threejs-webgl.md) — skill · 4600 installs

From the same set: [enzed/r3f-skills](https://affpapa.org/en/nevibecode/by/enzed/r3f-skills.md) — 6 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
