Prepares 3D models, textures, HDR maps and audio for an IWSDK WebXR app on Meta Quest: what IWSDK 1.x loads through its manifest (Draco and KTX2 yes, Meshopt no), loading Meshopt or standalone KTX2 with your own loader and local decoders, FBX/OBJ conversion in Blender, IWSDK-safe gltf-transform flags (`--compress draco`, `--texture-compress ktx2`) and scripting traps, a bundled checker script, sourcing and licensing assets (metavr asset search, @iwsdk/example-assets, Kenney, Quaternius), and registering them in `src/assets.ts` with the right load priority. Use when the user says "add this model", "import FBX", "optimize GLB", "compress textures", "KTX2", "Draco", "meshopt", "model won't load", "setMeshoptDecoder must be called", "load assets offline", "model renders black after merging materials", "slow to load", "asset too big", or asks about Meta Spatial Editor scenes.
Ships in IWSDK Core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Made by Navid Mirzaaghazadeh · part of iwsdk-webxr-skills · MIT
IWSDK 1.x doesn't optimise assets for you: "Vite copies files from public/ without rewriting
them" (guide 08). The @iwsdk/vite-plugin-gltf-optimizer was retired in 0.5. So every model and
texture should be optimised before it goes into public/.
Hand-offs: building a procedural model in code → iwsdk-build-model; placing assets in a
scene → iwsdk-compose-scene; frame-time budgets → iwsdk-performance.
npx @gltf-transform/cli … (downloads a package) and before installing
KTX-Software or Blender.name.opt.glb next to it, compare, then swap.node <this skill>/scripts/check-gltf.mjs file.glb.AssetType | Loader (IWSDK 1.0.1) | Use for |
|---|---|---|
GLTF | three GLTFLoader + DRACOLoader + KTX2Loader | .glb / .gltf models (the only supported 3D format) |
Texture | TextureLoader | JPG, PNG, WebP images. Not .ktx2: put KTX2 textures inside a glTF instead |
HDRTexture | HDRLoader / EXRLoader | .hdr / .exr environment maps |
Audio | AudioLoader | MP3, WAV, OGG (IWSDK guide 04) |
UIKitML | runtime parser | public/ui/*.uikitml |
glTF extensions (super-three 0.181.0 GLTFLoader, as wired by IWSDK):
KHR_draco_mesh_compression, KHR_texture_basisu (KTX2), KHR_mesh_quantization,
EXT_mesh_gpu_instancing, EXT_texture_webp, EXT_texture_avif, KHR_texture_transform,
KHR_lights_punctual, KHR_materials_* (unlit, emissive_strength, clearcoat, sheen,
transmission, volume, ior, specular, iridescence, anisotropy, dispersion), EXT_materials_bump.EXT_meshopt_compression. IWSDK's loader sets no Meshopt
decoder, so three throws "setMeshoptDecoder must be called before loading compressed files".
This matters because gltf-transform optimize uses Meshopt by default. Your own loader
can read these files (§1a).https://unpkg.com/[email protected]/examples/jsm/libs/…; IWSDK 1.0.1 has no project setting for
local copies. The app needs network access to unpkg.com (and to cdn.jsdelivr.net for
controller models).MAX_SCENE_MODEL_PAYLOAD_BYTES, GLTFLoadTransaction).For code-placed art (a level, enemies, props spawned by systems) you can skip the manifest and
load with three's loaders directly. That reads Meshopt files and standalone .ktx2 textures,
and every decoder comes from your own origin, so the app loads with no unpkg.com access.
import type { WebGLRenderer } from '@iwsdk/core';
// Not re-exported by @iwsdk/core. The scaffold's `resolve.dedupe: ['three', ...]` in
// vite.config.ts makes these share IWSDK's Three.js instance; keep it.
import { MeshoptDecoder } from 'three/examples/jsm/libs/meshopt_decoder.module.js';
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
import { KTX2Loader } from 'three/examples/jsm/loaders/KTX2Loader.js';
export async function loadArt(renderer: WebGLRenderer) {
const base = import.meta.env.BASE_URL;
const ktx2 = new KTX2Loader().setTranscoderPath(`${base}decoders/basis/`).detectSupport(renderer);
const gltf = new GLTFLoader().setMeshoptDecoder(MeshoptDecoder).setKTX2Loader(ktx2);
const [level, sky] = await Promise.all([
gltf.loadAsync(`${base}assets/level.glb`), // EXT_meshopt_compression + KHR_texture_basisu
ktx2.loadAsync(`${base}assets/sky.ktx2`), // standalone KTX2 texture
]);
ktx2.dispose(); // frees the transcoder worker pool
return { level, sky };
}
node_modules/three/examples/jsm/libs/basis/basis_transcoder.{js,wasm}
→ public/decoders/basis/. The Meshopt decoder is a plain module and ships in your bundle.world.renderer (after World.create resolves) so detectSupport picks the right GPU
format.priority, 30 s timeout or AssetLoadError. You own disposal of geometries, materials and
textures. Show your own loading UI; loading after the XR session starts keeps the entry fast.check-gltf.mjs (§3) still fails Meshopt files, because it checks manifest loading. Ignore
that failure for files that only your loader reads..ktx2, skinned and static meshes), 2026-10-16. Load time on a Quest is
unverified.npm exec metavr -- asset search "wooden crate" -c 5 (the project's
metavr dev dependency; the metavr MCP server exposes the same search). Copy chosen files into
the project; don't hot-link a transient CDN URL (iwsdk-build-model).@iwsdk/[email protected] package on jsDelivr. Pin
that exact version; for production, mirror the full assets/<id>/ folders under public/ and
set VITE_IWSDK_EXAMPLE_ASSET_BASE_URL (guide 04). The scaffold's own src/assets.ts loads its
starter desk, plant and robot from that CDN, so replace or mirror them before release.License.txt. Quaternius' older packs (Google Drive downloads, e.g. the Ultimate Animated
Character Pack) ship a CC0 License.txt, but newer packs on quaternius.com and itch.io use a
custom "Quaternius License" (commercial use allowed, redistribution as assets not allowed;
seen 2026-10-16). Record source URL, licence and a hash per file, and keep the licence texts
in the repo.iwsdk-migrate-0-5; export individual models from Spatial Editor or Blender as
GLB and run them through this pipeline.node <skill>/scripts/check-gltf.mjs public/gltf/crate.glb # loadability + weight, no deps
npx @gltf-transform/cli inspect public/gltf/crate.glb # full report (meshes, textures, sizes, extensions)
check-gltf.mjs exits 1 for a file IWSDK can't load (Meshopt, a required unknown extension,
missing external buffer, parse error) and warns about textures over --max-texture (default
2048), non-power-of-two images, non-KTX2 textures and uncompressed geometry. It reports
primitives (a floor for draw calls) and approximate triangles. --json for scripts.
npx @gltf-transform/cli optimize in.glb out.glb \
--compress draco \
--texture-compress ktx2 \
--texture-size 2048
node <skill>/scripts/check-gltf.mjs out.glb
Flags verified in @gltf-transform/cli 4.5.1 (optimize --help for the full list):
| Flag | Default | IWSDK advice |
|---|---|---|
--compress | meshopt | Always pass draco (or quantize, which needs no decoder). Never leave the default |
--texture-compress | auto (re-encode in the original format) | ktx2 (GPU-compressed; lower VRAM). Needs KTX-Software 4.4.0+ (ktx --version). optimize then uses UASTC for normal, occlusion and metal-roughness maps and ETC1S for the rest. webp shrinks the download but stays uncompressed in GPU memory |
--texture-size | 2048 | 1024 for small props; 2048 for hero or large surfaces |
--flatten, --join, --join-named | true | They merge meshes to cut draw calls, including named ones. If code or animations address parts by name (getObjectByName, articulated parts, grabbable children), pass --join-named false or --flatten false --join false |
--instance | true | Uses EXT_mesh_gpu_instancing for repeated meshes (supported) |
--palette | true | Merges simple materials into palette textures |
--simplify, --simplify-error | true, 0.0001 | Conservative. For a stronger reduction use simplify on its own, then review in the headset |
Without KTX-Software, ask before installing it (https://github.com/KhronosGroup/KTX-Software releases). Meta's WebXR guidance: use KTX2/Basis, and a different compression type for colour maps than for normal maps.
Then compare in.glb and out.glb in the app (or with npx @iwsdk/cli asset render-preview,
see iwsdk-build-model) from the same viewpoint before replacing the original.
@gltf-transform/functionsBuild scripts that merge several source models (one atlas, one shared material) hit these (4.5.1 source):
palette() writes its UVs to the next free slot. If a primitive already has TEXCOORD_0,
the palette UVs go to TEXCOORD_1 and the palette material samples set 1
(nextTexCoordIndex in palette.ts). Force one shared material afterwards and those
primitives sample their old UVs instead: the model renders black or striped. Kenney's Space
Kit models, for example, carry UVs on flat-colour materials (values out to ±41). Strip unused
UVs before palette():
for (const mesh of doc.getRoot().listMeshes())
for (const prim of mesh.listPrimitives()) {
const m = prim.getMaterial();
if (m && (m.getBaseColorTexture() || m.getEmissiveTexture() || m.getMetallicRoughnessTexture())) continue;
for (const s of prim.listSemantics()) if (s.startsWith('TEXCOORD_')) prim.setAttribute(s, null);
}
await doc.transform(palette({ min: 1 }));
palette() can return several equivalent materials (they differ by texCoord set or
unrelated factors). If you need one draw call per mesh, assign one material yourself.join() silently skips nodes with a skin, animated nodes, EXT_mesh_gpu_instancing
nodes, primitives with morph targets and KHR_materials_volume (join.ts). A skinned
character stays several draw calls. To merge its primitives (same material, same skin), call
joinPrimitives(prims) yourself and replace them on the mesh.inspect: primitive count per mesh, material count,
TEXCOORD sets.// src/assets.ts (shared by runtime and editor: no World, DOM, timers)
import { AssetType, defineAssets } from '@iwsdk/core';
const publicAssetUrl = (p: string) =>
`${import.meta.env.BASE_URL}${p.replace(/^\/+/u, '')}`;
export default defineAssets({
crate: { type: AssetType.GLTF, url: publicAssetUrl('gltf/crate.glb'), priority: 'background' },
hall: { type: AssetType.GLTF, url: publicAssetUrl('gltf/hall.glb'), priority: 'critical' },
});
critical blocks World.create() until loaded (use sparingly);
background starts right after the critical ones; lazy registers without fetching (loads
on first scene placement or explicit load). An entry without priority is treated as
critical (asset-manager.ts), so set it explicitly. Each load has a 30-second timeout; a critical failure
rejects World.create() with AssetLoadError.import.meta.env.BASE_URL, never a bare /models/... (breaks subpath hosting
and the editor route).public/ isn't available to a scene until it is registered here. Place it from scene
JSON ("content": { "type": "asset", "asset": "crate" }) with iwsdk-compose-scene.AssetManager.getGLTF(id) returns a fresh scene-graph clone with shared geometry and
materials. Clone a material before changing one instance's colour; use entity.dispose() (not
destroy()) for code-created GPU objects.AssetType.Texture need texture.colorSpace = SRGBColorSpace.node <skill>/scripts/check-gltf.mjs public/gltf/*.glb passes.npm run build and sort dist/assets by size: no surprise multi-MB files.npx @iwsdk/cli browser logs --count 50, no loader errors; then check on
the headset (iwsdk-quest-device-testing) for load time and frame rate.| Symptom | Cause / fix |
|---|---|
setMeshoptDecoder must be called before loading compressed files | File uses EXT_meshopt_compression. Re-run optimize with --compress draco, or load it with your own loader (§1a) |
| Model renders black or striped after merging materials | palette() put its UVs in TEXCOORD_1 while the material reads set 0; strip unused UVs first (§4 traps) |
A skinned character is still several draw calls after join | join() skips skinned nodes; use joinPrimitives (§4 traps) |
| App must work without unpkg.com | Load through your own loader with local decoders (§1a) |
setKTX2Loader must be called before loading KTX2 textures | Loaded with a raw GLTFLoader. Use AssetManager / the manifest |
| Model loads offline in dev but fails on a locked-down network | Draco/Basis decoders come from unpkg.com at runtime |
| A named part disappeared after optimising | --join/--flatten merged it; re-run with --join-named false |
| Textures look washed out | Colour texture without SRGBColorSpace |
.ktx2 file in the manifest won't load | AssetType.Texture uses TextureLoader; embed the KTX2 texture in a glTF |
Model payload "<url>" is N bytes; the configured limit is M bytes | Over 64 MiB (one model) or 256 MiB (all scene models): split or compress |
packages/core/src/asset/loaders/gltf-loader.ts, texture-loader.ts, hdr-texture-loader.ts, asset-manager.ts, packages/scene-composition/src/validation.ts, docs/guides/04-external-assets.md, docs/guides/08-build-deploy.md, docs/public/skills/iwsdk-migrate-0-5/SKILL.md, packages/create/guidance/claude/.claude/rules/assets-and-manifest.mdoptimize defaults), packages/cli/src/transforms/toktx.ts (KTX-Software 4.4.0+), packages/functions/src/join.ts (skips skinned, animated, instanced, morph-target and volume nodes), palette.ts (nextTexCoordIndex), simplify.ts/examples/jsm/loaders/KTX2Loader.js (setTranscoderPath, detectSupport), /examples/jsm/libs/basis/docs/metavr-cli-reference.md in this library (metavr asset search)License.txt in each pack), https://quaternius.com (pack licences), checked 2026-10-16Last verified: 2026-10-17
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/iwsdk-core:iwsdk-asset-pipelinefrom IWSDK Core
npx claudepluginhub mirzaaghazadeh/iwsdk-webxr-skills --plugin iwsdk-core17 skills in this plugin
/horizon-launch-roadmapPlan and sequence the launch of an IWSDK / WebXR game or 2D web app on Meta Quest: choose between hosted web, the Browser new tab page and a Horizon Store PWA; pick 2D vs immersive; list the irreversible decisions (Android package id, signing key, origin and Digital Asset Links, Early Access, pre-order and Coming Soon windows, Data Use Checkup auto-approval, age group, web IAP limits, Meta VR Glasses input and targeting); map each phase to the skill that does the work; and build a dated timeline counting back from launch day, plus post-launch growth tools. Use when the user asks "how do I publish my WebXR game", "should I ship as a PWA or just a website", "what's the release process for a Quest web app", "plan my launch", "when should I submit", "can I do early access / pre-orders", "should I support Meta VR Glasses", or starts a new IWSDK project meant for the store./horizon-store-listing-assetsPrepare and validate the Meta Horizon Store listing for a WebXR / IWSDK PWA or a 2D PWA: art specs (covers, Hero, Mini Landscape, Logo, Icon, Spatialized tile, screenshots, trailer, 360 preview), asset VRCs, metadata limits, specs (play area, input, comfort, internet), age group and IARC, privacy policy and Data Use Checkup, pricing, price A/B tests, Try Before You Buy limits, web IAP limits (WebXR PWAs only, no subscriptions), sales, keys, Early Access, pre-orders, Store analytics, and what Meta VR Glasses change. Includes an image checker. Use when the user asks for "store assets for my web app", "cover art size", "screenshots of my WebXR game", "trailer requirements", "store description", "age rating / IARC", "privacy policy for my Quest PWA", "can my PWA sell items", "set the price", "A/B test my price", "free trial", "run a sale", "generate keys", or "early access". Replaces the asset table in Meta's hz-store-submit, which has wrong dimensions and limits./horizon-web-store-publishEnd-to-end release pipeline for shipping an IWSDK / WebXR game (or a 2D web app) on the Meta Horizon Store as a PWA/TWA: production build, HTTPS hosting that can serve /.well-known/assetlinks.json, web app manifest and icons, @meta-quest/bubblewrap-cli in immersive or 2D mode (scripted, non-TTY), version codes, signed-APK verification, sideload test, ovr-platform-util or metavr upload to ALPHA, device targeting (Future devices for Meta VR Glasses, quest3+ channel suffix), promotion between release channels, web-only updates versus APK rebuilds, and CI. Ships a deploy checker, a TWA APK verifier and a guarded upload wrapper. Use when the user says "publish my WebXR app to the Quest store", "package my IWSDK game as a PWA", "bubblewrap for Quest", "my TWA won't launch / shows a URL bar", "assetlinks", "upload my web app APK", "ship my PWA to Meta VR Glasses", "promote to beta / production", or "set up CI for my Quest PWA". Builds on and corrects Meta's hz-store-pwa skill./horizon-web-vrc-checklistPre-submission audit of a WebXR / IWSDK PWA (immersive) or a 2D PWA against Meta's current Virtual Reality Checks (VRCs) for the Horizon Store, by VRC ID, using the Store and Store (2D) columns of Meta's VRC table. For each VRC it gives the web-specific check (WebXR APIs, Bubblewrap manifest output, web permissions) and how to test it in the installed TWA on a Quest with metavr, adb, chrome://inspect and OVR Metrics Tool, then produces a PASS/FAIL/RISK evidence table. Use when the user asks "will my WebXR app pass review", "VRC checklist for a PWA", "which VRCs apply to a 2D web app", "focus awareness in WebXR", "pause when the Universal Menu opens", "frame rate requirement for WebXR", "entitlement check for a PWA", "is my PWA ready for Meta VR Glasses", or "why was my web app rejected (VRC...)". Takes precedence over the generic VRC notes in Meta's hz-store-submit, which are partly out of date./hz-immersive-designerGuides design of comfortable, intuitive VR/MR experiences for Meta VR and Horizon OS — comfort guidelines, interaction patterns, spatial layout, accessibility. Use during UX design review or when evaluating comfort and accessibility. Build paths: Meta Spatial SDK, Unity, Unreal, native OpenXR, and WebXR; for 2D panel apps use hz-panel-designer if available. Use hz-quest-verify-first if the build path is unclear./hz-perfetto-debugAnalyzes Meta VR and Horizon OS VR performance using Perfetto traces — frame timing, CPU/GPU bottlenecks, render pass analysis. Use when profiling frame drops, jank, or thermal issues on Meta VR devices. Build paths: all Meta VR app stacks; use hz-quest-verify-first if the build path is unclear.