Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
oakoss avatar

Threejs

  • 81 installs
  • 14 repo stars
  • Updated March 2, 2026
  • oakoss/agent-skills

Helps with ai & agent building tasks during AI-assisted development.

About

threejs is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.

  • threejs
  • AI & Agent Building
  • AI-coding skill

Threejs by the numbers

  • 81 all-time installs (skills.sh)
  • +2 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #5,179 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oakoss/agent-skills --skill threejs

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs81
repo stars14
Last updatedMarch 2, 2026
Repositoryoakoss/agent-skills

What it does

Helps with ai & agent building tasks during AI-assisted development.

Files

SKILL.mdMarkdownGitHub ↗

Three.js

Overview

Guides building high-performance 3D web experiences with Three.js, WebGPU-first rendering, TSL (Three Shader Language), and React Three Fiber. Covers scene architecture, asset compression, draw call budgets, and React 19 / Next.js integration patterns.

When to use: Creating 3D scenes, WebGPU rendering setup, TSL shader authoring, asset optimization (Draco/KTX2), React Three Fiber composition, Next.js streaming for 3D content, loading GLTF models, setting up lighting and shadows, animation playback and blending.

When NOT to use: 2D canvas animations (use Canvas API), simple SVG graphics, server-side rendering without client hydration, projects targeting pre-2022 hardware exclusively.

Quick Reference

PatternAPI / ApproachKey Points
WebGPU rendererimport * as THREE from 'three/webgpu'Must await renderer.init() before first render
R3F canvas<Canvas gl={...}> with SuspenseWrap in <Suspense> for streaming support
Frame updatesuseFrame((state, delta) => ...)Mutate refs directly; never use setState
TSL shadersimport { ... } from 'three/tsl'Node-based; compiles to WGSL or GLSL
Instancing<instancedMesh> with matrix updatesSingle draw call for repeated geometry
Batched meshBatchedMesh (r156+)Different geometries sharing one material
Draco compressiongltf-pipeline -i in.gltf -o out.glb -dUp to 90% geometry size reduction
KTX2 texturesBasis Universal via toktxStays compressed in VRAM
LODTHREE.LOD with distance thresholdsSwap detail levels by camera distance
On-demand render<Canvas frameloop="demand">Only render when scene state changes
Cleanup.dispose() on unmountGeometries, materials, and textures
Compute shadersFn(() => {...})().compute(count)GPU-side physics, particles, flocking
LightingDirectionalLight, SpotLight, HemisphereLightEnable shadowMap on renderer + castShadow on light
GLTF loadingGLTFLoader + DRACOLoaderDraco for geometry compression; traverse for shadows
AnimationAnimationMixer + clipAction()Update with clock.getDelta() every frame
Crossfadeaction.fadeOut() / action.fadeIn()Weight-based blending between walk/run/idle
Environment mapsRGBELoader + PMREMGeneratorSet scene.environment for PBR reflections
RaycastingRaycaster.setFromCamera(pointer, cam)Mouse/touch picking; use recursive: true for GLTF
Morph targetsmesh.morphTargetInfluences[index]Facial animation, blend shapes from GLTF

Common Mistakes

MistakeCorrect Pattern
Allocating new THREE.Vector3() or new THREE.Color() inside useFramePre-allocate outside the loop to avoid GC pressure every frame
Using requestAnimationFrame manually in React projectsUse R3F's useFrame hook for frame-by-frame updates
Not awaiting renderer.init() for WebGPUAlways await renderer.init() before the first render to avoid race conditions
Loading assets without <Suspense> boundariesWrap <Canvas> in <Suspense> to prevent main thread blocking
Using high-poly models for background or distant elementsUse LOD (Level of Detail) or Impostors to reduce draw calls
Using setState inside render loop for animationsMutate refs directly via useFrame for frame-by-frame updates
Speed tied to frame rate (rotation += 0.01)Multiply by delta for frame-rate-independent motion
Not using clock.getDelta() for mixer.update()Always pass delta time to mixer.update(delta) for correct animation speed
Forgetting to dispose loaded GLTF modelsTraverse and dispose geometries, materials, and textures on removal
Shadow map enabled on renderer but not on the lightSet both renderer.shadowMap.enabled and light.castShadow = true
Large far/near ratio on cameraKeep ratio small to avoid z-fighting; set near as large as possible

Delegation

  • Asset and scene graph exploration: Use Explore agent
  • Multi-file scene refactoring and optimization passes: Use Task agent
  • 3D architecture and rendering pipeline planning: Use Plan agent

References

  • Scene, lighting, and model loading
  • Animation system and blending
  • Performance and asset optimization
  • WebGPU and TSL shader patterns
  • React Three Fiber patterns and Next.js integration

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.