agentleFS
PierreAndreisPierreAndreis/pierre-skills/skills/shaders/SKILL.md

shaders

Skill1 starsChanged 3 months agoMITView on GitHub

Builds, integrates, debugs, tests, and optimizes WebGPU shaders with vgpu, typed WGSL modules, browser canvases, headless Node rendering, and deterministic evidence. Use for WGSL, fragment effects, procedural graphics, raymarching, GPU compute, particles, simulations, post-processing, textures, 3D scenes, shader visual bugs, GPU performance, or adding vgpu.sh to a TypeScript web project.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 4 are distinctive, and 8 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Treat pixels as program output.

    line 8
  2. Very specific:

    Use version-matched local docs through npx vgpu docs.

    line 13
  3. Distinctive:

    Search verified examples before inventing integration code.

    line 14
  4. Very specific:

    Keep WGSL in importable modules and validate every entry and helper file with npx vgpu check.

    line 15
  5. Very specific:

    Use one Gpu context and stable resource identities.

    line 16
  6. Distinctive:

    Read REFERENCE.md for shared shader correctness rules, then only the relevant branch.

    line 25
  7. Very specific:

    Run scripts/project_inventory.py .

    line 46
  8. Distinctive:

    Read the installed getting-started page, then the one concept page for the selected branch.

    line 47
  9. Very specific:

    Search npx vgpu examples search "<intent>" --pretty.

    line 48
  10. Very specific:

    Run npx vgpu check <file.wgsl> on every changed WGSL file.

    line 51
  11. Very specific:

    Run npx vgpu doctor --pretty, render headlessly through vgpu/node, read pixels, and save a small artifact.

    line 52
  12. Very specific:

    Use scripts/rgba_metrics.py or targeted pixel assertions to reject blank, clipped, transparent, or numerically implausible output.

    line 53

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Shaders with vgpu

Treat pixels as program output. Validate the shader, render a small deterministic frame, inspect or extract its values, then integrate it into the user-facing runtime.

Non-negotiable defaults

  • Inspect the project and installed vgpu version before writing API calls.
  • Use version-matched local docs through npx vgpu docs; load one relevant page at a time.
  • Search verified examples before inventing integration code.
  • Keep WGSL in importable modules and validate every entry and helper file with npx vgpu check.
  • Use one Gpu context and stable resource identities; update values in place instead of rebuilding GPU objects per frame.
  • Make time, resolution, pointer, seed, and other animation inputs explicit.
  • Render and read actual pixels. A successful compile is not visual proof.
  • Debug nontrivial math by encoding internal values into pixels and comparing them with a CPU reference.
  • Preserve reduced-motion behavior, responsive resolution, device-pixel-ratio bounds, and a usable fallback when WebGPU is unavailable.
  • Dispose Node resources and stop frame loops, observers, and listeners during cleanup.

Route to the playbook

Read REFERENCE.md for shared shader correctness rules, then only the relevant branch.

SituationRead
Installing, discovering APIs, loaders, examples, or runtime supportSetup and discovery
Fullscreen fragment shader, procedural background, noise, SDF, or raymarchFullscreen effects
Vertex/fragment geometry, camera, lighting, mesh, or scene graphGeometry and scenes
Compute shader, storage buffer, particles, tensor, or simulationCompute and simulation
Feedback, ping-pong, offscreen targets, post-processing, depth, or texturesMultipass and textures
Wrong pixels, black output, validation error, NaN, or cross-runtime bugDebugging and testing
Frame time, allocations, compilation stalls, bundle size, or memoryPerformance
Color, composition, motion, interaction, responsive canvas, or fallbackVisual and product integration

Bundled laboratory

  • scripts/project_inventory.py maps vgpu versions, runtimes, loaders, and WGSL files without changing the project.
  • scripts/rgba_metrics.py measures raw target.read() RGBA8 output and enforces nonblank-image gates.
  • templates/static-field.wgsl plus ESM-explicit templates/headless-smoke.mts form a small real-vgpu smoke render whose raw output can feed the metrics tool.

Default workflow

  1. Run scripts/project_inventory.py . and inspect package manager, version, loaders, WGSL graph, and runtime surfaces.
  2. Read the installed getting-started page, then the one concept page for the selected branch.
  3. Search npx vgpu examples search "<intent>" --pretty; inspect before pulling.
  4. State a shader contract: inputs, output, coordinate space, color space, deterministic seed/time, target format, and performance budget.
  5. Implement the smallest static frame. Keep reusable math in pure WGSL modules.
  6. Run npx vgpu check <file.wgsl> on every changed WGSL file; require device validation in CI.
  7. Run npx vgpu doctor --pretty, render headlessly through vgpu/node, read pixels, and save a small artifact.
  8. Use scripts/rgba_metrics.py or targeted pixel assertions to reject blank, clipped, transparent, or numerically implausible output.
  9. Integrate the same effect into the browser and observe the real canvas at narrow/wide sizes, reduced motion, and bounded DPR.
  10. Measure after correctness. Accept only when pixel, visual, lifecycle, and budget gates pass.

Deliver

State the effect contract, vgpu/runtime paths used, WGSL files changed, exact validation and render evidence, performance measurements, fallbacks, and remaining device/browser risk. Never describe a shader as correct from source or compilation alone.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.