skills/tresjs/SKILL.md
Use when building 3D scenes with TresJS (Vue Three.js) - provides TresCanvas, composables (useTres, useLoop), Cientos helpers (OrbitControls, useGLTF, Environment), and post-processing effects
npx skillsauth add onmax/nuxt-skills tresjsInstall 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.
Vue 3 framework for building 3D scenes with Three.js. Declarative components that wrap Three.js objects.
Packages: @tresjs/core (required), @tresjs/cientos (helpers), @tresjs/post-processing (effects)
# Core (required)
pnpm add three @tresjs/core
# Helpers - controls, loaders, materials, staging
pnpm add @tresjs/cientos
# Post-processing effects
pnpm add @tresjs/post-processing
| Working on... | Load file | | ---------------------------- | ---------------------- | | TresCanvas, useTres, useLoop | references/core.md | | Controls, loaders, materials | references/cientos.md | | Bloom, glitch, DOF effects | references/effects.md | | Common patterns, recipes | references/cookbook.md |
Load based on your task:
DO NOT load all files at once. Load only what's relevant.
Root component that creates WebGL renderer and scene:
<script setup lang="ts">
import { TresCanvas } from '@tresjs/core'
</script>
<template>
<TresCanvas shadows alpha>
<TresPerspectiveCamera :position="[5, 5, 5]" />
<TresMesh>
<TresBoxGeometry />
<TresMeshStandardMaterial color="orange" />
</TresMesh>
<TresAmbientLight :intensity="0.5" />
<TresDirectionalLight :position="[3, 3, 3]" :intensity="1" />
</TresCanvas>
</template>
All Three.js classes available as Vue components with Tres prefix:
THREE.PerspectiveCamera → <TresPerspectiveCamera />THREE.Mesh → <TresMesh />THREE.BoxGeometry → <TresBoxGeometry />THREE.MeshStandardMaterial → <TresMeshStandardMaterial />Constructor arguments via :args prop:
<TresPerspectiveCamera :args="[75, 1, 0.1, 1000]" />
Props are reactive - changes update the 3D scene:
<script setup>
const color = ref('orange')
const position = ref([0, 0, 0])
</script>
<template>
<TresMesh :position="position">
<TresMeshStandardMaterial :color="color" />
</TresMesh>
</template>
Inject existing Three.js objects directly:
<script setup>
import { useGLTF } from '@tresjs/cientos'
const { scene } = await useGLTF('/model.glb')
</script>
<template>
<primitive :object="scene" />
</template>
references/core.md - TresCanvas props, useTres, useLoop, useGraph, events, performance
references/cientos.md - OrbitControls, useGLTF, useTexture, Environment, Sky, materials, shapes
references/effects.md - EffectComposer vs EffectComposerPmndrs, bloom, glitch, DOF, effect stacking
references/cookbook.md - Load 3D model, camera with controls, animation loop, post-processing
development
Use when working with VueUse composables - track mouse position with useMouse, manage localStorage with useStorage, detect network status with useNetwork, debounce values with refDebounced, and access browser APIs reactively. Check VueUse before writing custom composables - most patterns already implemented.
development
Write, rewrite, review, and organize developer-facing documentation for web software projects. Use when creating or improving README files, docs homepages, quickstarts, tutorials, how-to guides, API/reference pages, conceptual explanations, migration guides, or troubleshooting content for frontend, backend, full-stack, SDK, API, or framework-based web products. This skill applies strong information architecture, task-first page structure, clear voice, runnable examples, version and prerequisite hygiene, accessibility rules, and docs-as-code maintenance habits. Do not use it for marketing copy, legal text, or non-technical customer-support articles.
development
Use when editing .vue files, creating Vue 3 components, writing composables, or testing Vue code - provides Composition API patterns, props/emits best practices, VueUse integration, and reactive destructuring guidance
development
Use when writing unit/integration tests for Vite projects - configure vitest.config.ts, write test suites with describe/it, create mock implementations with vi.fn and vi.mock, set up code coverage thresholds, and run tests in parallel