Agent skill

Scaffold Shader

by oframe in oframe/ogpu

Scaffold a new simple WGSL shader for the OGPU engine, wired for a RenderPipeline + Mesh.

UnlicenseAuto-check passedDevelopment

Install Scaffold Shader

skills CLI
$ npx skills add oframe/ogpu --skill scaffold-shader -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install oframe/ogpu scaffold-shader --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/oframe/ogpu.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/scaffold-shader .claude/skills/scaffold-shader && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
scaffold-shader
GitHub stars
151
Token cost
~1.4k tokens
SKILL.md length
651 words
Files
4 (incl. scripts, references)
Skills in repo
7
Repo updated
First seen
Licence
Unlicense

At a glance

Scaffold a new simple WGSL shader for the OGPU engine, wired for a RenderPipeline + Mesh.

  • Works in 4 steps: Ask/confirm only what changes the output… → Generate the base .wgsl by RUNNING the… → Layer the requested modifications ON TOP… → …
  • The user wants to create a new shader
  • SKILL.md covers Conventions that are NOT…, Workflow and References
  • Runs Python scripts from its folder; calls brew

What it does

Scaffold Shader is an agent skill from oframe/ogpu. Scaffold a new simple WGSL shader for the OGPU engine, wired for a RenderPipeline + Mesh. Use whenever the user wants to create a new shader, start a shader from scratch, add a .wgsl file for a mesh, get a shader boilerplate/template/starting point, or "make me a basic shader" / "scaffold a shader". Produces a minimal vs/fs WGSL file following the engine's reflection conventions, optionally with the JS pipeline wiring.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including scripts and reference files (for example `references/js-wiring.md` and `scripts/scaffold.py`).

It sits in Development, covering Project scaffolding. The repository describes itself as: Minimal WebGPU Library. The licence is Unlicense.

When your agent uses it

  • The user wants to create a new shader
  • Start a shader from scratch
  • Add a .wgsl file for a mesh
  • Get a shader boilerplate/template/starting point

