Agent skill

Threejs Scene Setup

by corosolto in corosolto/client

Stand up a three.js scene: import maps and the three/addons path, the Scene/PerspectiveCamera/WebGLRenderer trio, the setAnimationLoop render loop, responsive resize, and OrbitControls.

Apache-2.0Auto-check passedGame Development

Install Threejs Scene Setup

skills CLI
$ npx skills add corosolto/client --skill threejs-scene-setup -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install corosolto/client threejs-scene-setup --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/corosolto/client.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/threejs-scene-setup .claude/skills/threejs-scene-setup && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
threejs-scene-setup
GitHub stars
257
Used in
1 other repo
Token cost
~1.7k tokens
SKILL.md length
470 words
Files
2 (incl. references)
Skills in repo
20
Repo updated
First seen
Licence
Apache-2.0

At a glance

Stand up a three.js scene: import maps and the three/addons path, the Scene/PerspectiveCamera/WebGLRenderer trio, the setAnimationLoop render loop, responsive resize, and OrbitControls.

  • Works in 5 steps: HTML import map + module entry (no… → Scene + camera + renderer → The render loop (setAnimationLoop + Clock) → …
  • Debugging a three.js app — when the user mentions three.js
  • SKILL.md covers When to use, Core workflow, Patterns and Pitfalls, plus 2 more sections
  • Calls npm; reaches cdn.jsdelivr.net

What it does

Threejs Scene Setup is an agent skill from corosolto/client. Stand up a three.js scene: import maps and the three/addons path, the Scene/PerspectiveCamera/WebGLRenderer trio, the setAnimationLoop render loop, responsive resize, and OrbitControls. Use when starting or debugging a three.js app — when the user mentions three.js, THREE.Scene, WebGLRenderer, PerspectiveCamera, the render loop, resizing, or OrbitControls. For models use threejs-gltf-loading; for materials/lights use threejs-materials-lighting.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/scene-graph.md`). Compatibility notes: three.js r165+ (verified against r184; ES modules + import maps)

It sits in Game Development, covering 3D graphics and WebGL. It works with Three.js. The repository describes itself as: FPS satírico de navegador: 5 facções brasileiras caricatas, 44 personagens, 5 mapas e 26 armas — rounds e Capture the Flag contra bots, direto na aba, sem instalar nada. Three.js… The licence is Apache-2.0.

When your agent uses it

  • Debugging a three.js app — when the user mentions three.js
  • PerspectiveCamera
  • The render loop

Example prompts

  • “/threejs-scene-setup”

Requirements

  • Node.js
  • Compatibility (from SKILL.md): three.js r165+ (verified against r184; ES modules + import maps)

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. HTML import map + module entry (no bundler)
  2. Scene + camera + renderer
  3. The render loop (setAnimationLoop + Clock)
  4. Responsive resize
  5. OrbitControls (orbit / pan / zoom)

What it can do on your machine

Read from SKILL.md and the folder at commit 0d37b27. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • cdn.jsdelivr.net

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    three.js r165+ (verified against r184; ES modules + import maps)

    From compatibility in the SKILL.md frontmatter.

Context cost

Threejs Scene Setup loads about 1.7k tokens when it runs, and up to ~2.7k if it reads all its reference files. Until then it costs about 117 tokens; SKILL.md has 470 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~117
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from corosolto/client at commit 0d37b27, republished under its Apache-2.0 licence (© corosolto). 470 words, ~1,665 tokens.

Download SKILL.mdSave it as .claude/skills/threejs-scene-setup/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
threejs-scene-setup
description
Stand up a three.js scene: import maps and the three/addons path, the Scene/PerspectiveCamera/WebGLRenderer trio, the setAnimationLoop render loop, responsive resize, and OrbitControls. Use when starting or debugging a three.js app — when the user mentions three.js, THREE.Scene, WebGLRenderer, PerspectiveCamera, the render loop, resizing, or OrbitControls. For models use threejs-gltf-loading; for materials/lights use threejs-materials-lighting.
compatibility
three.js r165+ (verified against r184; ES modules + import maps)
license
Apache-2.0
metadata.engine
threejs
metadata.category
web-engines
metadata.difficulty
beginner

three.js Scene Setup

Create the foundation of a three.js app: module loading, the scene/camera/renderer trio, the render loop, responsive resizing, and camera controls. Patterns target r165+ and are verified against r184.

When to use

  • Use when bootstrapping a three.js scene, fixing a blank/black canvas, making the canvas responsive, setting up the animation loop, or adding OrbitControls.
  • Use when package.json depends on three and code does import * as THREE from 'three'.

When not to use: loading .gltf/.glb models or skinned animation → threejs-gltf-loading. Materials, lights, shadows, environment maps → threejs-materials-lighting. 2D rendering → pixijs-rendering.

Core workflow

  1. Load three.js as an ES module with an import map. Since r147 the bare specifier 'three' and 'three/addons/' must be mapped (in HTML or by a bundler). Addons (controls, loaders) live under three/addons/....
  2. Create the trio. A Scene (root of the graph), a PerspectiveCamera(fov, aspect, near, far) moved back from the origin, and a WebGLRenderer whose domElement is in the DOM. Set size and pixelRatio.
  3. Add a mesh. new Mesh(geometry, material) and scene.add(mesh). With a lit material you also need a light (see threejs-materials-lighting).
  4. Drive a render loop with renderer.setAnimationLoop(fn). It's the modern, WebXR-/WebGPU-safe replacement for hand-rolled requestAnimationFrame. Use a Clock for delta time.
  5. Handle resize so the camera aspect and renderer match the canvas; update camera.aspect, call updateProjectionMatrix(), and renderer.setSize(...).
  6. Add OrbitControls for orbit/pan/zoom while developing. Confirm something actually renders (a lit cube, the controls responding) before assuming success.

Patterns

1. HTML import map + module entry (no bundler)
html
<canvas id="c"></canvas>
<script type="importmap">
{
  "imports": {
    "three": "https://cdn.jsdelivr.net/npm/three@0.184.0/build/three.module.js",
    "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.184.0/examples/jsm/"
  }
}
</script>
<script type="module" src="./main.js"></script>

With a bundler (Vite/webpack), skip the import map and just npm i three; the same import statements resolve.

2. Scene + camera + renderer
js
// main.js
import * as THREE from 'three';

const canvas = document.querySelector('#c');
const renderer = new THREE.WebGLRenderer({ canvas, antialias: true });
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2)); // cap for perf
renderer.setSize(window.innerWidth, window.innerHeight);

const scene = new THREE.Scene();
scene.background = new THREE.Color(0x101018);

const camera = new THREE.PerspectiveCamera(
  60,                                   // vertical field of view (degrees)
  window.innerWidth / window.innerHeight, // aspect
  0.1,                                  // near
  100                                   // far
);
camera.position.set(3, 2, 5);
camera.lookAt(0, 0, 0);

const cube = new THREE.Mesh(
  new THREE.BoxGeometry(1, 1, 1),
  new THREE.MeshNormalMaterial()        // unlit; shows orientation without a light
);
scene.add(cube);
3. The render loop (setAnimationLoop + Clock)
js
const clock = new THREE.Clock();

renderer.setAnimationLoop(() => {
  const dt = clock.getDelta();          // seconds since last frame
  cube.rotation.x += dt;                // frame-rate independent
  cube.rotation.y += dt * 0.7;
  renderer.render(scene, camera);
});
// renderer.setAnimationLoop(null); // stop the loop
4. Responsive resize
js
function onResize() {
  const w = window.innerWidth, h = window.innerHeight;
  camera.aspect = w / h;
  camera.updateProjectionMatrix();      // required after changing aspect
  renderer.setSize(w, h);
}
window.addEventListener('resize', onResize);
5. OrbitControls (orbit / pan / zoom)
js
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';

const controls = new OrbitControls(camera, renderer.domElement);
controls.enableDamping = true;          // inertial feel
controls.target.set(0, 0, 0);

renderer.setAnimationLoop(() => {
  controls.update();                    // needed every frame when damping is on
  renderer.render(scene, camera);
});
Show full SKILL.md (187 more words)Show less

Pitfalls

  • Failed to resolve module specifier "three" → missing import map (or bundler config). Map both "three" and "three/addons/"; addon paths must end with /.
  • Black canvas, no errors → camera is at the origin (inside/behind the object), or you used a lit material (MeshStandardMaterial) with no light. Move the camera back; use MeshNormalMaterial/MeshBasicMaterial to verify geometry first.
  • Nothing animates → you never called renderer.render inside the loop, or you call setAnimationLoop but render outside it.
  • Stretched / squashed view on resize → you resized the renderer but didn't update camera.aspect + updateProjectionMatrix().
  • Blurry or jagged on HiDPI → set renderer.setPixelRatio(...); cap it (≈2) so 4K/retina screens don't tank performance.
  • OrbitControls feel dead → with enableDamping = true you must call controls.update() every frame.
  • Old tutorials use <script src="three.min.js"> → since r147 three.js ships ES modules only; use type="module" + import maps.

References

  • For coordinate conventions, the scene-graph (Group, parent/child transforms, Object3D add/remove), OrthographicCamera for 2.5D, and disposing of geometries/materials/textures to avoid leaks, read references/scene-graph.md.
  • threejs-materials-lighting — give surfaces a lit look (lights, shadows, PBR).
  • threejs-gltf-loading — load 3D models and play their animations.
  • pixijs-rendering — 2D rendering in the browser.
  • fps-shooter — a 3D genre template that composes three.js skills.

© corosolto, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in .agents/skills/threejs-scene-setup of corosolto/client.

  • SKILL.md
  • references/scene-graph.md

Open the folder on GitHubat commit 0d37b27

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in corosolto/client, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Threejs Scene Setup next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Threejs Scene Setup compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Threejs Scene Setup this skillcorosolto/client2571 repos~1.7kAutomated safety check: PassApache-2.0
Image to Three.js Modelimg2threejs/img2threejs18k1 repos~8.2kAutomated safety check: PassApache-2.0
Web CloneJane-xiaoer/claude-skill-web-clone1k2 repos~2.7kAutomated safety check: PassMIT
Threejs Game Directormajidmanzarpour/threejs-game-skills2.4k—~2.2kAutomated safety check: PassMIT
Threejs Gameplay Systemsvalkor-ai/loom1.2k1 repos~1.4kAutomated safety check: PassApache-2.0
Threejs World Generationcalesthio/OpenMontage65k—~2kAutomated safety check: PassAGPL-3.0

Similar skills

  • Image to Three.js Model

    img2threejs/img2threejs

    Rebuilds the object in a reference image as a procedural, animation-ready Three.js model written entirely in code, using staged sculpting with quality checks.

    18k GitHub starsUsed in 1 repo~8.2k tokens
    Game DevelopmentAuto-check passed
  • Web Clone

    Jane-xiaoer/claude-skill-web-clone

    网站复刻 / 克隆方法论。USE WHEN 用户说 复刻网站、克隆网站、clone website、抄个站、仿站、 照着这个站做一个、reproduce site、还原某个网页效果、把这个站搬下来改成我的、 复刻某个交互/WebGL/Canvas/Three.js 效果。提供「先拿真源码 → 判路径 → 逆向拆解 → 搭工程 → 替换内容」的可移植决策树,覆盖静态站 /…

    1k GitHub starsUsed in 2 repos~2.7k tokens
    Game DevelopmentAuto-check passed
  • Threejs Game Director

    majidmanzarpour/threejs-game-skills

    Entrypoint for building, upgrading, and finishing Three.js browser games.

    2.4k GitHub stars~2.2k tokensUpdated 10 days ago
    Game DevelopmentAuto-check passed
  • Build and iterate playable Three.js game systems: starter scaffold, architecture, design briefs, core loops, level and encounter design, entities, input, camera, collision and physics, scoring…

    1.2k GitHub starsUsed in 1 repo~1.4k tokens
    Game DevelopmentAuto-check passed
  • Threejs World Generation

    calesthio/OpenMontage

    Build deterministic, editable, free-viewpoint Three.js worlds from text or structured briefs.

    65k GitHub stars~2k tokensUpdated 5 days ago
    Game DevelopmentAuto-check passed
  • 3Dviz Pro Max Scene Builder

    viettranx/3dviz-pro-max

    Guides building an expressive 3D scene in Three.js or Blender by reasoning through intent, object construction and scientific grounding before using a catalog of recipes and kits.

    683 GitHub stars~2.8k tokensUpdated 27 days ago
    Game DevelopmentAuto-check passed

More from corosolto/client

All 20 skills in this repo
  • Threejs Gameplay Systems

    corosolto/client

    Build and iterate playable Three.js game systems. An agent skill from corosolto/client.

    257 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Threejs Gltf Loading

    corosolto/client

    Load glTF/GLB models in three.js with GLTFLoader and play their skinned animations with AnimationMixer, including DRACO/Meshopt-compressed meshes and KTX2 textures.

    257 GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • Threejs 3D Generator

    corosolto/client

    Generate, texture, rig, animate, stylize, convert, and download 3D assets for Three.js games using the Tripo API.

    257 GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed
  • Light and shade a three.js scene: choose materials (MeshStandardMaterial PBR vs unlit MeshBasicMaterial), add ambient/hemisphere/directional/point/spot lights, turn on shadow maps, and use an…

    257 GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • Threejs Game Director

    corosolto/client

    Primary entrypoint for complete Three.js browser game creation and premium iteration.

    257 GitHub stars~2.8k tokensUpdated yesterday
    Auto-check passed
  • Gauntlet Fps

    corosolto/client

    Roda o Gauntlet Loop do CS BRASIL / CORO SOLTO — o ciclo crítico-adversarial → builders em paralelo → captura medida → verificação A/B → caçador de regressões que melhora gráficos, mapas, armas, UI…

    257 GitHub stars~2.6k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Threejs Scene Setup

What does Threejs Scene Setup do?

Stand up a three.js scene: import maps and the three/addons path, the Scene/PerspectiveCamera/WebGLRenderer trio, the setAnimationLoop render loop, responsive resize, and OrbitControls. Threejs Scene Setup is an agent skill from corosolto/client.js scene: import maps and the three/addons path, the Scene/PerspectiveCamera/WebGLRenderer trio, the setAnimationLoop render loop, responsive resize, and OrbitControls.

When should I use Threejs Scene Setup?

Threejs Scene Setup fits situations like: debugging a three.js app — when the user mentions three.js; perspectiveCamera; the render loop.

How do I install Threejs Scene Setup in Claude Code?

Run `npx skills add corosolto/client --skill threejs-scene-setup -a claude-code`. Or copy the skill folder (.agents/skills/threejs-scene-setup in corosolto/client) into .claude/skills/threejs-scene-setup in your project. Claude Code loads it when a task matches its description.

How do I install Threejs Scene Setup in Codex?

Run `npx skills add corosolto/client --skill threejs-scene-setup -a codex`. Or copy the skill folder (.agents/skills/threejs-scene-setup in corosolto/client) into .agents/skills/threejs-scene-setup in your project. Codex loads it when a task matches its description.

Can I use Threejs Scene Setup in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add corosolto/client --skill threejs-scene-setup -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/threejs-scene-setup, .gemini/skills/threejs-scene-setup, .github/skills/threejs-scene-setup and .opencode/skills/threejs-scene-setup in your project.

What does Threejs Scene Setup need to run?

Going by SKILL.md and its folder, Threejs Scene Setup needs the command-line tools its instructions call (npm). Our summary lists: Node.js. Compatibility (from SKILL.md): three.js r165+ (verified against r184; ES modules + import maps).

Does Threejs Scene Setup access the network?

SKILL.md names 1 domain. In commands or code: cdn.jsdelivr.net; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Threejs Scene Setup safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Threejs Scene Setup use?

Threejs Scene Setup is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Threejs Scene Setup use?

About 1.7k tokens (SKILL.md is roughly 6.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1k tokens, read only when the agent opens those files.

What are the alternatives to Threejs Scene Setup?

Skills that share tags, products or a category with Threejs Scene Setup: Image to Three.js Model (img2threejs/img2threejs, 18k stars), Web Clone (Jane-xiaoer/claude-skill-web-clone, 1k stars), Threejs Game Director (majidmanzarpour/threejs-game-skills, 2.4k stars) and Threejs Gameplay Systems (valkor-ai/loom, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Threejs Scene Setup?

corosolto (a GitHub organization) maintains it in corosolto/client, which has 257 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on October 7, 2026.

Source: corosolto/client on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.