.claude/skills/ts-babylonjs/SKILL.md
You are an expert in Babylon.js, the powerful open-source 3D engine for web browsers with WebGL and WebGPU support. You help developers build games, product configurators, architectural visualizations, VR/AR experiences, and interactive 3D applications — using Babylon's scene graph, PBR materials, Havok physics, particle systems, GUI, animation, and XR support for production-grade 3D on the web.
npx skillsauth add eliferjunior/Claude babylonjsInstall 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.
You are an expert in Babylon.js, the powerful open-source 3D engine for web browsers with WebGL and WebGPU support. You help developers build games, product configurators, architectural visualizations, VR/AR experiences, and interactive 3D applications — using Babylon's scene graph, PBR materials, Havok physics, particle systems, GUI, animation, and XR support for production-grade 3D on the web.
// src/main.ts — Babylon.js scene
import {
Engine, Scene, ArcRotateCamera, HemisphericLight,
Vector3, MeshBuilder, PBRMaterial, Color3,
} from "@babylonjs/core";
import "@babylonjs/loaders"; // GLTF/GLB loader
const canvas = document.getElementById("renderCanvas") as HTMLCanvasElement;
const engine = new Engine(canvas, true, {
adaptToDeviceRatio: true,
antialias: true,
});
const scene = new Scene(engine);
scene.clearColor = new Color4(0.1, 0.1, 0.15, 1);
// Camera (orbit around target)
const camera = new ArcRotateCamera("camera", Math.PI / 4, Math.PI / 3, 10, Vector3.Zero(), scene);
camera.attachControl(canvas, true);
camera.lowerRadiusLimit = 3; // Min zoom
camera.upperRadiusLimit = 20; // Max zoom
// Lighting
const light = new HemisphericLight("light", new Vector3(0, 1, 0), scene);
light.intensity = 0.7;
// PBR Material
const material = new PBRMaterial("pbr", scene);
material.albedoColor = new Color3(0.8, 0.2, 0.3);
material.metallic = 0.3;
material.roughness = 0.4;
// Mesh
const sphere = MeshBuilder.CreateSphere("sphere", { diameter: 2, segments: 32 }, scene);
sphere.material = material;
// Render loop
engine.runRenderLoop(() => scene.render());
window.addEventListener("resize", () => engine.resize());
import { SceneLoader } from "@babylonjs/core";
import "@babylonjs/loaders/glTF";
// Load GLTF model
const result = await SceneLoader.ImportMeshAsync("", "/models/", "product.glb", scene);
const model = result.meshes[0];
model.scaling = new Vector3(0.5, 0.5, 0.5);
model.position = new Vector3(0, 0, 0);
// Access specific meshes by name
const body = scene.getMeshByName("Body");
if (body && body.material) {
(body.material as PBRMaterial).albedoColor = new Color3(1, 0, 0); // Red
}
import { HavokPlugin } from "@babylonjs/core";
import HavokPhysics from "@babylonjs/havok";
// Initialize Havok physics
const havok = await HavokPhysics();
const physicsPlugin = new HavokPlugin(true, havok);
scene.enablePhysics(new Vector3(0, -9.81, 0), physicsPlugin);
// Add physics to meshes
const ground = MeshBuilder.CreateGround("ground", { width: 20, height: 20 }, scene);
new PhysicsAggregate(ground, PhysicsShapeType.BOX, { mass: 0 }, scene); // Static
const ball = MeshBuilder.CreateSphere("ball", { diameter: 1 }, scene);
ball.position.y = 10;
new PhysicsAggregate(ball, PhysicsShapeType.SPHERE, {
mass: 1,
restitution: 0.7, // Bounciness
}, scene);
import { AdvancedDynamicTexture, Button, TextBlock, StackPanel } from "@babylonjs/gui";
// Full-screen UI overlay
const ui = AdvancedDynamicTexture.CreateFullscreenUI("UI");
const panel = new StackPanel();
panel.width = "220px";
panel.horizontalAlignment = 0; // Left
panel.verticalAlignment = 0; // Top
panel.paddingTop = "20px";
panel.paddingLeft = "20px";
ui.addControl(panel);
const button = Button.CreateSimpleButton("btn", "Change Color");
button.width = "200px";
button.height = "40px";
button.color = "white";
button.background = "#6366f1";
button.onPointerClickObservable.add(() => {
material.albedoColor = Color3.Random();
});
panel.addControl(button);
// 3D-attached UI (label following a mesh)
const label = AdvancedDynamicTexture.CreateForMesh(sphere);
const text = new TextBlock();
text.text = "Product Name";
text.color = "white";
text.fontSize = 24;
label.addControl(text);
// Enable VR with one line
const xr = await scene.createDefaultXRExperienceAsync({
floorMeshes: [ground],
uiOptions: { sessionMode: "immersive-vr" },
});
// AR mode
const xrAR = await scene.createDefaultXRExperienceAsync({
uiOptions: { sessionMode: "immersive-ar" },
});
npm install @babylonjs/core @babylonjs/loaders @babylonjs/gui
npm install @babylonjs/havok # Physics (optional)
npm install @babylonjs/materials # Advanced materials (optional)
SceneLoader.ImportMeshAsync for GLTF; compress with Draco for smaller filesscene.debugLayer.show() for the built-in inspector; invaluable for debuggingnew WebGPUEngine(canvas) for next-gen performancedevelopment
Expert guidance for Fireworks AI, the platform for running open-source LLMs (Llama, Mixtral, Qwen, etc.) with enterprise-grade speed and reliability. Helps developers integrate Fireworks' inference API, fine-tune models, and deploy custom model endpoints with function calling and structured output support.
development
Convert any website into clean, structured data with Firecrawl — API-first web scraping service. Use when someone asks to "turn a website into markdown", "scrape website for LLM", "Firecrawl", "extract website content as clean text", "crawl and convert to structured data", or "scrape website for RAG". Covers single-page scraping, full-site crawling, structured extraction, and LLM-ready output.
tools
Expert guidance for Firebase, Google's platform for building and scaling web and mobile applications. Helps developers set up authentication, Firestore/Realtime Database, Cloud Functions, hosting, storage, and analytics using Firebase's SDK and CLI.
development
When the user needs to build file upload functionality for a web application. Use when the user mentions "file upload," "image upload," "upload endpoint," "multipart upload," "presigned URL," "S3 upload," "file validation," "upload to cloud storage," or "accept user files." Handles upload endpoints, file validation (type, size, magic bytes), cloud storage integration, and upload status tracking. For image/video processing after upload, see media-transcoder.