threejs-skills README

项目的 README,来自 github.com/CloudAI-X/threejs-skills。合并为一个 markdown 文件:README.md。

Three.js Skills for Claude Code

Skill files that give Claude Code current, verified knowledge of three.js, so the code it writes runs on the release you actually install.

The skills target three.js r186 ([email protected]), React Three Fiber 9.8 with drei 10.7, and gltf-transform 4.5. Rendering examples use WebGLRenderer, directly or through React Three Fiber; the WebGPU and TSL section in every skill covers WebGPURenderer.

Why

Claude Code knows three.js from its training data, which mixes many releases. A lot changed between r160 and r186: RGBELoader became HDRLoader, Clock gave way to Timer, PostProcessing became RenderPipeline, WebGL 1 support is gone, and the three.js docs now tell LLMs to use WebGPURenderer with TSL for custom shaders and materials. These skills give Claude Code the current API, working examples, and a Common Mistakes list of the outdated patterns models still reach for.

Installation

With the skills CLI:

npx skills add cloudai-x/threejs-skills

Or manually. Claude Code loads skills from ~/.claude/skills/ (all your projects) or .claude/skills/ (one project):

git clone https://github.com/CloudAI-X/threejs-skills.git

# all your projects
mkdir -p ~/.claude/skills && cp -r threejs-skills/skills/* ~/.claude/skills/

# or one project (run from the project root)
mkdir -p .claude/skills && cp -r threejs-skills/skills/* .claude/skills/

Skills Included

Skill Covers
threejs-fundamentals Scene, cameras, renderer setup, animation loop, object hierarchy, transforms
threejs-geometry Built-in shapes, BufferGeometry, merging, instancing, BatchedMesh, points, lines
threejs-materials Material types, PBR, blending, stencil, recompiles, node materials
threejs-lighting Light types and physical units, shadows, HDR environments, light probes
threejs-textures Loading, color spaces, UV channels, texture types, render targets, memory
threejs-animation Keyframes, the animation mixer, skeletal and morph animation, blending
threejs-loaders glTF with Draco, meshopt and KTX2, other formats, HDR, progress, disposal
threejs-shaders ShaderMaterial and RawShaderMaterial, shader chunks, TSL and node materials
threejs-postprocessing EffectComposer, built-in renderer effects, the WebGPU RenderPipeline
threejs-interaction Raycasting, camera controls, transform gizmos, drag and box selection
threejs-performance Measuring frame cost, draw calls, GPU memory, fill rate, compile stalls
threejs-react-three-fiber React Three Fiber 9 and a verified set of drei helpers, on WebGL or WebGPU
threejs-asset-pipeline gltf-transform: Draco, meshopt, KTX2, WebP, and the matching loader setup

How It Works

Claude Code loads a skill when your request matches its description. When you ask it to:

Skill File Structure

Every skill follows the same layout:

---
name: threejs-<topic>
description: "What the skill covers. Use when ..."
---

# Three.js <Topic>

Targets three.js r186. Examples use WebGLRenderer; the WebGPU and TSL section uses WebGPURenderer.

## Quick Start          a complete, runnable example
## <topic sections>     the API with working examples
## WebGPU and TSL       the same topic under WebGPURenderer
## Common Mistakes      outdated or wrong code → the r186 fix, with the reason
## See Also             related skills

Verification

The skills were checked against the published [email protected] package and the official Migration Guide, and against @react-three/[email protected], @react-three/[email protected], @gltf-transform/[email protected] and [email protected] where they apply:

If you find something that is wrong on the current release, please open an issue with the skill name, the line and the three.js version you use.

License

MIT, see LICENSE.

Acknowledgments

threejs-skills (CloudAI-X/threejs-skills)

正在搜索数据库…

这是什么?这是一组共 13 个技能文件,用来教 Claude Code 使用 three.js 当前的 API(r186)、React Three Fiber 9.8 加 drei 10.7,以及 gltf-transform 4.5,使它编写的 3D 代码与你安装的版本一致。
这是我要导入项目的库吗?不是。这些是技能文件:当你的请求与某个技能的描述相符时,Claude Code 会自行加载它,因此不需要把任何东西导入到你的代码中。
我该怎么让它运行起来?把技能文件夹复制到 ~/.claude/skills/ 中,即可在你的所有项目里使用;或复制到某个项目内的 .claude/skills/ 中,仅在该项目里使用。之后,Claude Code 会为每个请求选择合适的技能。
除了这些技能,我还需要什么?Claude Code 和一个 three.js 项目。这些技能专门针对 three.js r186、React Three Fiber 9.8 加 drei 10.7 以及 gltf-transform 4.5 编写。
它是否同时涵盖 WebGPU 和 WebGL?主要涵盖 WebGL:渲染示例使用 WebGLRenderer,但每个技能还包含一个 WebGPU 和 TSL 部分,介绍 WebGPURenderer。
哪个技能适用于哪类任务?创建场景使用 threejs-fundamentals,灯光和阴影使用 threejs-lighting,glTF 加载使用 threejs-loaders,用 React 搭建场景则使用 threejs-react-three-fiber。
“常见错误”列表主要提醒哪些问题?列表中列出的是模型仍然会沿用的过时写法,例如已变为 HDRLoader 的 RGBELoader,以及已被 Timer 取代的 Clock。
性能相关的技能能帮我做什么?在运行缓慢的场景中,测量每帧开销、绘制调用次数、GPU 内存、填充率以及着色器编译卡顿。
作者
CloudAI-X
大小
0.2 MB
星标
4.2K
更新
提交Oct 19
时长
9个月
提交 · 90 天