Skip to content

AI Tools

TypeGPU’s API is newer than most models’ training data, and much of what looks like valid TypeScript is not valid inside a 'use gpu' function. Coding agents do best with three things: a short set of instructions that is always loaded, documentation that matches the installed version, and a check they can run after editing.

Agents read AGENTS.md (and Claude Code reads CLAUDE.md) at the start of every session. Projects created with the TypeGPU CLI get a TypeGPU section in both files, and npx typegpu@latest --enhance can add it to an existing project. To add it by hand, paste this into AGENTS.md, and put @AGENTS.md in CLAUDE.md:

<!-- BEGIN:typegpu-agent-rules -->
# TypeGPU
This project uses TypeGPU. Its API is newer than most models' training data.
Before writing or fixing TypeGPU code, read node_modules/typegpu/skills/typegpu/SKILL.md
and the references it names. They match the installed version, and the .d.ts files in
node_modules/typegpu are the exact API.
In 'use gpu' functions:
- Vectors, matrices, structs and arrays are references. Copy them (d.vec3f(v)) before
assigning to a let, or use const.
- Write d.f32(1) where a float is needed. Scalar a / b divides as floats; use
std.intdiv for integers. Shift u32 right with >>>.
- Use `std.*` math, not `Math.*`.
- Write GPU methods as properties (step: () => { 'use gpu'; ... }), not shorthand methods.
- Values captured from the outer scope are baked in as constants. Use uniforms for
anything that changes.
After editing, run the type check and the linter (eslint-plugin-typegpu).
<!-- END:typegpu-agent-rules -->

In a monorepo, put the files next to the package.json that depends on typegpu, so the node_modules path resolves.

The typegpu package ships the official TypeGPU Skill in node_modules/typegpu/skills/typegpu/. It covers schemas, functions, shaders, buffers, textures, pipelines and common error patterns, and its version always matches the installed typegpu. The instructions above point agents at it, so no further setup is needed.

Some agents only discover skills in their own skill folders. To install the skill there, copy it from node_modules:

Terminal window
npx skills add ./node_modules/typegpu/skills/typegpu

Without TypeGPU installed, use the tag of a TypeGPU version:

Terminal window
npx skills add software-mansion/TypeGPU#v0.12.11 -s typegpu

TanStack Intent can also load the skill from node_modules:

npm install --save-dev @tanstack/intent
npm exec --no -- intent install

The type checker and the TypeGPU lint plugin are the fastest feedback for an agent. The lint plugin flags Math.*, integer division, invalid assignments, uninitialised variables and unsupported syntax inside 'use gpu' functions. Projects created with the CLI have both set up as the types and check scripts.

Every page of these docs is also available as Markdown: replace the trailing / of its URL with .md, for example /TypeGPU/apis/buffers.md. llms.txt lists the guides in the order of the sidebar.

The experimental TypeGPU Runtime Inspector MCP exposes runtime inspection data to agent tools. It helps agents catch runtime errors and inspect generated WGSL code alongside other useful TypeGPU runtime information.

Use it when your agent environment supports MCP servers and you want runtime feedback while iterating on TypeGPU programs.

© Software Mansion 2026. All trademarks and copyrights belong to their respective owners. Read about our Privacy Policy.