Agent skill

Hlsl

by LuisaGroup in LuisaGroup/LuisaCompute

HLSL code generation, StringBuilder patterns, builtin headers, and DXIL embedding.

Apache-2.0Auto-check passedGame Development

Install Hlsl

skills CLI
$ npx skills add LuisaGroup/LuisaCompute --skill hlsl -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install LuisaGroup/LuisaCompute hlsl --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/LuisaGroup/LuisaCompute.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/hlsl .claude/skills/hlsl && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
hlsl
GitHub stars
1.1k
Token cost
~1.6k tokens
SKILL.md length
336 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
Apache-2.0

At a glance

HLSL code generation, StringBuilder patterns, builtin headers, and DXIL embedding.

  • Works in 5 steps: Use "text"sv literals to avoid allocations → vstd::to_string() for integers (faster… → builder.reserve(1024) when size known → …
  • Tasks that involve Shaders
  • SKILL.md covers StringBuilder, Code Generation Patterns, Iteration & Hash and Best Practices, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Hlsl is an agent skill from LuisaGroup/LuisaCompute. HLSL code generation, StringBuilder patterns, builtin headers, and DXIL embedding.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Game Development, covering Shaders. The repository describes itself as: High-Performance Rendering Framework on Stream Architectures. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Shaders

Example prompts

  • “/hlsl”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Use "text"sv literals to avoid allocations
  2. vstd::to_string() for integers (faster than luisa::format())
  3. builder.reserve(1024) when size known
  4. operator<< for chaining, operator+= for single items
  5. Check size() before modifying last character

What it can do on your machine

Read from SKILL.md and the folder at commit 0c84a1a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are cpp).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Hlsl loads about 1.6k tokens when it runs. Until then it costs about 22 tokens; SKILL.md has 336 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~22
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from LuisaGroup/LuisaCompute at commit 0c84a1a, republished under its Apache-2.0 licence (© LuisaGroup). 336 words, ~1,640 tokens.

