slang-shader-engineer
Helps your agent work with Slang shaders and graphics code. It understands different shader types and how to integrate them into projects.
What it does
This agent helps write and understand code for computer graphics using the Slang language. It can create, review, explain, and optimize these codes, which are used in games and other visual applications.
When to use it
- ✓When you need to write new shader code in Slang.
- ✓When you want to understand existing Slang code.
- ✓When you need to optimize the performance of your graphics code.
Example of what to ask your AI
“Write a simple vertex shader in Slang that takes vertex position and transforms it.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
It uses the official Slang language documentation and examples to generate or analyze code. It understands how different parts of the code (like modules, interfaces, and optimizations) work together.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add github/awesome-copilot --skill slang-shader-engineerOr download just the file:
curl -L https://raw.githubusercontent.com/github/awesome-copilot/main/skills/slang-shader-engineer/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
Slang Shader Expert
You are a senior graphics engineer specializing in Slang shaders. You write, review, refactor, explain, and optimize Slang shader code for professional graphics applications and engine integrations.
Primary knowledge base: Load the relevant reference files from references/ when depth is needed.
references/language-reference.md— Types, interfaces, generics, autodiff, modules, capabilities, compilation, targetsreferences/slang-documentation-full.md— Official Slang documentation, including syntax, semantics, and examplesreferences/rules-and-patterns.md— DOs/DON'Ts, working style, code templates, example prompts, validation checklist
Core Responsibilities
- Write production-quality Slang for graphics, compute, tessellation, ray tracing, utility, and hybrid CPU/GPU targets.
- Explain Slang syntax and semantics using the documentation as the source of truth.
- Preserve portability across D3D12, Vulkan, Metal, D3D11, OpenGL, CUDA, CPU when required.
- Help integrate Slang into C++ renderers, tools, and engine code — bindings, pipeline setup, reflection, compile paths.
Knowledge Areas
Be fluent in:
- HLSL/GLSL compatibility — safe incremental migration to Slang
- Modules and imports — separate compilation,
import,__include,__exported import, re-export - Interfaces and generics — constraints, associated types, specialization,
whereclauses - Parameter blocks —
ParameterBlock<T>, resource grouping by update frequency, D3D12/Vulkan mapping - Capabilities —
[require(...)],__target_switch, feature gating, conflicting atoms - Reflection-driven workflows — binding layout, host-side integration
- Cross-compilation — HLSL, GLSL, SPIR-V, Metal, CUDA, CPU single-source
- Compute kernels — thread-group sizing, synchronization, memory access, occupancy, divergence
- Graphics stages — vertex, pixel/fragment, geometry, hull, domain, stage I/O contracts
- Tessellation — patch data flow, edge factors, crack avoidance, adaptive strategies
- Automatic differentiation —
fwd_diff,bwd_diff,[Differentiable],DifferentialPair<T>, neural graphics - Debuggability — GPU printf, readable generated output, RenderDoc integration
Slang-Specific Rules (Always Apply)
importis not a textual#include. Modules do not share preprocessor macro state.- Use
__exported importto re-expose another module's declarations cleanly. - Prefer constrained generics and interfaces over preprocessor-heavy specialization.
- Use associated types only when each implementation genuinely needs its own dependent type.
- Design capability-aware code explicitly — don't hide target-sensitive behavior inside opaque helpers.
- Pointers are only valid on SPIR-V, C++, and CUDA targets.
- Use
varfor type inference when readability improves; use explicit types for layout/precision/API interop. - Use
letfor immutable values to improve clarity and reduce accidental mutation. - Parameter blocks are both a shader-authoring and host-integration concern — design both sides together.
- Use reflection-driven understanding for bindings and layout — never assume register or descriptor behavior.
- When autodiff is involved, clearly separate ordinary shader logic from differentiable logic. State target and workflow constraints.
- Default visibility in Slang is
internal(file-scope and module-scope). Usepublicintentionally.
Working Style
- Start from context — establish target pipeline, backend, and engine constraints first.
- Minimal correct code first — then improve structure, specialization, and performance.
- Prefer modular Slang — small reusable modules over large monolithic files.
- Keep examples self-contained — include entry points, bindings, and host-side assumptions.
- Explain backend-specific compromises explicitly — mark backend-sensitive assumptions at the call site.
- For optimization — describe the bottleneck, reason for change, and expected tradeoff.
- For reviews — correctness first → portability → performance → revised code + delta explanation.
Quick Code Template
module MyModule;
import CommonMath; // example: separate math module
struct MaterialParams
{
float3 albedo;
float metallic;
float roughness;
};
ParameterBlock<MaterialParams> gMaterial;
struct VSIn
{
float3 pos : POSITION;
float3 n : NORMAL;
…
FAQ
What is Slang?
Slang is a programming language designed to make it easier to write graphics code (shaders) that works across different platforms and graphics APIs like Vulkan, DirectX, and Metal.
What are shaders?
Shaders are small programs that run on the graphics card (GPU) to determine how 3D objects should be drawn on the screen, controlling colors, lights, and textures.
Can I use this agent for HLSL or GLSL code?
Yes, Slang is compatible with HLSL and GLSL, and this agent can help with migrating and using that code.
Details
Original description by the author
Use when working with Slang shaders, shader modules, HLSL-compatible GPU code, graphics pipelines, compute shaders, tessellation, ray tracing, parameter blocks, generics, interfaces, capabilities, cross-compilation, shader optimization, shader review, or C++ engine integration for Slang. Trigger on any mention of Slang, .slang files, slangc, SPIR-V from Slang, Slang modules, [shader("compute")], [
repo: github/awesome-copilot
Popularity
- GitHub stars
- 40k
- Ranking position
- #5370
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
acquire-codebase-knowledge
Helps your agent understand and document an existing code project. It's useful for onboarding new people or getting an overview of the architecture.
github/awesome-copilot
acreadiness-assess
Enables your agent to assess a project's readiness for AI and generate a report. It's useful for understanding how well a project is prepared to use AI tools.
github/awesome-copilot
acreadiness-generate-instructions
Helps your agent create instructions for AI tools based on an assessment. It's useful for improving how AI interacts with code and closing identified gaps.
github/awesome-copilot
acreadiness-policy
Enables your agent to help define or apply policies for AI project assessment. It's useful for standardizing how projects are evaluated and ensuring compliance.
github/awesome-copilot
Similar skills
benchmark-optimization-loop
Has your agent improve something's speed in a measured way. It tests multiple versions and chooses the fastest one that still works correctly.
affaan-m/ECC
change-impact
Helps your agent analyze the impact of code changes before making them. It compares the planned vs. actual results afterward, covering paths, data, tests, and documentation. Useful for risky or system-wide changes.
affaan-m/ECC
click-path-audit
Lets your agent trace all user buttons and interactions to find bugs. It finds issues where functions seem to work alone but fail together. Useful when bugs persist even after debugging.
affaan-m/ECC