web-shaders

A guide for writing, debugging, and reviewing graphics shaders, small programs that calculate how images and 3D scenes are drawn in a web browser.

In plain words
What is it for?
Use it with WebGL, WebGPU, Three.js, or React Three Fiber for effects such as noise, ray marching, and post-processing.
Why use it?
It helps match shader code to the browser graphics system and language being used, while addressing common setup and rendering problems.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/owenob1/web-shaders-agent-kit/web-shaders
Any agent
npx skills add owenob1/web-shaders-agent-kit --skill web-shaders
Clone the repo
git clone --depth 1 https://github.com/owenob1/web-shaders-agent-kit

Made for: Claude Code, Codex.

Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,062 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00083 $0.02062
Opus 5 $0.00042 $0.01031
Sonnet 5 $0.00017 $0.00412
Haiku 4.5 $0.00008 $0.00206

Measured 2d ago against content hash fbae1884a679, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

web-shaders scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/web-shaders/SKILL.md · 117 lines

How it starts

The opening of the file, as written. The whole thing — 117 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Web Shaders

You are writing shaders that run in a browser. Get the platform and language right first, then the technique, then verify visually.

1. Establish the target before writing a line

Ask (or infer from the codebase) which of these you are in — the boilerplate and language differ:

Target Language Notes
Raw WebGL 2 GLSL ES 3.00 (#version 300 es) You declare everything. in/out, texture(), custom out vec4.
Raw WebGL 1 GLSL ES 1.00 attribute/varying, texture2D(), gl_FragColor. Legacy — avoid for new work.
WebGPU (raw) WGSL @vertex/@fragment, bind groups, uniform buffers with strict alignment.
Three.js ShaderMaterial GLSL ES 1.00 by default Three injects camera/model matrices and attributes (see §2). Set glslVersion: THREE.GLSL3 for GLSL 3.
Three.js RawShaderMaterial whatever you declare No injected uniforms/attributes or precision. You write the full header.
Three.js TSL (WebGPURenderer) JavaScript nodes Author with tslFn/node ops; compiles to both WGSL and GLSL. No raw shader strings.
React Three Fiber GLSL via drei shaderMaterial Wraps ShaderMaterial; uniforms become material props.

If the project uses WebGPURenderer, prefer TSL over raw WGSL strings — it is the supported path and cross-compiles.

2. Three.js ShaderMaterial: what is already provided

ShaderMaterial (not RawShaderMaterial) auto-injects, so do not redeclare them:

  • Vertex attributes: position, normal, uv.
  • Uniforms: modelMatrix, modelViewMatrix, projectionMatrix, viewMatrix, normalMatrix, cameraPosition.
  • precision is set for you.

A minimal correct pair:

// vertex
varying vec2 vUv;
void main() {
  vUv = uv;
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}
// fragment
varying vec2 vUv;
uniform float uTime;
void main() {
  gl_FragColor = vec4(vUv, 0.5 + 0.5 * sin(uTime), 1.0);
}

For GLSL 3 (glslVersion: THREE.GLSL3): replace varyingin/out, texture2Dtexture, and declare out vec4 fragColor; instead of gl_FragColor.

Read the full file on GitHub · 117 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 117 lines · 83 tokens per session scan A fbae1884a679

Subscribe to this mod's changes

web-shaders is a skill published in the GitHub repository owenob1/web-shaders-agent-kit (2 stars, last pushed 1mo ago), licensed MIT. It adds 83 tokens to every session and 2,062 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.