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.
Project instructions
Section titled “Project instructions”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.mdand the references it names. They match the installed version, and the .d.ts files innode_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.
TypeGPU Skill
Section titled “TypeGPU Skill”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:
npx skills add ./node_modules/typegpu/skills/typegpuWithout TypeGPU installed, use the tag of a TypeGPU version:
npx skills add software-mansion/TypeGPU#v0.12.11 -s typegpuTanStack Intent can also load the skill from node_modules:
npm install --save-dev @tanstack/intentnpm exec --no -- intent installpnpm add -D @tanstack/intentpnpm exec intent installyarn add -D @tanstack/intentyarn exec intent installChecks
Section titled “Checks”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.
Docs as Markdown
Section titled “Docs as Markdown”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.
TypeGPU MCP
Section titled “TypeGPU MCP”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.