Skill library

Agent skill Web motion

WebGL Components

Use spatial graphics, scenes or materials to support a web experience.

  • 3D / WebGL

Install the skill

Installation method

Run the command from your project root with Node.js and npm.

npx skills@latest add flornkm/skills --skill webgl-components --agent claude-code --yes

Check this file in your project.claude/skills/webgl-components/SKILL.md

Other ways to install
  • Choose an assistant interactively

    npx skills@latest add flornkm/skills --skill webgl-components

    Select your assistant and choose the project installation scope.

    Official instructions

The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. Use a local browser and the publisher’s standalone gpu-probe.html. Match its context options to the app before comparing branch results.

View operation manual

What this skill helps with

  • Use spatial graphics, scenes or materials to support a web experience.

Good for

  • 3D on the web
Publisher
flornkm
Controls
shared WebGL context · 2D drawImage · canvas.height - size · failIfMajorPerformanceCaveat
Result
The probe identifies both a usable WebGL branch and a forced fallback, and verifies bottom-left coordinates.
Skill name
webgl-components
Repository
flornkm/skills

Common pitfall

Avoid this prompt

Create a context per swatch and blit after an asynchronous pause.

The browser may evict contexts, and the drawing buffer may become invalid before the delayed blit.

Use these steps

  1. Read the source and set up the example
  2. Implement the documented behavior
  3. Inspect the actual result

Project walkthrough

Render several decorative swatches through one context and verify the useful fallback branch.

Render several decorative swatches through one context and verify the useful fallback branch.

  1. Read the source and set up the example

    Use a local browser and the publisher’s standalone gpu-probe.html. Match its context options to the app before comparing branch results.

    Prompt · Step 1
    Use WebGL Components on [my swatch list]. Read Architecture and Robustness in SKILL.md. Decide what remains usable as a plain CSS/DOM swatch. Open scripts/gpu-probe.html locally and match its CONTEXT_OPTIONS to the app’s request.
  2. Implement the documented behavior

    Render several decorative swatches through one context and verify the useful fallback branch.

    Prompt · Step 2
    Use one offscreen GL context and one 2D canvas per decorative swatch. Draw and blit in the same task using the correct lower-left to upper-left coordinate conversion. Gate on visibility, cancel shared animation when idle, and keep a deterministic CSS/DOM fallback for context denial or loss.
  3. Inspect the actual result

    The probe identifies both a usable WebGL branch and a forced fallback, and verifies bottom-left coordinates.

    • The probe identifies both a usable WebGL branch and a forced fallback, and verifies bottom-left coordinates.
    Prompt · Step 3
    Read the probe JSON and confirm the strict/permissive result and blit orientation. In a separate browser run with WebGL disabled, verify the fallback branch and both the clipped swatches and the actual list controls. Exercise context loss separately when the browser allows it.

Implementation lookup

Compare the required inputs with the local verification result.

Inspect the implementation controlsVerify
Command or reference
shared WebGL context · 2D drawImage · canvas.height - size · failIfMajorPerformanceCaveat
Examples
The probe identifies both a usable WebGL branch and a forced fallback, and verifies bottom-left coordinates.

FAQ

What should I prepare first?

Use a local browser and the publisher’s standalone gpu-probe.html. Match its context options to the app before comparing branch results.

How do I verify the result?

The probe identifies both a usable WebGL branch and a forced fallback, and verifies bottom-left coordinates.