full-stack-skills/threejs-skills

threejs-dev-setup

Bootstrap and toolchain guidance for three.js applications using npm, Vite/Webpack/Rollup, bare ESM import maps, and TypeScript.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/full-stack-skills/threejs-skills --skill threejs-dev-setup

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

When to use this skill

ALWAYS use this skill when the user mentions:

  • Creating or configuring a new three.js project, Vite/Webpack/Rollup entry, or browser importmap
  • Installing the three package, aligning version with documentation, or TypeScript setup (@types/three where applicable)
  • Import errors for three/addons/..., examples/jsm, ESM vs CJS interop, or bare specifier resolution

IMPORTANT: this skill vs runtime topics

  • threejs-dev-setup = install paths, bundler, module graph, and where to import addons from.
  • threejs-renderers = WebGLRenderer / WebGPURenderer, canvas, pixel ratio, render loop—after the project loads.
  • threejs-loaders = GLTFLoader, DRACOLoader, progress callbacks—after imports resolve.

Trigger phrases include:

  • "vite three.js", "webpack three", "import map", "three/addons", "cannot find module", "jsm"
  • "新建项目", "安装 three", "找不到模块", "ESM", "TypeScript three"

How to use this skill

  1. Confirm delivery model: SPA bundler (Vite/Webpack), Node tooling, or static HTML with importmap—each affects how three/addons/ resolves.
  2. Pin `three` version to a release compatible with the docs the user cites; note that addon paths follow the published package layout.
  3. Show canonical imports: core from three; controls/loaders/effects from three/addons/... (mapped to examples/jsm in source tree). See examples/workflow-scaffold.md.
  4. Minimal loop: create renderer + scene + camera + one mesh; requestAnimationFrame—enough to verify toolchain without duplicating threejs-renderers depth.
  5. TypeScript: enable moduleResolution appropriate for bundler; reference types from three package typings; avoid duplicating global script tag patterns unless user targets no-bundler HTML.
  6. On failure: distinguish missing dependency vs wrong path vs SSR context (no window/document).
  7. Deepening: link user to three.js manual first chapter after scaffold works.

Doc map (official)

Docs sectionRepresentative links
Manual (getting started)https://threejs.org/manual/
Docs indexhttps://threejs.org/docs/
Package / install contexthttps://www.npmjs.com/package/three

Scope

  • In scope: npm/install, bundlers, import maps, TypeScript basics for three, addon import paths, minimal verification snippet.
  • Out of scope: WebGL theory, full render target or post stack (threejs-renderers, threejs-postprocessing), physics, deployment beyond "build runs".

Common pitfalls and best practices

  • Mixing multiple three copies in one page breaks singletons; dedupe with bundler aliases.
  • Importing addons from deep node_modules/.../examples/jsm paths is fragile; prefer package exports three/addons/... when available.
  • Always match r152+ style color management docs when giving snippet defaults (output color space)—point to threejs-renderers/textures for details.
  • SSR frameworks need dynamic import or client-only components for WebGL context.

Documentation and version

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.

Agent response checklist

When answering under this skill, prefer responses that:

  1. Name the bundler or runtime (Vite, Webpack, bare ESM, importmap) and the intended three version.
  2. Link https://threejs.org/manual/ and/or https://threejs.org/docs/ for authoritative setup context.
  3. Distinguish threejs-dev-setup (resolution) from threejs-renderers (runtime API) failures.
  4. Never assume global script tags unless the user explicitly uses CDN/no-bundler HTML.
  5. Recommend deduplicating three in package.json / lockfile when duplicate singleton issues appear.

References

  • https://threejs.org/manual/
  • https://threejs.org/docs/
  • https://www.npmjs.com/package/three

Keywords

English: three.js, vite, webpack, rollup, import map, typescript, npm, three/addons, examples jsm, module resolution, scaffold

中文: three.js 安装、构建、importmap、模块解析、three/addons、脚手架、Vite、Webpack

같은 저장소의 Skills

더 많은 Skills

모든 Skills
full-stack-skills
커뮤니티

threejs-audio

three.js audio spatialization: AudioListener attached to camera rig, Audio and PositionalAudio sources, AudioAnalyser for FFT/time-domain data, and integration with Web Audio API contexts; AudioLoader is referenced from threejs-loaders for file decoding. Use when placing 3D sound, configuring panner parameters, or visualization; not a replacement for full game audio middleware.

1시간 설치 수
3
GitHub Stars
14
업데이트
10월 3일
full-stack-skills
커뮤니티

threejs-camera

three.js cameras: Camera base, PerspectiveCamera, OrthographicCamera, CubeCamera, ArrayCamera, StereoCamera; projection matrices, aspect, FOV, orthographic frustum sizes, near/far planes, and dynamic environment maps with CubeCamera. Use when placing views, rendering reflections, or multi-view splits; for XR projections and eye matrices use threejs-webxr; for post pass camera tricks use threejs-postprocessing alongside threejs-renderers.

1시간 설치 수
3
GitHub Stars
14
업데이트
10월 3일
full-stack-skills
커뮤니티

threejs-controls

Addon camera and object manipulation controls: OrbitControls, MapControls, FlyControls, FirstPersonControls, TrackballControls, ArcballControls, DragControls, PointerLockControls, TransformControls; damping, target focal point, and integration with the animation loop. Use for editor-style navigation and gizmos—not a full game character controller stack; pair with Raycaster selection patterns in threejs-objects when transforming selections.

1시간 설치 수
3
GitHub Stars
14
업데이트
10월 3일
full-stack-skills
커뮤니티

threejs-geometries

three.js geometry authoring: BufferGeometry, typed BufferAttribute and interleaved layouts, InstancedBufferGeometry, primitive Geometries (box/sphere/torus/etc.), ExtrudeGeometry and Shape/Path/Curve from Extras, WireframeGeometry, and addon geometries such as TextGeometry, DecalGeometry, RoundedBoxGeometry. Covers merged scope of procedural curves and extrusion formerly split as extras-curves; for animation morph targets see threejs-animation; for merging buffers utilities see official BufferGe

1시간 설치 수
3
GitHub Stars
14
업데이트
10월 3일