Skip to content
Back to search

webgpu-threejs-tsl

MarketplaceWorks with Claude CodeGitHub

A Claude skill for developing WebGPU applications with Three.js

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/dgreenheck-webgpu-claude-skill/badge.svg)](/listings/dgreenheck-webgpu-claude-skill)

HTML

<a href="/listings/dgreenheck-webgpu-claude-skill"><img src="/api/listings/dgreenheck-webgpu-claude-skill/badge.svg" alt="findsafeskills safety rating" /></a>

Install

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

This repo ships the same content in two formats so it works in both Claude Code (as an Agent Skill) and Cursor (as project rules). The Claude skill under `skills/` is the source of truth; the Cursor rules under `.cursor/rules/` are thin shims that `@file`-reference those same docs, so edits flow through automatically.

Claude Code

# Install from this repository
/skill install webgpu-threejs-tsl@<your-github-username>/webgpu-claude-skill

Or manually copy the `skills/webgpu-threejs-tsl` folder to: - **Global**: `~/.claude/skills/` - **Project**: `<project>/.claude/skills/`

Cursor

Clone this repo and open it directly — Cursor picks up `.cursor/rules/` automatically.

To use the rules in your own project, copy **both** directories into your project root, preserving the paths:

your-project/
├── .cursor/rules/              # from this repo
└── skills/webgpu-threejs-tsl/  # from this repo (referenced by the rules)

The `.mdc` files use `@file` references pointing at `skills/webgpu-threejs-tsl/...`, so the `skills/` directory must travel with them. If you'd rather not keep the `skills/` folder, inline the referenced content into each `.mdc` file.

The rules are scoped by globs and auto-attach only on relevant files:

- `webgpu-threejs-tsl.mdc` — entry point, JS/TS files - `compute-shaders.mdc` — files matching `*compute*` or `*particle*` - `post-processing.mdc` — files matching `*post*`, `*effect*`, `*bloom*` - `wgsl-integration.mdc` — `.wgsl` files and `*wgsl*` JS/TS - `device-loss-and-limits.mdc` — files matching `*renderer*` or `*webgpu*`

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 19 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. {
  2. "name": "webgpu-threejs-tsl",
  3. "owner": {
  4. "name": "Dan Greenheck",
  5. "email": "dgreenheck@users.noreply.github.com"
  6. },
  7. "metadata": {
  8. "description": "Claude skill for WebGPU-enabled Three.js development with TSL (Three.js Shading Language)",
  9. "version": "1.0.0"
  10. },
  11. "plugins": [
  12. {
  13. "name": "webgpu-threejs-tsl",
  14. "description": "Comprehensive guide for WebGPU Three.js with TSL - covers renderer setup, node materials, compute shaders, post-processing, and WGSL integration",
  15. "source": "./",
  16. "strict": false
  17. }
  18. ]
  19. }
