.claude/skills/r3f-loaders/SKILL.md
React Three Fiber asset loading - useGLTF, useLoader, Suspense patterns. Use when loading 3D models, textures, or managing loading states.
npx skillsauth add tadams95/kardashev-network r3f-loadersInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
import { useGLTF } from '@react-three/drei'
function Model() {
const { scene, nodes, materials, animations } = useGLTF('/models/robot.glb')
return <primitive object={scene} />
}
// Preload
useGLTF.preload('/models/robot.glb')
import { useGLTF } from '@react-three/drei'
function Model() {
const { scene } = useGLTF('/models/compressed.glb', true) // true enables Draco
return <primitive object={scene} />
}
import { Clone } from '@react-three/drei'
function Trees() {
const { scene } = useGLTF('/models/tree.glb')
return (
<>
<Clone object={scene} position={[0, 0, 0]} />
<Clone object={scene} position={[5, 0, 0]} />
<Clone object={scene} position={[-5, 0, 0]} />
</>
)
}
import { useLoader } from '@react-three/fiber'
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'
import { TextureLoader } from 'three'
const gltf = useLoader(GLTFLoader, '/model.glb')
const texture = useLoader(TextureLoader, '/texture.jpg')
import { Suspense } from 'react'
function Fallback() {
return (
<mesh>
<boxGeometry />
<meshBasicMaterial color="gray" wireframe />
</mesh>
)
}
function Scene() {
return (
<Suspense fallback={<Fallback />}>
<Model />
</Suspense>
)
}
import { useProgress, Html } from '@react-three/drei'
function Loader() {
const { progress, active } = useProgress()
return active ? (
<Html center>
<div>{progress.toFixed(0)}%</div>
</Html>
) : null
}
function Model() {
const { scene } = useGLTF('/model.glb')
useEffect(() => {
scene.traverse((child) => {
if (child.isMesh) {
child.castShadow = true
child.receiveShadow = true
}
})
}, [scene])
return <primitive object={scene} />
}
import { useFBX, useOBJ } from '@react-three/drei'
const fbx = useFBX('/model.fbx')
const obj = useOBJ('/model.obj')
npx gltfjsx model.glb --types
Generates typed component with proper mesh/material access.
development
Web3 integration with wagmi and viem - wallet connection, contract interactions, transactions, RainbowKit. Use when implementing wallet features, reading/writing contracts, or handling blockchain transactions.
content-media
Three.js textures - loading, configuration, UV mapping, environment maps. Use when loading images, configuring texture properties, or working with HDR environments.
data-ai
Three.js shaders - GLSL, ShaderMaterial, uniforms, custom effects. Use when creating custom visual effects, modifying vertices, writing fragment shaders, or extending built-in materials.
testing
Three.js post-processing - EffectComposer, bloom, depth of field, custom passes. Use when adding visual effects, screen-space effects, or enhancing rendered output.