webgpu

webgpu

WebGPU/WGSL guidance for initialization, render/compute pipelines, shader authoring, debugging, and performance; use when building or troubleshooting WebGPU apps, GPU compute workloads, or WGSL shaders.

8stars
0forks
Updated 1/30/2026
SKILL.md
readonlyread-only
name
webgpu
description

WebGPU/WGSL guidance for initialization, render/compute pipelines, shader authoring, debugging, and performance; use when building or troubleshooting WebGPU apps, GPU compute workloads, or WGSL shaders.

WebGPU Skill

Use this skill to design, implement, and debug WebGPU applications and GPU compute pipelines. Keep it framework-agnostic and focus on reusable WebGPU/WGSL patterns.

What this skill covers

  • Cover WebGPU initialization, device setup, and surface configuration.
  • Cover compute pipelines, workgroup sizing, and storage buffer layout.
  • Cover render pipelines, render passes, and post-processing patterns.
  • Cover GPU/CPU synchronization and safe readback strategies.
  • Cover performance and debugging practices.
  • Cover architecture patterns: modular passes, phase-based simulation, and capability handling.
  • Cover use cases: rendering, compute, ML training/inference, grid simulations, and systems modeling.

Core principles

  • Choose a capability strategy: fallback runtime, reduced mode, or fail fast.
  • Avoid full GPU readbacks in hot paths; use localized queries or small readback buffers.
  • Structure simulation with phases (state, apply, integrate, constrain, correct) to keep WGSL cohesive.
  • Use spatial grids or other spatial indexing for neighbor queries and high particle counts.
  • Build modular passes so render and compute stages stay composable and testable.

Workflow

When asked to build a WebGPU feature:

  1. Confirm the target platform and WebGPU support expectations.
  2. Propose a resource layout (buffers, textures, bind groups) with a simple data model.
  3. Sketch the pipeline graph (compute vs render passes) and dependencies.
  4. Provide minimal working code and scale up with performance constraints.
  5. Choose a capability strategy when WebGPU is unavailable.

Deliverable checklist

  • Provide clean WebGPU init and error handling.
  • Include a buffer layout with alignment notes (16-byte struct alignment for WGSL).
  • Include a pass graph with clear read/write ownership (ping-pong textures if needed).
  • Call out readback and when it is safe.
  • Provide an optional fallback or reduced mode for critical functionality.

References and assets

Quick reference

See REFERENCE.md for a compact WebGPU cheat sheet and references/ for deeper patterns, including references/use-cases.md and references/simulation-patterns.md.

You Might Also Like

Related Skills

coding-agent

coding-agent

179Kdev-codegen

Run Codex CLI, Claude Code, OpenCode, or Pi Coding Agent via background process for programmatic control.

openclaw avataropenclaw
Get
add-uint-support

add-uint-support

97Kdev-codegen

Add unsigned integer (uint) type support to PyTorch operators by updating AT_DISPATCH macros. Use when adding support for uint16, uint32, uint64 types to operators, kernels, or when user mentions enabling unsigned types, barebones unsigned types, or uint support.

pytorch avatarpytorch
Get
at-dispatch-v2

at-dispatch-v2

97Kdev-codegen

Convert PyTorch AT_DISPATCH macros to AT_DISPATCH_V2 format in ATen C++ code. Use when porting AT_DISPATCH_ALL_TYPES_AND*, AT_DISPATCH_FLOATING_TYPES*, or other dispatch macros to the new v2 API. For ATen kernel files, CUDA kernels, and native operator implementations.

pytorch avatarpytorch
Get
skill-writer

skill-writer

97Kdev-codegen

Guide users through creating Agent Skills for Claude Code. Use when the user wants to create, write, author, or design a new Skill, or needs help with SKILL.md files, frontmatter, or skill structure.

pytorch avatarpytorch
Get

Implements JavaScript classes in C++ using JavaScriptCore. Use when creating new JS classes with C++ bindings, prototypes, or constructors.

oven-sh avataroven-sh
Get

Creates JavaScript classes using Bun's Zig bindings generator (.classes.ts). Use when implementing new JS APIs in Zig with JSC integration.

oven-sh avataroven-sh
Get