r3f-materials — Claude Code skill: what it does, how to install
Guides the agent in configuring PBR and transparency in React Three Fiber. Prevents texture color space mistakes and unnecessary GPU overhead.
npx skills add EnzeD/r3f-skills --skill r3f-materials -a claude-codeWhat r3f-materials does
The skill outlines guidelines for choosing surface materials in React Three Fiber. It steers the assistant toward the simplest viable option, favoring meshStandardMaterial or unlit meshBasicMaterial before jumping to costly physical shaders. Color management rules are strict: sRGB for color maps, alongside NoColorSpace for roughness and normal data.
Specific guidance covers transparency and glass rendering. Using alphaTest is recommended for cutouts to prevent alpha blending sort bugs. For realistic transmission, it details how Drei helpers like MeshTransmissionMaterial add extra scene passes and require low initial sample counts.
The examples target Fiber 9 and React 19 under WebGL. Drei shader materials will break if ported directly to WebGPU without switching to TSL. Disposing of a material in Three.js also leaves attached textures in GPU memory unless they are released separately.
What it helps with
- select the least expensive Three.js material for a mesh
- configure cutout transparency with
alphaTestto avoid depth sorting bugs - assign correct color spaces to albedo and roughness textures
- optimize glass transmission passes to keep GPU draw calls down
Example prompts for the agent
- Configure a realistic rough gold material using meshStandardMaterial and environment lighting.
- Set up glass transmission in Drei without hurting render performance.
- Fix the texture color space setup on this imported model.
How to install r3f-materials
1Skills CLI (Vercel)
npx skills add EnzeD/r3f-skills --skill r3f-materials -a claude-code2Manually: put the files in place
~/.claude/skills/r3f-materials/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/r3f-materials/
1Skills CLI (Vercel)
npx skills add EnzeD/r3f-skills --skill r3f-materials -a codex2Manually: put the files in place
.agents/skills/r3f-materials/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add EnzeD/r3f-skills --skill r3f-materials -a cursor2Manually: put the files in place
.cursor/skills/r3f-materials/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install EnzeD/r3f-skills r3f-materials2Manually: put the files in place
.github/skills/r3f-materials/SKILL.md1Skills CLI (Vercel)
npx skills add EnzeD/r3f-skills --skill r3f-materials -a gemini-cli2Platform CLI
gemini skills install https://github.com/EnzeD/r3f-skills --path skills/r3f-materialsManually: put the files in place
.devin/skills/r3f-materials/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add EnzeD/r3f-skills --skill r3f-materials -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-materials
How do I install r3f-materials in Claude Code?
Run npx skills add EnzeD/r3f-skills --skill r3f-materials -a claude-code in your terminal.
What does the r3f-materials skill do?
It teaches coding agents how to configure Three.js materials, transparency, and PBR properties cleanly inside React Three Fiber.
Does disposing a material also free its textures?
No. Disposing a material does not dispose of its textures, so you must manage texture lifecycles independently to avoid memory leaks.