Example prompts

  • “make me a basic shader”
  • “scaffold a shader”
  • “/scaffold-shader”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Ask/confirm only what changes the output (skip if obvious from the request)
  2. Generate the base .wgsl by RUNNING the scaffold script — don't hand-write
  3. Layer the requested modifications ON TOP of the generated file with Edit —
  4. Validate the WGSL without a browser — `node scripts/validate-shaders.mjs

What it can do on your machine

Read from SKILL.md and the folder at commit 65e0a1a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • brew

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Scaffold Shader loads about 1.4k tokens when it runs, and up to ~2.5k if it reads all its reference files. Until then it costs about 110 tokens; SKILL.md has 651 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~110
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from oframe/ogpu at commit 65e0a1a, republished under its Unlicense licence (© oframe). 651 words, ~1,428 tokens.

Download SKILL.mdSave it as .claude/skills/scaffold-shader/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
scaffold-shader
description
Scaffold a new simple WGSL shader for the OGPU engine, wired for a RenderPipeline + Mesh. Use whenever the user wants to create a new shader, start a shader from scratch, add a .wgsl file for a mesh, get a shader boilerplate/template/starting point, or "make me a basic shader" / "scaffold a shader". Produces a minimal vs/fs WGSL file following the engine's reflection conventions, optionally with the JS pipeline wiring.

Scaffold a simple WGSL shader

Generate a minimal, correct WGSL file (plus optional JS wiring) for a mesh rendered through RenderPipeline + Mesh. The base shader is deliberately bare — vs/fs with the standard transform uniforms and a fragment that outputs the normal mapped to 0..1. No custom uniforms, no textures: those are modifications you layer on top after generating, per the task. The reference shape is examples/hellowebgpu/cube.wgsl (same conventions).

Conventions that are NOT optional (reflection-enforced)

These come from webgpu-utils reflection in RenderPipeline/Mesh — get one wrong and the pipeline silently shades garbage or fails construction:

  • Uniform block MUST be @group(0) @binding(0) var<uniform> uniforms : Uniforms. Lowercase uniforms, struct typed (commonly Uniforms). RenderPipeline reads this.defs.uniforms.uniforms by that exact name.
  • Vertex entry point MUST be vs, fragment MUST be fs. Hardcoded.
  • Mesh.draw writes standard uniforms BY NAME into the struct — only the fields that exist are written. Available: projectionMatrix, viewMatrix, modelViewMatrix, modelMatrix, objectMatrix (inverse model), normalMatrix (mat3x3f), cameraPosition (vec3f), cameraQuaternion (vec4f), resolution (vec2f), time (f32). Declare only the subset the shader uses, spelled exactly. Custom uniforms (e.g. uScale, uAlpha) go after them and are set via mesh.uniforms.set({...}) — the Mesh owns the uniform values, not the pipeline.
  • Vertex attribute @location is assigned by declaration ORDER in the geometry's data object, not by name. Standard primitives (@core/primitives Box/Sphere/…) emit position (loc 0), normal (loc 1), uv (loc 2). The Vertex struct must match that order.
  • Texture uniforms are named t<Name> (e.g. tMap). Samplers keep descriptive names. Only add these if the shader actually samples a texture — a declared binding with no bind-group entry throws at pipeline creation.

Workflow

  1. Ask/confirm only what changes the output (skip if obvious from the request):

    • Shader name / target file path (default: alongside the consuming JS, e.g. examples/<name>/<name>.wgsl, or ./<name>.wgsl next to the caller).
    • Does it need the JS pipeline wiring too, or just the .wgsl? Default: just the .wgsl unless they're clearly starting a new example.
  2. Generate the base .wgsl by RUNNING the scaffold script — don't hand-write the boilerplate. The script emits a guaranteed-correct vs/fs skeleton with the bindings/struct/attribute order already right, so you spend your effort on the task-specific shading, not on re-deriving reflection rules:

    bash
    python .claude/skills/scaffold-shader/scripts/scaffold.py \
      --out examples/<name>/<name>.wgsl \
      # --std projectionMatrix,modelViewMatrix,normalMatrix,time  # override std fields
      # --force                   # overwrite an existing file

    It refuses to clobber an existing file unless --force. Run scaffold.py -h for the full flag list.

  3. Layer the requested modifications ON TOP of the generated file with Edit — the script output is a bare starting point (normal→0..1 fragment), not the finished shader. This is where the user's actual intent lands: custom uniforms, textures, custom fragment math, extra varyings, displacement in the vertex stage, sampling logic, etc. Keep the reflection conventions intact while you edit:

    • custom uniforms go AFTER the standard fields in Uniforms, set via mesh.uniforms.set({...});
    • textures are t<Name> + a sampler at the next free @binding, and need a matching bind-group entry (see references/js-wiring.md).
  4. Validate the WGSL without a browser — node scripts/validate-shaders.mjs <file> runs naga. The freshly-generated base always passes; run it again after your edits to catch syntax/type errors before the user loads the page. (If naga is absent the script exits 2 — brew install naga-cli, not naga.)

  5. If JS wiring requested, write it from references/js-wiring.md (no-texture variant is the short path; texture variant adds the sampler/texture bind-group entries via pipeline.defs.samplers.* / pipeline.defs.textures.*).

  6. Tell the user how to render it: new RenderPipeline(gpu, { code, vertexBuffers: geometry.bufferLayouts }) → new Mesh(gpu, { pipeline, geometry, bindGroups }) → mesh.setParent(scene). The Mesh REQUIRES a bindGroups factory (pipeline serves layouts only — see references/js-wiring.md). Custom uniforms set with mesh.uniforms.set({...}) (Mesh.draw uploads each frame).

  7. Hot reload works automatically — every *.wgsl?raw import is an HMR boundary, so editing the new file reloads the pipeline live (ShaderReload).

Show full SKILL.md (41 more words)Show less

References

  • scripts/scaffold.py — the generator. Emits the bare vs/fs base (normal→0..1); flags: --out, --std, --force.
  • references/shader-template.wgsl — annotated reference of the shape the script emits (read it to understand the output, not to hand-copy it).
  • references/js-wiring.md — pipeline + mesh wiring, no-texture and texture variants.

© oframe, Unlicense. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts, references) in .claude/skills/scaffold-shader of oframe/ogpu.

  • SKILL.md
  • references/js-wiring.md
  • references/shader-template.wgsl
  • scripts/scaffold.py

Open the folder on GitHubat commit 65e0a1a

Compare with similar skills

Scaffold Shader next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Scaffold Shader compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Scaffold Shader this skilloframe/ogpu151—~1.4kAutomated safety check: PassUnlicense
Nx Generatenomcopter/react-mosaic4.8k7 repos~1.9kAutomated safety check: PassCustom licence
PonytailDavidObando/gsharp5658 repos~1.7kAutomated safety check: PassMIT
Run Nx Generatornrwl/nx29k2 repos~592Automated safety check: NotesMIT
Conductor Setupgemini-cli-extensions/conductor3.8k—~4.2kAutomated safety check: PassApache-2.0
Mirage VFS Adapter Authoringstrukto-ai/mirage3.7k—~2.5kAutomated safety check: PassApache-2.0

Similar skills

  • Nx Generate

    nomcopter/react-mosaic

    Generate code using nx generators. An agent skill from nomcopter/react-mosaic.

    4.8k GitHub starsUsed in 7 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Ponytail

    DavidObando/gsharp

    Forces the laziest solution that actually works, simplest, shortest, most minimal.

    565 GitHub starsUsed in 8 repos~1.7k tokens
    DevelopmentAuto-check passed
  • Run Nx generators with prioritization for workspace-plugin generators.

    29k GitHub starsUsed in 2 repos~592 tokens
    DevelopmentAuto-check: notes
  • Conductor Setup

    gemini-cli-extensions/conductor

    Scaffolds the project and sets up the Conductor environment.

    3.8k GitHub stars~4.2k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Builds or extends a custom Mirage virtual filesystem adapter for an API, database, object store or app data, with a working mount configuration and filesystem tests.

    3.7k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Enforces this repository's TypeScript backend module architecture under server/: feature folders, barrel exports, and where shared types and utilities belong.

    14k GitHub stars~1.2k tokensUpdated today
    DevelopmentAuto-check passed

More from oframe/ogpu

  • Scaffold App

    oframe/ogpu

    Scaffold a new OGPU example/app from scratch — a Renderer + Camera + Orbit + update loop and a single spinning cube wired through the vanilla Box primitive - RenderPipeline - Mesh setup.

    151 GitHub stars~1.1k tokensUpdated 11 days ago
    Auto-check passed
  • Ground any answer about the webgpu-utils library (greggman/webgpu-utils) in its actual API before responding.

    151 GitHub stars~1.4k tokensUpdated 11 days ago
    Auto-check passed
  • Naga Setup

    oframe/ogpu

    Get naga WGSL validation working in a repo — installs the naga/jq toolchain, a PostToolUse hook that compiles every .wgsl on write, and a batch validate-shaders script, so shader checking then…

    151 GitHub stars~1.9k tokensUpdated 11 days ago
    Auto-check passed
  • Ground any answer about the WebGPU platform itself — browser support/compatibility, feature availability, limits, what's shipping or behind a flag, and exact spec behavior — in the live Chrome…

    151 GitHub stars~1.3k tokensUpdated 11 days ago
    Auto-check passed
  • Pbr Shading

    oframe/ogpu

    Fold PBR/IBL shading into a RenderPipeline in the OGPU engine.

    151 GitHub stars~1.6k tokensUpdated 11 days ago
    Auto-check passed
  • Shadow Mapping

    oframe/ogpu

    Fold real-time shadow mapping into an existing RenderPipeline/shader in the OGPU engine.

    151 GitHub stars~1.9k tokensUpdated 11 days ago
    Auto-check passed

Categories

Questions about Scaffold Shader

What does Scaffold Shader do?

Scaffold a new simple WGSL shader for the OGPU engine, wired for a RenderPipeline + Mesh. Scaffold Shader is an agent skill from oframe/ogpu. Scaffold a new simple WGSL shader for the OGPU engine, wired for a RenderPipeline + Mesh.

When should I use Scaffold Shader?

Scaffold Shader fits situations like: the user wants to create a new shader; start a shader from scratch; add a .wgsl file for a mesh; get a shader boilerplate/template/starting point.

How do I install Scaffold Shader in Claude Code?

Run `npx skills add oframe/ogpu --skill scaffold-shader -a claude-code`. Or copy the skill folder (.claude/skills/scaffold-shader in oframe/ogpu) into .claude/skills/scaffold-shader in your project. Claude Code loads it when a task matches its description.

How do I install Scaffold Shader in Codex?

Run `npx skills add oframe/ogpu --skill scaffold-shader -a codex`. Or copy the skill folder (.claude/skills/scaffold-shader in oframe/ogpu) into .agents/skills/scaffold-shader in your project. Codex loads it when a task matches its description.

Can I use Scaffold Shader in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add oframe/ogpu --skill scaffold-shader -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/scaffold-shader, .gemini/skills/scaffold-shader, .github/skills/scaffold-shader and .opencode/skills/scaffold-shader in your project.

What does Scaffold Shader need to run?

Going by SKILL.md and its folder, Scaffold Shader needs Python for the scripts in its folder and the command-line tools its instructions call (brew). Our summary lists: Python 3.

Does Scaffold Shader access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Scaffold Shader safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Scaffold Shader use?

Scaffold Shader is published under the Unlicense licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Scaffold Shader use?

About 1.4k tokens (SKILL.md is roughly 5.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.1k tokens, read only when the agent opens those files.

What are the alternatives to Scaffold Shader?

Skills that share tags, products or a category with Scaffold Shader: Nx Generate (nomcopter/react-mosaic, 4.8k stars), Ponytail (DavidObando/gsharp, 565 stars), Run Nx Generator (nrwl/nx, 29k stars) and Conductor Setup (gemini-cli-extensions/conductor, 3.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Scaffold Shader?

oframe (a GitHub organization) maintains it in oframe/ogpu, which has 151 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on September 26, 2026.

Source: oframe/ogpu on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.