threejs-model-optimize

Installation
SKILL.md

Optimize a model

gltf-transform optimize with default flags joins named meshes, merges materials into palettes and flattens the hierarchy. That is right for scenery and silently breaks any code that finds parts by name, swaps materials or attaches objects to nodes. Pick a preset from what the app does with the model, then check that the names it uses survived.

Paths: <this-skill-dir> is the directory containing this SKILL.md and <inspect-skill-dir> the one containing threejs-model-inspect's; replace them with absolute paths and quote them. The script needs Node 22+ and npx with network access; its before/after report needs threejs-model-inspect installed next to this skill.

Process

  1. Run threejs-model-inspect on the source and note where the bytes are (geometry, textures, animation) and which names, materials and clips the app references (search the code for getObjectByName, nodes., materials., clip names). Check for an existing pipeline first (package.json scripts running gltfpack or gltf-transform, a generator of gltfpack in the report): files it already compressed rarely shrink further. Improve that pipeline's flags instead of replacing it, and keep the original whenever the script reports no meaningful gain.
  2. Choose a preset:
Installs
8
First Seen
Oct 27, 2026