threejs-builder
БесплатноЗапускает вложенные скриптыНе проверенDesign and implement lightweight Three.js (r150+) ES-module scenes—hero sections, interactive product viewers, particle backdrops, GLTF showcases, or quick…
Об этом скилле
Three.js Builder
A Codex-ready framework for shipping elegant, performant Three.js web experiences with modern ES modules.
Reference Files
Read the appropriate reference when working on specific topics:
| Topic | File | Use When |
|---|---|---|
| GLTF Models | references/gltf-loading-guide.md |
Loading, caching, cloning 3D models, SkeletonUtils |
| Reference Frames | references/reference-frame-contract.md |
Calibration, anchoring, axis correctness, debugging |
| Game Development | references/game-patterns.md |
State machines, animation switching, parallax, pooling |
| Advanced Topics | references/advanced-topics.md |
Post-processing, shaders, physics, instancing |
| Calibration Helpers | scripts/README.md |
GLTF calibration helper installation and usage |
Philosophy: Start from Scene Intent
Three.js work lives inside a scene graph: parents transform children, and everything in scene is rendered.
Before writing code, ask:
- What is the core visual element or metaphor (hero object, particle field, data glyph)?
- How should visitors manipulate or perceive it (static hero, orbit control, camera-relative movement)?
- What level of hardware/performance do we target (mobile hero snippet vs. desktop interactive)?
- Which animation best communicates the story (continuous rotation, bobbing, interaction-driven)?
Core principles:
- Scene graph first – model hierarchy and transforms before materials.
- Intent-driven primitives – boxes, spheres, torus, planes cover 80% of hero cases; reach for GLTF only when fidelity demands it.
- Animation as transformation – treat animation as evolving position/rotation/scale with
renderer.setAnimationLoop. - Performance through restraint – reuse geometries/materials, clamp device pixel ratio, keep draw calls low.
Foundational Principle: Lock a “Reference Frame Contract” First
Most Three.js bugs are not “rendering bugs” — they’re reference-frame bugs: wrong origin, wrong up-axis assumption, wrong forward direction, wrong “ground = y=0” semantics, wrong color space, or wrong loading environment.
Treat your scene like a contract you must prove once, then never violate:
- Axes: which way is forward for gameplay, and how do models map to it?
- Anchors: what does “on the ground” mean for each asset class?
- Units: what is 1 unit (meter-ish? pixel-ish?) and how do imported assets fit?
- Color: are textures and output color space correct?
If you don’t lock this contract early, you will chase symptoms: inverted movement, floating/sinking models, “wrongly loaded” textures, and end-state hangs caused by tangled state transitions.
The Calibration Pass (do this before building gameplay)
Do a 60-second calibration scene and lock constants (axes/anchors/scale/color) before shipping gameplay systems.
Deep guide + troubleshooting map: references/reference-frame-contract.md
Mesh Forward Verification (Do Not Guess)
Don’t “eyeball rotate until it looks right” and don’t assume “GLTF faces -Z”.
In the calibration scene, prove each imported model’s forward direction and lock it as a constant (global MODEL_YAW_OFFSET or per-asset yawOffset).
If you want a reusable helper module instead of hand-rolling arrows/box helpers each time:
- Install (repo-scoped): run
python3 .codex/skills/threejs-builder/scripts/install-gltf-calibration-helpers.py --out ./gltf-calibration-helpers.mjs - Install (from within the skill folder): run
python3 scripts/install-gltf-calibration-helpers.py --out ./gltf-calibration-helpers.mjs - Use: import and call
attachGltfCalibrationHelpers(...)(seescripts/README.md)
Minimal check:
// In Three.js, an Object3D’s "forward" is its local -Z axis.
const localForward = new THREE.Vector3(0, 0, -1);
// Attach a visible arrow to the model so you can *see* its forward.
const forwardArrow = new THREE.ArrowHelper(localForward, new THREE.Vector3(0, 1.2, 0), 1.2, 0xff00ff);
modelRoot.add(forwardArrow);
// Also log the current world-forward for debugging (post-normalization and post-rotation).
const worldForward = new THREE.Vector3();
modelRoot.getWorldDirection(worldForward);
console.log('model world forward (-Z):', worldForward.toArray());
Then decide:
- If the mesh runs backward, set
yawOffset = Math.PI. - If it faces the camera (common symptom), your yaw convention is wrong—flip the offset and re-check.
Coordinate System & Camera Awareness (Critical)
Three.js is right-handed: +X right, +Y up, +Z toward the camera. Many GLTF assets are authored facing -Z, but verify per pack (don’t assume). Camera-relative controls must project the camera forward vector onto the XZ plane, normalize, then derive the right vector via a right-handed cross product to avoid inverted WASD when the camera orbits.
const forward = new THREE.Vector3();
camera.getWorldDirection(forward);
forward.y = 0;
forward.normalize();
// Righ
Установить threejs-builder в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл threejs-builder?
Design and implement lightweight Three.js (r150+) ES-module scenes—hero sections, interactive product viewers, particle backdrops, GLTF showcases, or quick prototypes—whenever prompts mention 'three.js/threejs scene', '3D web background', 'orbit controls', or 'WebGL demo'.
Как установить скилл threejs-builder?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл threejs-builder запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic