typegpu
Installation
SKILL.md
TypeGPU
A single schema (d.*) defines a GPU type, CPU buffer layout, and TypeScript type at once - no manual alignment, type mapping, or casting. The build plugin unplugin-typegpu transforms 'use gpu'-marked TypeScript for runtime WGSL transpilation, enabling type inference and polymorphism across the CPU/GPU boundary.
This skill targets TypeGPU 0.11.2. If the user's project is on an older release, verify API availability before relying on examples or recommended patterns here.
When to read reference files
Read before writing virtually any shader or GPU function — these two cover the rules that trip people up most:
references/types.md— abstract type resolution, exactly whend.f32()is required vs redundant, sampler/texture schemas fortgpu.fnsignatures, CPU-sideTgpuBuffer/TgpuTextureTypeScript types. If you skip this, you'll hit type errors.references/shaders.md— fullstdlibrary listing, loops (std.range,tgpu.unroll),tgpu.comptime, outer-scope capture rules, complete builtin reference for all three shader stages,console.log. Read this for any non-trivial shader logic.