README.md · README · 161 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # WebGPU Three.js TSL Skill
  2. An Agent Skill for developing WebGPU-enabled Three.js applications using TSL (Three.js Shading Language).
  3. **Last updated:** April 1, 2026 — aligned with Three.js r183+ API changes.
  4. ## Overview
  5. This skill provides Claude with comprehensive knowledge for:
  6. - Setting up Three.js with WebGPU renderer
  7. - Writing shaders using TSL (Three.js Shading Language)
  8. - Creating node-based materials
  9. - Building GPU compute shaders
  10. - Implementing post-processing effects
  11. - Integrating custom WGSL code
  12. ## Installation
  13. This repo ships the same content in two formats so it works in both Claude Code (as an Agent Skill) and Cursor (as project rules). The Claude skill under `skills/` is the source of truth; the Cursor rules under `.cursor/rules/` are thin shims that `@file`-reference those same docs, so edits flow through automatically.
  14. ### Claude Code
  15. ```bash
  16. # Install from this repository
  17. /skill install webgpu-threejs-tsl@<your-github-username>/webgpu-claude-skill
  18. ```
  19. Or manually copy the `skills/webgpu-threejs-tsl` folder to:
  20. - **Global**: `~/.claude/skills/`
  21. - **Project**: `<project>/.claude/skills/`
  22. ### Cursor
  23. Clone this repo and open it directly — Cursor picks up `.cursor/rules/` automatically.
  24. To use the rules in your own project, copy **both** directories into your project root, preserving the paths:
  25. ```
  26. your-project/
  27. ├── .cursor/rules/ # from this repo
  28. └── skills/webgpu-threejs-tsl/ # from this repo (referenced by the rules)
  29. ```
  30. The `.mdc` files use `@file` references pointing at `skills/webgpu-threejs-tsl/...`, so the `skills/` directory must travel with them. If you'd rather not keep the `skills/` folder, inline the referenced content into each `.mdc` file.
  31. The rules are scoped by globs and auto-attach only on relevant files:
  32. - `webgpu-threejs-tsl.mdc` — entry point, JS/TS files
  33. - `compute-shaders.mdc` — files matching `*compute*` or `*particle*`
  34. - `post-processing.mdc` — files matching `*post*`, `*effect*`, `*bloom*`
  35. - `wgsl-integration.mdc` — `.wgsl` files and `*wgsl*` JS/TS
  36. - `device-loss-and-limits.mdc` — files matching `*renderer*` or `*webgpu*`
  37. ## Skill Structure
  38. ```
  39. skills/webgpu-threejs-tsl/
  40. ├── SKILL.md # Entry point with overview
  41. ├── REFERENCE.md # Quick reference cheatsheet
  42. ├── docs/
  43. │ ├── core-concepts.md # Types, operators, uniforms, control flow
  44. │ ├── materials.md # Node materials and properties
  45. │ ├── compute-shaders.md # GPU compute documentation
  46. │ ├── post-processing.md # Built-in and custom effects
  47. │ ├── wgsl-integration.md # Custom WGSL functions
  48. │ └── device-loss.md # GPU device loss handling and recovery
  49. ├── examples/
  50. │ ├── basic-setup.js # Minimal WebGPU project
  51. │ ├── custom-material.js # Custom shader material
  52. │ ├── particle-system.js # GPU compute particles
  53. │ ├── post-processing.js # Effect pipeline
  54. │ └── earth-shader.js # Complete Earth with atmosphere
  55. └── templates/
  56. ├── webgpu-project.js # Starter project template
  57. └── compute-shader.js # Compute shader template
  58. ```
  59. ## Topics Covered
  60. ### Core Concepts
  61. - Types and constructors (float, vec2, vec3, vec4, color, uniform)
  62. - Vector swizzling
  63. - Operators and math functions
  64. - Control flow (If, Loop, Fn)
  65. - Time and animation
  66. ### Materials
  67. - All node material types
  68. - Material properties (color, roughness, metalness, etc.)
  69. - Physical material features (clearcoat, transmission, iridescence)
  70. - Vertex displacement
  71. ### Compute Shaders
  72. - Instanced array buffers
  73. - Parallel physics simulation
  74. - Particle systems
  75. - Atomic operations and barriers
  76. ### Post-Processing
  77. - Built-in effects (bloom, blur, FXAA, DOF)
  78. - Custom effects with Fn()
  79. - Effect chaining
  80. - Multiple render targets
  81. ### WGSL Integration
  82. - Custom WGSL functions with wgslFn()
  83. - Hybrid TSL/WGSL approaches
  84. - Performance optimization
  85. ### Device Loss Handling
  86. - Detecting GPU device loss
  87. - Recovery strategies
  88. - Testing with destroy() and Chrome GPU crash
  89. - State preservation and restoration
  90. ## Quick Example
  91. ```javascript
  92. import * as THREE from 'three/webgpu';
  93. import { color, time, oscSine, normalWorld, cameraPosition, positionWorld, Fn, float } from 'three/tsl';
  94. // WebGPU renderer
  95. const renderer = new THREE.WebGPURenderer();
  96. await renderer.init();
  97. // TSL material with animated fresnel
  98. const material = new THREE.MeshStandardNodeMaterial();
  99. material.colorNode = color(0x0066ff);
  100. material.emissiveNode = Fn(() => {
  101. const viewDir = cameraPosition.sub(positionWorld).normalize();
  102. const fresnel = float(1).sub(normalWorld.dot(viewDir).saturate()).pow(3);
  103. return color(0x00ffff).mul(fresnel).mul(oscSine(time));
  104. })();
  105. ```
  106. ## Compatibility
  107. - **Recommended Three.js version**: r171+
  108. - **Target browsers**: Chrome 113+, Edge 113+, Firefox (behind flag), Safari (WebGPU preview)
  109. ### Version Notes
  110. - **r178+**: `PI2` deprecated (use `TWO_PI`), `transformedNormalView/World` renamed to `normalView/World`
  111. - **r171+**: Stable TSL API, requires `three/webgpu` import map entry
  112. ## Resources
  113. - [Three.js TSL Documentation](https://threejs.org/docs/pages/TSL.html)
  114. - [Three.js Shading Language Wiki](https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language)
  115. - [Three.js WebGPU Examples](https://github.com/mrdoob/three.js/tree/master/examples)
  116. - [WebGPU Best Practices](https://toji.dev/webgpu-best-practices/)
  117. - [Agent Skills Specification](https://github.com/anthropics/skills)
  118. ## License
  119. MIT License
  120. Code examples derived from [Three.js](https://github.com/mrdoob/three.js) (MIT License).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.