
threejs-pro
Expert in 3D web graphics using Three.js, React Three Fiber (R3F), and WebGL shaders.
- Installs
- 180
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/404kidwiz/claude-supercode-skills --skill threejs-pro- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads threejs-pro automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Three.js & WebGL Developer
Purpose
Provides 3D web graphics expertise specializing in Three.js, React Three Fiber (R3F), and custom GLSL shader development. Creates immersive 3D experiences for the web with performance optimization and declarative scene management.
When to Use
- Building 3D product configurators or landing pages
- Implementing custom shaders (GLSL) for visual effects
- Optimizing 3D scenes (Draco compression, texture resizing)
- Developing React Three Fiber (R3F) applications
- Integrating physics (Rapier/Cannon) into web scenes
- Debugging WebGL performance issues (Draw calls, memory leaks)
Examples
Example 1: 3D Product Configurator
Scenario: Building an interactive product configurator for a furniture retailer.
Implementation:
- Created R3F component for 3D product display
- Implemented texture/material swapping system
- Added camera controls and lighting setup
- Optimized 3D model with Draco compression
- Added accessibility alternatives for non-3D users
Results:
- 40% increase in conversion rate
- Average session duration increased 2x
- Load time under 2 seconds
- Works on mobile devices
Example 2: Custom Shader Effects
Scenario: Creating immersive visual effects for a gaming landing page.
Implementation:
- Wrote custom GLSL vertex and fragment shaders
- Implemented post-processing effects (bloom, DOF)
- Added interactive elements responding to user input
- Optimized shader performance for real-time rendering
- Created fallback for WebGL-incapable devices
Results:
- Stunning visual experience with 60fps
- Viral marketing campaign success
- Industry recognition for visual design
- Maintained performance on mid-tier devices
Example 3: E-Commerce 3D Integration
Scenario: Integrating Three.js into existing React e-commerce site.
Implementation:
- Created isolated 3D canvas component
- Implemented lazy loading for 3D content
- Added proper state management between React and Three.js
- Implemented proper cleanup on component unmount
- Added error boundaries and fallback content
Results:
- Zero impact on existing page performance
- Improved SEO with proper lazy loading
- Graceful degradation for unsupported browsers
- Clean codebase following React patterns
Best Practices
Performance Optimization
- Geometry Merging: Reduce draw calls with merged geometries
- Texture Optimization: Use compressed formats, proper sizing
- Dispose Properly: Clean up geometries and materials
- Level of Detail: Use LOD for distant objects
React Three Fiber
- Declarative: Use R3F component tree, not imperative code
- Hooks: Use useFrame, useThree, useLoader properly
- State Management: Use Zustand for global 3D state
- Components: Break scene into reusable components
Shaders and Effects
- Custom Shaders: Use when built-ins aren't enough
- Post-Processing: Add effects without performance cost
- Optimization: Profile shader performance
- Fallbacks: Provide alternatives for low-end devices
Development Workflow
- Hot Reload: Use HMR for rapid iteration
- Debug Tools: Use drei's helpers and controls
- Accessibility: Provide alternatives for 3D content
- Testing: Test on multiple devices and browsers
2. Decision Framework
Tech Stack Selection
What is the project scope?
│
├─ **React Integration?**
│ ├─ Yes → **React Three Fiber (R3F)** (Recommended for 90% of web apps)
│ └─ No → **Vanilla Three.js**
│
├─ **Performance Critical?**
│ ├─ Massive Object Count? → **InstancedMesh**
│ ├─ Complex Physics? → **Rapier (WASM)**
│ └─ Post-Processing? → **EffectComposer / R3F Postprocessing**
│
└─ **Visual Style?**
├─ Realistic? → **PBR Materials + HDR Lighting**
├─ Cartoon? → **Toon Shader / Outline Pass**
└─ Abstract? → **Custom GLSL Shaders**
Optimization Checklist (The 60FPS Rule)
- Geometry: Use
DracoorMeshoptcompression. - Textures: Use
.webpor.ktx2. Max size 2048x2048. - Lighting: Bake lighting where possible. Max 1-2 real-time shadows.
- Draw Calls: Merge geometries or use Instancing.
- Render Loop: Avoid object creation in the
useFrameloop.
Red Flags → Escalate to graphics-engineer:
- Requirement for Ray Tracing in browser (WebGPU experimental)
- Custom render pipelines beyond standard Three.js capabilities
- Low-level WebGL API calls needed directly
3. Core Workflows
Workflow 1: React Three Fiber (R3F) Setup
Goal: A spinning cube with shadows and orbit controls.
Steps:
-
Setup
npm install three @types/three @react-three/fiber @react-three/drei -
Scene Component (
Scene.tsx)import { Canvas } from '@react-three/fiber'; import { OrbitControls, Stage } from '@react-three/drei'; export default function Scene() { return ( <Canvas shadows camera={{ position: [0, 0, 5] }}> <color attach="background" args={['#101010']} /> <ambientLight intensity={0.5} /> <spotLight position={[10, 10, 10]} angle={0.15} penumbra={1} castShadow /> <mesh castShadow receiveShadow rotation={[0, 1, 0]}> <boxGeometry args={[1, 1, 1]} /> <meshStandardMaterial color="orange" /> </mesh> <OrbitControls /> </Canvas> ); }
Workflow 3: Model Loading & Optimization
Goal: Load a heavy GLTF model efficiently.
Steps:
-
Compression
- Use
gltf-pipelineorgltf-transform. gltf-transform optimize input.glb output.glb --compress draco.
- Use
-
Loading (R3F)
import { useGLTF } from '@react-three/drei'; export function Model(props) { const { nodes, materials } = useGLTF('/optimized-model.glb'); return ( <group {...props} dispose={null}> <mesh geometry={nodes.Cube.geometry} material={materials.Metal} /> </group> ); } useGLTF.preload('/optimized-model.glb');
5. Anti-Patterns & Gotchas
❌ Anti-Pattern 1: Creating Objects in Loop
What it looks like:
useFrame(() => { new THREE.Vector3(...) })
Why it fails:
- Garbage Collection (GC) stutter.
- 60fps requires 16ms/frame. Allocating memory kills performance.
Correct approach:
- Reuse global/module-level variables.
const vec = new THREE.Vector3(); useFrame(() => vec.set(...))
❌ Anti-Pattern 2: Huge Textures
What it looks like:
- Loading 4k
.pngtextures (10MB each) for a background object.
Why it fails:
- Slow load time.
- GPU memory exhaustion (mobile crash).
Correct approach:
- Use
1kor2ktextures. - Use
.jpgfor color maps,.pngonly if alpha needed. - Use Basis/KTX2 for GPU compression.
❌ Anti-Pattern 3: Too Many Lights
What it looks like:
- 50 dynamic PointLights.
Why it fails:
- Forward rendering creates exponential shader complexity.
Correct approach:
- Bake Lighting (Lightmaps) in Blender.
- Use
AmbientLight+ 1DirectionalLight(Sun).
7. Quality Checklist
Performance:
- FPS: Stable 60fps on average laptop.
- Draw Calls: < 100 ideally.
- Memory: Geometries/Materials disposed when unmounted.
Visuals:
- Shadows: Soft shadows configured (ContactShadows or PCSS).
- Antialiasing: Enabled (default in R3F) or SMAA via post-proc.
- Responsiveness: Canvas resizes correctly on window resize.
Code:
- Declarative: Used R3F component tree, not imperative
scene.add(). - Optimization:
useMemoused for expensive calculations.
Anti-Patterns
Performance Anti-Patterns
- Excessive Draw Calls: Too many separate geometries - merge geometries when possible
- Memory Leaks: Not disposing geometries/materials - always clean up in useEffect cleanup
- Unoptimized Textures: Large texture files - compress and use appropriate formats
- Heavy Calculations: Blocking main thread - offload to web workers
Architecture Anti-Patterns
- Imperative Code: Using imperative Three.js in React - use declarative R3F patterns
- Prop Drilling: Passing props through many levels - use context and stores
- State Sprawl: Scattered state management - use centralized state (Zustand)
- Component Bloat: Large single components - break into focused components
3D Modeling Anti-Patterns
- High Poly Models: Unoptimized model geometry - use LOD and decimation
- Mismatched Scales: Inconsistent scale units - normalize model scales
- Missing Colliders: No collision geometry - add invisible colliders for interactions
- Improper Lighting: Too many lights - use baked lighting and light probes
Development Anti-Patterns
- No Progressive Loading: Large scenes loading slowly - implement loading states
- Missing Fallbacks: No graceful degradation - provide fallback experiences
- Accessibility Ignored: 3D content not accessible - add alternative content
- No Performance Budget: No performance targets - establish and monitor budgets
FAQ
What does the threejs-pro skill do?
Expert in 3D web graphics using Three.js, React Three Fiber (R3F), and WebGL shaders.
How do I install threejs-pro?
Run npx skills add https://github.com/404kidwiz/claude-supercode-skills --skill threejs-pro in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/threejs-pro/ (personal) or .claude/skills/threejs-pro/ (project).
Which AI agents can use threejs-pro?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is threejs-pro safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains threejs-pro?
It is published by 404kidwiz in 404kidwiz/claude-supercode-skills. It has 180 recorded installs.
More from 404kidwiz/claude-supercode-skills
frontend-ui-ux-engineer
404kidwiz/claude-supercode-skills
A designer-turned-developer who crafts stunning UI/UX even without design mockups. Code may be a bit messy, but the visual output is always fire.
quant-analyst
404kidwiz/claude-supercode-skills
Expert in quantitative finance, algorithmic trading, and financial data analysis using Python (Pandas/NumPy), statistical modeling, and machine learning.
project-manager
404kidwiz/claude-supercode-skills
Project management expert specializing in planning, execution, monitoring, and closure of projects. Masters traditional and agile methodologies to deliver projects on time, within budget, and to quality standards.
machine-learning-engineer
404kidwiz/claude-supercode-skills
Use when user needs ML model deployment, production serving infrastructure, optimization strategies, and real-time inference systems. Designs and implements scalable ML systems with focus on reliability and performance.
dotnet-framework-4.8-expert
404kidwiz/claude-supercode-skills
Legacy .NET Framework expert specializing in .NET Framework 4.8, WCF services, ASP.NET MVC, and maintaining enterprise applications with modern integration patterns.
codebase-exploration
404kidwiz/claude-supercode-skills
Deep contextual grep for codebases. Expert at finding patterns, architectures, implementations, and answering "Where is X?", "Which file has Y?", and "Find code that does Z" questions. Use when exploring unfamiliar codebases, finding specific implementations, understanding code organization, discovering patterns across multiple files, or locating functionality in a project. Supports three thoroughness levels quick, medium, very thorough.
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.