skills/threejs-skills/threejs-dev-setup/SKILL.md
Bootstrap and toolchain guidance for three.js applications using npm, Vite/Webpack/Rollup, bare ESM import maps, and TypeScript. Covers canonical import paths for three core versus three/addons/ (examples/jsm re-exports), version alignment with threejs.org docs, and fixing module not found for loaders and controls. Use when scaffolding a new 3D project, migrating bundler, or debugging resolution of addons; do not use for rendering API details (see threejs-renderers) or asset loading logic (see threejs-loaders).
npx skillsauth add partme-ai/full-stack-skills threejs-dev-setupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
ALWAYS use this skill when the user mentions:
importmapthree package, aligning version with documentation, or TypeScript setup (@types/three where applicable)three/addons/..., examples/jsm, ESM vs CJS interop, or bare specifier resolutionIMPORTANT: this skill vs runtime topics
WebGLRenderer / WebGPURenderer, canvas, pixel ratio, render loop—after the project loads.GLTFLoader, DRACOLoader, progress callbacks—after imports resolve.Trigger phrases include:
importmap—each affects how three/addons/ resolves.three version to a release compatible with the docs the user cites; note that addon paths follow the published package layout.three; controls/loaders/effects from three/addons/... (mapped to examples/jsm in source tree). See examples/workflow-scaffold.md.moduleResolution appropriate for bundler; reference types from three package typings; avoid duplicating global script tag patterns unless user targets no-bundler HTML.window/document).npm create vite@latest my-3d-app -- --template vanilla && cd my-3d-app
npm install three
// main.js — canonical imports and minimal render loop
import * as THREE from 'three';
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, innerWidth / innerHeight, 0.1, 100);
camera.position.z = 3;
const renderer = new THREE.WebGLRenderer();
renderer.setSize(innerWidth, innerHeight);
document.body.appendChild(renderer.domElement);
const mesh = new THREE.Mesh(
new THREE.BoxGeometry(),
new THREE.MeshStandardMaterial({ color: 0x00ff00 })
);
scene.add(mesh, new THREE.AmbientLight(0xffffff, 0.5));
renderer.setAnimationLoop(() => renderer.render(scene, camera));
| Docs section | Representative links | |--------------|----------------------| | Manual (getting started) | https://threejs.org/manual/ | | Docs index | https://threejs.org/docs/ | | Package / install context | https://www.npmjs.com/package/three |
three copies in one page breaks singletons; dedupe with bundler aliases.node_modules/.../examples/jsm paths is fragile; prefer package exports three/addons/... when available.Toolchain and import paths follow the three npm package version the user installs. The Manual and docs are updated with the library; addon paths (three/addons/...) must match the package layout for that release—when in doubt, cite the version number and the exact import line from the current docs.
When answering under this skill, prefer responses that:
importmap) and the intended three version.three in package.json / lockfile when duplicate singleton issues appear.English: three.js, vite, webpack, rollup, import map, typescript, npm, three/addons, examples jsm, module resolution, scaffold
中文: three.js 安装、构建、importmap、模块解析、three/addons、脚手架、Vite、Webpack
development
Provides per-component and per-API examples with cross-platform compatibility details for uni-app, covering built-in components, uni-ui components, and APIs (network, storage, device, UI, navigation, media). Use when the user needs official uni-app components or APIs, wants per-component examples with doc links, or needs platform compatibility checks.
tools
Creates new uni-app projects via the official CLI or HBuilderX with Vue 2/Vue 3 template selection, manifest.json and pages.json configuration, and directory structure setup. Use when the user wants to scaffold a new uni-app project, initialize project files with a single command, or set up the development environment.
tools
Browses, installs, configures, and manages plugins from the uni-app plugin market (ext.dcloud.net.cn) including component plugins, API plugins, and template plugins with dependency handling. Use when the user needs to find and install uni-app plugins, configure plugin settings, manage plugin dependencies, or integrate third-party components.
tools
Develops native Android and iOS plugins for uni-app including module creation, JavaScript-to-native communication, and plugin packaging for distribution. Use when the user needs to build custom native modules, extend uni-app with native capabilities (camera, Bluetooth, sensors), or create publishable native plugins.