Download SKILL.mdSave it as .claude/skills/hlsl/SKILL.md (or your agent's skills folder).
name
hlsl
description
HLSL code generation, StringBuilder patterns, builtin headers, and DXIL embedding.

HLSL Code Generation

Codegen utilities using vstd::StringBuilder and formatting helpers.

StringBuilder

cpp
#include <luisa/vstl/string_builder.h>

vstd::StringBuilder builder;
builder.clear();
size_t sz = builder.size();
vstd::string_view view = builder.view();
char* data = builder.data();
Appending
cpp
str.append("Hello");
str += "World"sv;
str.append(' ');
str << '\n';
str.append(other_builder);
str << "func" << '(' << ")";
Numbers
cpp
vstd::to_string(42, str);        // int (faster than format)
vstd::to_string(3.14f, str);     // float
str << luisa::format("{}", 42);
str << luisa::format("{}, {}!", "Hello", "World");
str << luisa::format("{:016X}", hash);
String View Literals
cpp
using namespace std::string_view_literals;
str += "void"sv;  // no allocation

Code Generation Patterns

Function Declaration
cpp
void GetFunctionDecl(Function func, vstd::StringBuilder &str) {
    vstd::StringBuilder data;
    if (func.return_type()) CodegenUtility::GetTypeName(*func.return_type(), data, Usage::READ);
    else data += "void"sv;
    data += " "sv;
    CodegenUtility::GetFunctionName(func, data);
    data += '(';
    for (auto &&arg : func.arguments()) {
        Usage usage = func.variable_usage(arg.uid());
        CodegenUtility::GetTypeName(*arg.type(), data, usage);
        data << ' ';
        vstd::StringBuilder varName;
        CodegenUtility::GetVariableName(func, arg, varName);
        data << varName << ',';
    }
    if (!func.arguments().empty()) data[data.size() - 1] = ')';
    else data += ')';
    str << '\n' << data;
}
Template Parameters
cpp
str << "template<"sv;
for (uint64 i = 0; i < tempIdx; ++i) {
    str << "typename T"sv; vstd::to_string(static_cast<int64_t>(i), str); str << ',';
}
if (tempIdx > 0) *(str.end() - 1) = '>';
Call Expression
cpp
str << "func_name"sv << '(';
if (!args.empty()) {
    for (size_t i = 0; i < args.size() - 1; ++i) { args[i]->accept(vis); str << ','; }
    args.back()->accept(vis);
}
str << ')';
Type-Aware Generation
cpp
if (t->is_texture() || t->is_buffer()) { str << 'T'; vstd::to_string(tempIdx++, str); }
else if (t->is_vector()) { str << "float"sv; vstd::to_string(t->dimension(), str); }
else if (t->is_matrix()) { auto n = vstd::to_string(t->dimension()); str << "_float"sv << n << 'x' << n; }
RAII Wrapping
cpp
struct CodeWrapper {
    vstd::StringBuilder *_result;
    CodeWrapper(vstd::StringBuilder *r, string_view open) : _result(r) { if (_result) *_result << open; }
    ~CodeWrapper() { if (_result) *_result << ')'; }
};
CodeWrapper wrapper{&str, "to_float4x4("};
// inner content generated; ')' appended automatically
Trailing Comma Fix
cpp
str << '(';
for (auto &&item : items) str << item << ',';
if (!items.empty()) str[str.size() - 1] = ')';
else str << ')';

Iteration & Hash

cpp
for (char c : str) {}
str.erase(str.begin() + 5);
vstd::hash<vstd::StringBuilder> hasher; size_t h = hasher(builder);
if (builder1 == builder2) {}
if (builder1 == "literal"sv) {}

Best Practices

  1. Use "text"sv literals to avoid allocations
  2. vstd::to_string() for integers (faster than luisa::format())
  3. builder.reserve(1024) when size known
  4. operator<< for chaining, operator+= for single items
  5. Check size() before modifying last character

HLSL Builtins

Located in src/backends/common/hlsl/builtin/. Access via:

cpp
#include <backends/common/hlsl/builtin/hlsl_builtin.hpp>
auto header = lc_hlsl::get_hlsl_builtin("hlsl_header");
std::string_view code(static_cast<const char*>(header.ptr), header.size);
Header Files (.bytes)
KeyDescription
hlsl_headerMain HLSL header
hlsl_header_fallbackFallback header
spv_aliasSPIR-V aliases
bindless_upload.bytes / bindless_upload_vk.bytesBindless upload helpers
accel_process.bytes / accel_process_vk.bytesAcceleration-structure processing
accel_process_vk_motion.bytesAcceleration-structure processing with motion blur
raytracing_motion_headerRay tracing motion blur
dx_linalgLinear algebra utils (DXIL)
vk_linalgLinear algebra utils (SPIR-V)
raytracing_headerRay tracing
tex2d_bindless / tex3d_bindlessBindless textures
compute_quadCompute quad ops
determinant / inverseMatrix ops
indirectIndirect dispatch/draw
resource_sizeResource queries
accel_headerAcceleration structures
copy_signSign ops
bindless_commonBindless utils
auto_diffAutodiff
reduceParallel reduction
DXIL Files (.dxil)
KeyDescription
accel_process_vk.dxilVulkan acceleration structures
load_bdls.dxil / load_bdls_vk.dxilBindless loading
set_accel4.dxilSet acceleration structure
bc6_encodeblock.dxil / bc6_trymodeg10.dxil / bc6_trymodele10.dxilBC6 compression
bc7_encodeblock.dxil / bc7_trymode02.dxil / bc7_trymode137.dxil / bc7_trymode456.dxilBC7 compression
Adding Builtins
  1. Add .bytes or .dxil to src/backends/common/hlsl/builtin/
  2. Declare: LC_HLSL_DECL_VARNAME(my_bytes)
  3. Register: LC_HLSL_INSERT_VARNAME(my_bytes, "my_key")

Build: .hlsl → .bytes, shaders → .dxil, embedded via bin2obj.

Codegen Debug

Set env LUISA_DUMP_SOURCE=1 to dump generated HLSL to per-shader files.
Output: hlsl_output_<shader_name>.hlsl in the working directory.

Naming priority depends on the backend and shader path:

DX compute / raster / save paths:

  1. ShaderOption::name / fileName — user-provided name
  2. Function::name() — kernel/callable debug name
  3. Function::hash() formatted as hex — fallback (e.g. hlsl_output_a1b2c3d4.hlsl)

VK internal builtin compute helpers only (ComputeShader::compile_builtin_hlsl_to_spirv):

  1. file_name — user-provided / cached name
  2. Generated HLSL MD5 — fallback

VK raster (VkRasterExt): ShaderOption::name is always required, so the dump file uses that name.

VK user compute shaders must use native SPIR-V codegen (LUISA_XIR_TO_SPIRV or LUISA_AST_LLVM_TO_SPIRV); the Vulkan Function compute path must not call HLSL/DXC.

Files are written with "wb" (overwrite) — no need to delete old files.
Each shader gets its own file; no more single hlsl_output.hlsl with appended content.

© LuisaGroup, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/hlsl of LuisaGroup/LuisaCompute.

Open the folder on GitHubat commit 0c84a1a

Compare with similar skills

Hlsl next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Hlsl compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Hlsl this skillLuisaGroup/LuisaCompute1.1k—~1.6kAutomated safety check: PassApache-2.0
PixijsRSamaium/CanvasEngine4012 repos~1.6kAutomated safety check: PassMIT
New ExperimentTresjs/tres3.8k—~782Automated safety check: PassMIT
Assets Shader List AllIvanMurzak/Unity-MCP4.4k—~435Automated safety check: PassApache-2.0
Handle Sdr Tonemap Lutclshortfuse/renodx4.5k—~7.3kAutomated safety check: PassMIT
Unreal Material and VFX Workflowflopperam/unreal-engine-mcp1.1k—~927Automated safety check: PassNone

Similar skills

  • Pixijs

    RSamaium/CanvasEngine

    Use this skill first for ANY PixiJS v8 task; it routes to the right specialized skill for the job.

    401 GitHub starsUsed in 2 repos~1.6k tokens
    Game DevelopmentAuto-check passed
  • New Experiment

    Tresjs/tres

    Create a new experiment in TresJS Lab with all necessary files

    3.8k GitHub stars~782 tokensUpdated yesterday
    Game DevelopmentAuto-check passed
  • Assets Shader List All

    IvanMurzak/Unity-MCP

    List all shaders available in the project assets and packages, sorted by name.

    4.4k GitHub stars~435 tokensUpdated 5 days ago
    Game DevelopmentAuto-check passed
  • Handle Sdr Tonemap Lut

    clshortfuse/renodx

    RenoDX HLSL/Slang shader workflow for proven shader-side SDR tonemap, hard clip, LUT, color grade, and HDR bridge changes.

    4.5k GitHub stars~7.3k tokensUpdated today
    Game DevelopmentAuto-check passed
  • Unreal Material and VFX Workflow

    flopperam/unreal-engine-mcp

    Walks an Unreal Engine MCP agent through building materials, Niagara particle systems, Chaos destruction, and curve assets with inspect-then-edit steps.

    1.1k GitHub stars~927 tokensUpdated 3 mo ago
    Game DevelopmentAuto-check passed
  • Rdc CLI

    BANANASJIM/rdc-cli

    A skill your agent uses when working with RenderDoc capture files (.rdc), analyzing GPU frames, tracing shaders, inspecting draw calls, or running CI assertions against GPU captures.

    182 GitHub stars~2.9k tokensUpdated today
    Game DevelopmentAuto-check passed

More from LuisaGroup/LuisaCompute

All 12 skills in this repo
  • Git

    LuisaGroup/LuisaCompute

    Show uncommitted changes and commit history via git. An agent skill from LuisaGroup/LuisaCompute.

    1.1k GitHub stars~544 tokensUpdated today
    Auto-check passed
  • Ast

    LuisaGroup/LuisaCompute

    Manual AST construction with FunctionBuilder for kernels and callables without DSL sugar.

    1.1k GitHub stars~4.2k tokensUpdated today
    Auto-check passed
  • Cmake

    LuisaGroup/LuisaCompute

    CMake build options, custom functions, and backend patterns for LuisaCompute.

    1.1k GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Cpp Style

    LuisaGroup/LuisaCompute

    C++ naming, formatting, static analysis, and RTTI rules for LuisaCompute.

    1.1k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Debug

    LuisaGroup/LuisaCompute

    Debug crashes and test failures via stack-traces, host/device logging, and DSL buffer inspection.

    1.1k GitHub stars~2.3k tokensUpdated today
    Auto-check passed
  • Llvm Spirv

    LuisaGroup/LuisaCompute

    Experimental Vulkan AST-to-LLVM-to-SPIR-V backend, its fail-closed runtime-interface boundary, LLVM build integration, and validation path.

    1.1k GitHub stars~2.8k tokensUpdated today
    Auto-check passed

Questions about Hlsl

What does Hlsl do?

HLSL code generation, StringBuilder patterns, builtin headers, and DXIL embedding. Hlsl is an agent skill from LuisaGroup/LuisaCompute. HLSL code generation, StringBuilder patterns, builtin headers, and DXIL embedding.

When should I use Hlsl?

Hlsl fits situations like: tasks that involve Shaders.

How do I install Hlsl in Claude Code?

Run `npx skills add LuisaGroup/LuisaCompute --skill hlsl -a claude-code`. Or copy the skill folder (.agents/skills/hlsl in LuisaGroup/LuisaCompute) into .claude/skills/hlsl in your project. Claude Code loads it when a task matches its description.

How do I install Hlsl in Codex?

Run `npx skills add LuisaGroup/LuisaCompute --skill hlsl -a codex`. Or copy the skill folder (.agents/skills/hlsl in LuisaGroup/LuisaCompute) into .agents/skills/hlsl in your project. Codex loads it when a task matches its description.

Can I use Hlsl in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add LuisaGroup/LuisaCompute --skill hlsl -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/hlsl, .gemini/skills/hlsl, .github/skills/hlsl and .opencode/skills/hlsl in your project.

What does Hlsl need to run?

SKILL.md names no scripts, command-line tools or credentials: Hlsl is instructions for the agent only.

Does Hlsl access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Hlsl safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Hlsl use?

Hlsl is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Hlsl use?

About 1.6k tokens (SKILL.md is roughly 6.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Hlsl?

Skills that share tags, products or a category with Hlsl: Pixijs (RSamaium/CanvasEngine, 401 stars), New Experiment (Tresjs/tres, 3.8k stars), Assets Shader List All (IvanMurzak/Unity-MCP, 4.4k stars) and Handle Sdr Tonemap Lut (clshortfuse/renodx, 4.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Hlsl?

LuisaGroup (a GitHub organization) maintains it in LuisaGroup/LuisaCompute, which has 1,053 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 9, 2026.

Source: LuisaGroup/LuisaCompute on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.