/three-best-practices
Three.js performance optimization and best practices guidelines. Use when writing, reviewing, or optimizing Three.js code. Triggers on tasks involving 3D scenes, WebGL/WebGPU rendering, geometries, materials, textures, lighting, shaders, or TSL.
$ npx -y skills add zebbern/claude-code-guide --skill three-best-practices --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/three-best-practices
Context preview
The summary Claude sees to decide when to auto-load this skill.
Three.js performance optimization and best practices guidelines. Use when writing, reviewing, or optimizing Three.js code. Triggers on tasks involving 3D scenes, WebGL/WebGPU rendering, geometries, materials, textures, lighting, shaders, or TSL.
SKILL.md
three-best-practices.SKILL.mdname: three-best-practices
description: Three.js performance optimization and best practices guidelines. Use when writing, reviewing, or optimizing Three.js code. Triggers on tasks involving 3D scenes, WebGL/WebGPU rendering, geometries, materials, textures, lighting, shaders, or TSL.
license: MIT
metadata:
author: three-agent-skills
version: "2.1.0"
three-version: "0.182.0+"
Three.js Best Practices
Comprehensive performance optimization guide for Three.js applications. Contains 120+ rules across 18 categories, prioritized by impact.
Sources & Credits
> This skill compiles best practices from multiple authoritative sources: > - Official guidelines from Three.js `llms` branch maintained by [mrdoob](https://github.com/mrdoob) > - [100 Three.js Tips](https://www.utsubo.com/blog/threejs-best-practices-100-tips) by [Utsubo](https://www.utsubo.com) - Excellent comprehensive guide covering WebGPU, asset optimization, and performance tips
When to Apply
Reference these guidelines when:
- Setting up a new Three.js project
- Writing or reviewing Three.js code
- Optimizing performance or fixing memory leaks
- Working with custom shaders (GLSL or TSL)
- Implementing WebGPU features
- Building VR/AR experiences with WebXR
- Integrating physics engines
- Optimizing for mobile devices
Rule Categories by Priority
| Priority | Category | Impact | Prefix | |----------|----------|--------|--------| | 0 | Modern Setup & Imports | FUNDAMENTAL | `setup-` | | 1 | Memory Management & Dispose | CRITICAL | `memory-` | | 2 | Render Loop Optimization | CRITICAL | `render-` | | 3 | Draw Call Optimization | CRITICAL | `drawcall-` | | 4 | Geometry & Buffer Management | HIGH | `geometry-` | | 5 | Material & Texture Optimization | HIGH | `material-` | | 6 | Asset Compression | HIGH | `asset-` | | 7 | Lighting & Shadows | MEDIUM-HIGH | `lighting-` | | 8 | Scene Graph Organization | MEDIUM | `scene-` | | 9 | Shader Best Practices (GLSL) | MEDIUM | `shader-` | | 10 | TSL (Three.js Shading Language) | MEDIUM | `tsl-` | | 11 | WebGPU Renderer | MEDIUM | `webgpu-` | | 12 | Loading & Assets | MEDIUM | `loading-` | | 13 | Core Web Vitals | MEDIUM-HIGH | `vitals-` | | 14 | Camera & Controls | LOW-MEDIUM | `camera-` | | 15 | Animation System | MEDIUM | `animation-` | | 16 | Physics Integration | MEDIUM | `physics-` | | 17 | WebXR / VR / AR | MEDIUM | `webxr-` | | 18 | Audio | LOW-MEDIUM | `audio-` | | 19 | Post-Processing | MEDIUM | `postpro-` | | 20 | Mobile Optimization | HIGH | `mobile-` | | 21 | Production | HIGH | `error-`, `migration-` | | 22 | Debug & DevTools | LOW | `debug-` |
Quick Reference
0. Modern Setup (FUNDAMENTAL)
- `setup-use-import-maps` - Use Import Maps, not old CDN scripts
- `setup-choose-renderer` - WebGLRenderer (default) vs WebGPURenderer (TSL/compute)
- `setup-animation-loop` - Use `renderer.setAnimationLoop()` not manual RAF
- `setup-basic-scene-template` - Complete modern scene template
1. Memory Management (CRITICAL)
- `memory-dispose-geometry` - Always dispose geometries
- `memory-dispose-material` - Always dispose materials and textures
- `memory-dispose-textures` - Dispose dynamically created textures
- `memory-dispose-render-targets` - Always dispose WebGLRenderTarget
- `memory-dispose-recursive` - Use recursive disposal for hierarchies
- `memory-dispose-on-unmount` - Dispose in React cleanup/unmount
- `memory-renderer-dispose` - Dispose renderer when destroying view
- `memory-reuse-objects` - Reuse geometries and materials
2. Render Loop (CRITICAL)
- `render-single-raf` - Single requestAnimationFrame loop
- `render-conditional` - Render on demand for static scenes
- `render-delta-time` - Use delta time for animations
- `render-avoid-allocations` - Never allocate in render loop
- `render-cache-computations` - Cache expensive computations
- `render-frustum-culling` - Enable frustum culling
- `render-update-matrix-manual` - Disable auto matrix updates for static objects
- `render-pixel-ratio` - Limit pixel ratio to 2
- `render-antialias-wisely` - Use antialiasing judiciously
3. Draw Call Optimization (CRITICAL)
- `draw-call-optimization` - Target under 100 draw calls per frame
- `geometry-instanced-mesh` - Use InstancedMesh for identical objects
- `geometry-batched-mesh` - Use BatchedMesh for varied geometries (same material)
- `geometry-merge-static` - Merge static geometries with BufferGeometryUtils
4. Geometry (HIGH)
- `geometry-buffer-geometry` - Always use BufferGeometry
- `geometry-merge-static` - Merge static geometries
- `geometry-instanced-mesh` - Use InstancedMesh for identical objects
- `geometry-lod` - Use Level of Detail for complex models
- `geometry-index-buffer` - Use indexed geometry
- `geometry-vertex-count` - Minimize vertex count
- `geometry-attributes-typed` - Use appropriate typed arrays
- `geometry-interleaved` - Consider interleaved buffers
5. Materials & Textures (HIGH)
- `material-reuse` - Reuse materials across meshes
- `material-simplest-sufficient` - Use simplest material that works
- `material-texture-size-power-of-two` - Power-of-two texture dimensions
- `material-texture-compression` - Use compressed textures (KTX2/Basis)
- `material-texture-mipmaps` - Enable mipmaps appropriately
- `material-texture-anisotropy` - Use anisotropic filtering for floors
- `material-texture-atlas` - Use texture atlases
- `material-avoid-transparency` - Minimize transparent materials
- `material-onbeforecompile` - Use onBeforeCompile for shader mods (or TSL)
6. Asset Compression (HIGH)
- `asset-compression` - Draco, Meshopt, KTX2 compression guide
- `asset-draco` - 90-95% geometry size reduction
- `asset-ktx2` - GPU-compressed textures (UASTC vs ETC1S)
- `asset-meshopt` - Alternative to Draco with faster decompression
- `asset-lod` - Level of Detail for 30-40% frame rate improvement
7. Lighting & Shadows (MEDIUM-HIGH)
- `lighting-limit-lights` - Limit to 3 or fewer active lights
- `lighting-shadows-advanced
Read more
name: three-best-practices description: Three.js performance optimization and best practices guidelines. Use when writing, reviewing, or optimizing Three.js code. Triggers on tasks involving 3D scenes, WebGL/WebGPU rendering, geometries, materials, textures, lighting, shaders, or TSL. license: MIT metadata: author: three-agent-skills version: "2.1.0" three-version: "0.182.0+"
Three.js Best Practices
Comprehensive performance optimization guide for Three.js applications. Contains 120+ rules across 18 categories, prioritized by impact.
Sources & Credits
> This skill compiles best practices from multiple authoritative sources: > - Official guidelines from Three.js `llms` branch maintained by [mrdoob](https://github.com/mrdoob) > - [100 Three.js Tips](https://www.utsubo.com/blog/threejs-best-practices-100-tips) by [Utsubo](https://www.utsubo.com) - Excellent comprehensive guide covering WebGPU, asset optimization, and performance tips
When to Apply
Reference these guidelines when:
- Setting up a new Three.js project
- Writing or reviewing Three.js code
- Optimizing performance or fixing memory leaks
- Working with custom shaders (GLSL or TSL)
- Implementing WebGPU features
- Building VR/AR experiences with WebXR
- Integrating physics engines
- Optimizing for mobile devices
Rule Categories by Priority
| Priority | Category | Impact | Prefix | |----------|----------|--------|--------| | 0 | Modern Setup & Imports | FUNDAMENTAL | `setup-` | | 1 | Memory Management & Dispose | CRITICAL | `memory-` | | 2 | Render Loop Optimization | CRITICAL | `render-` | | 3 | Draw Call Optimization | CRITICAL | `drawcall-` | | 4 | Geometry & Buffer Management | HIGH | `geometry-` | | 5 | Material & Texture Optimization | HIGH | `material-` | | 6 | Asset Compression | HIGH | `asset-` | | 7 | Lighting & Shadows | MEDIUM-HIGH | `lighting-` | | 8 | Scene Graph Organization | MEDIUM | `scene-` | | 9 | Shader Best Practices (GLSL) | MEDIUM | `shader-` | | 10 | TSL (Three.js Shading Language) | MEDIUM | `tsl-` | | 11 | WebGPU Renderer | MEDIUM | `webgpu-` | | 12 | Loading & Assets | MEDIUM | `loading-` | | 13 | Core Web Vitals | MEDIUM-HIGH | `vitals-` | | 14 | Camera & Controls | LOW-MEDIUM | `camera-` | | 15 | Animation System | MEDIUM | `animation-` | | 16 | Physics Integration | MEDIUM | `physics-` | | 17 | WebXR / VR / AR | MEDIUM | `webxr-` | | 18 | Audio | LOW-MEDIUM | `audio-` | | 19 | Post-Processing | MEDIUM | `postpro-` | | 20 | Mobile Optimization | HIGH | `mobile-` | | 21 | Production | HIGH | `error-`, `migration-` | | 22 | Debug & DevTools | LOW | `debug-` |
Quick Reference
0. Modern Setup (FUNDAMENTAL)
- `setup-use-import-maps` - Use Import Maps, not old CDN scripts
- `setup-choose-renderer` - WebGLRenderer (default) vs WebGPURenderer (TSL/compute)
- `setup-animation-loop` - Use `renderer.setAnimationLoop()` not manual RAF
- `setup-basic-scene-template` - Complete modern scene template
1. Memory Management (CRITICAL)
- `memory-dispose-geometry` - Always dispose geometries
- `memory-dispose-material` - Always dispose materials and textures
- `memory-dispose-textures` - Dispose dynamically created textures
- `memory-dispose-render-targets` - Always dispose WebGLRenderTarget
- `memory-dispose-recursive` - Use recursive disposal for hierarchies
- `memory-dispose-on-unmount` - Dispose in React cleanup/unmount
- `memory-renderer-dispose` - Dispose renderer when destroying view
- `memory-reuse-objects` - Reuse geometries and materials
2. Render Loop (CRITICAL)
- `render-single-raf` - Single requestAnimationFrame loop
- `render-conditional` - Render on demand for static scenes
- `render-delta-time` - Use delta time for animations
- `render-avoid-allocations` - Never allocate in render loop
- `render-cache-computations` - Cache expensive computations
- `render-frustum-culling` - Enable frustum culling
- `render-update-matrix-manual` - Disable auto matrix updates for static objects
- `render-pixel-ratio` - Limit pixel ratio to 2
- `render-antialias-wisely` - Use antialiasing judiciously
3. Draw Call Optimization (CRITICAL)
- `draw-call-optimization` - Target under 100 draw calls per frame
- `geometry-instanced-mesh` - Use InstancedMesh for identical objects
- `geometry-batched-mesh` - Use BatchedMesh for varied geometries (same material)
- `geometry-merge-static` - Merge static geometries with BufferGeometryUtils
4. Geometry (HIGH)
- `geometry-buffer-geometry` - Always use BufferGeometry
- `geometry-merge-static` - Merge static geometries
- `geometry-instanced-mesh` - Use InstancedMesh for identical objects
- `geometry-lod` - Use Level of Detail for complex models
- `geometry-index-buffer` - Use indexed geometry
- `geometry-vertex-count` - Minimize vertex count
- `geometry-attributes-typed` - Use appropriate typed arrays
- `geometry-interleaved` - Consider interleaved buffers
5. Materials & Textures (HIGH)
- `material-reuse` - Reuse materials across meshes
- `material-simplest-sufficient` - Use simplest material that works
- `material-texture-size-power-of-two` - Power-of-two texture dimensions
- `material-texture-compression` - Use compressed textures (KTX2/Basis)
- `material-texture-mipmaps` - Enable mipmaps appropriately
- `material-texture-anisotropy` - Use anisotropic filtering for floors
- `material-texture-atlas` - Use texture atlases
- `material-avoid-transparency` - Minimize transparent materials
- `material-onbeforecompile` - Use onBeforeCompile for shader mods (or TSL)
6. Asset Compression (HIGH)
- `asset-compression` - Draco, Meshopt, KTX2 compression guide
- `asset-draco` - 90-95% geometry size reduction
- `asset-ktx2` - GPU-compressed textures (UASTC vs ETC1S)
- `asset-meshopt` - Alternative to Draco with faster decompression
- `asset-lod` - Level of Detail for 30-40% frame rate improvement
7. Lighting & Shadows (MEDIUM-HIGH)
- `lighting-limit-lights` - Limit to 3 or fewer active lights
- `lighting-shadows-advanced
Claude Code Guide - Setup, Commands, workflows, agents, skills & tips-n-tricks from beginner to power user!
Repo: zebbern/claude-code-guide
Other skills on claude-code-guide.
- /academic-paper-reviewer
Simulates academic peer review, evaluating papers across Originality, Methodology, Results, and Writing to provide Major/Minor Revision recommendations with actionable feedback. Triggers when a user asks to \"review my paper,\" \"simulate peer review,\" or \"give my paper a peer
Open skill - /active-directory-attacks
This skill should be used when the user asks to "attack Active Directory", "exploit AD", "Kerberoasting", "DCSync", "pass-the-hash", "BloodHound enumeration", "Golden Ticket", "Silver Ticket", "AS-REP roasting", "NTLM relay", or needs guidance on Windows domain penetration
Open skill - /api-fuzzing-bug-bounty
This skill should be used when the user asks to "test API security", "fuzz APIs", "find IDOR vulnerabilities", "test REST API", "test GraphQL", "API penetration testing", "bug bounty API testing", or needs guidance on API security assessment techniques.
Open skill - /api-shape-explorer
Generate multiple radically different interface designs for a module using parallel sub-agents. Use when user wants to design an API, explore interface options, compare module shapes, or mentions "design it twice".
Open skill - /audit-flow
Interactive system flow tracing across CODE, API, AUTH, DATA, NETWORK layers with SQLite persistence and Mermaid export. Use for security audits, compliance documentation, flow tracing, feature ideation, brainstorming, debugging, architecture reviews, or incident post-mortems.
Open skill - /authentication-patterns
Authentication patterns: session vs JWT vs OAuth comparison, provider selection (NextAuth, Clerk, Supabase Auth), security checklist, and common mistakes. Use when implementing auth, reviewing auth flows, or choosing auth providers.
Open skill

