Skills for Real Engineers. Straight from my .agents directory.
melonjs-renderer-backends
Agent skill frommelonjs/melonJS
Use this skill when a feature works on one machine and not another, when choosing or pinning a renderer, or when writing code that must degrade gracefully. Covers the WebGPU to WebGL 2 to Canvas fallback ladder, what each backend supports, capability detection, and the subsystems that warn once and then stop working on Canvas. Triggers on: video.AUTO, video.WEBGPU, video.WEBGL, video.CANVAS, renderer.type, supportsDepthBuffer, shaderLanguage, WebGPU, WebGL2, Canvas fallback, context loss, backend, works on my machine.
How to install melonjs-renderer-backends
npx skills add melonjs/melonJS# or add only this skill to Claude Code: copy the folder
packages/melonjs/skills/melonjs-renderer-backends/
# into
~/.claude/skills/melonjs-renderer-backends/ (all projects)
.claude/skills/melonjs-renderer-backends/ (one project)
1# Renderer backends and graceful degradation23> `video.AUTO` picks a backend at **runtime**. The same code runs on a different4> renderer depending on the machine, and several subsystems degrade to nothing5> rather than erroring. This is the root cause of most "works on my machine"6> reports.78## The ladder910`video.AUTO` (the default) tries **WebGPU → WebGL 2 → Canvas** and uses the first11that initialises.1213```js14const app = new Application(800, 600, {15 parent: "screen",16 renderer: video.AUTO, // or video.WEBGPU / video.WEBGL / video.CANVAS17});18await app.init();19```2021WebGL 1 is not in the ladder — 20.x made WebGL 2 the baseline, and pinning22`video.WEBGL` **rejects** on a WebGL-1-only device rather than degrading.2324## What each backend can do2526| | WebGPU | WebGL 2 | Canvas |27|---|---|---|---|28| sprites, tilemaps, text | ✅ | ✅ | ✅ |29| blend modes | ✅ | ✅ | ✅ except `"none"` |30| shaders and post effects | ✅ | ✅ | ❌ inert |31| `Light2d` glow (`drawLight`) | ✅ | ✅ | ✅ cached radial gradient |32| normal-map lighting, `Light3d` | ✅ | ✅ | ❌ inert |33| `Mesh` | ✅ | ✅ | ⚠️ CPU-projected, no depth |34| `Camera3d` / depth sorting | ✅ | ✅ | ❌ warns, renders wrong |35| `InstancedMesh` | ✅ | ✅ | ⚠️ one draw per instance |36| GPU tilemap rendering | ✅ | ✅ | ❌ per-tile CPU path |3738The Canvas column is the problem: none of it throws. Each of those paths warns39once and then degrades or no-ops, so the game runs and looks wrong.40…
Excerpt shown under the repository's MIT license.
More skills in melonJS
Similar skill repositories
An agentic skills framework & software development methodology that works.
A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.
Public repository for Agent Skills
Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.
An AI skill that provides design intelligence for building professional UI/UX across multiple platforms.
