ShadowDusk: Command for Claude Code

.claude/commands/shader-compile.md

shader-compile is a command for Claude Code from kaltinril/ShadowDusk. It costs 0 tokens per session (401 once invoked), scanned A, original, MIT.

A command that compiles one HLSL effect file, a text file describing graphics shader techniques and passes, into a selected graphics-platform output using ShadowDusk CLI. It supports OpenGL, DirectX, and Metal targets.

In plain words
What is it for?
Use it to compile .fx or .hlsl files, verify inputs, report the output and detected techniques on success, or show source locations and diagnostics on failure.
Why use it?
It provides a repeatable compile step and reports exact compiler diagnostics when shader code fails.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is kaltinril/ShadowDusk's own configuration. It tells Claude Code how to work on ShadowDusk itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ShadowDusk configures →

Reuse

Borrowing it

Nothing to install: this file belongs to kaltinril/ShadowDusk. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/kaltinril/ShadowDusk/main/.claude/commands/shader-compile.md
Clone the repo
git clone --depth 1 https://github.com/kaltinril/ShadowDusk

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for shader-compile

README.md
[![agentmods](https://agentmods.dev/badge/commands/kaltinril/shadowdusk/shader-compile.svg)](https://agentmods.dev/commands/kaltinril/shadowdusk/shader-compile)
Your own site
<a href="https://agentmods.dev/commands/kaltinril/shadowdusk/shader-compile"><img src="https://agentmods.dev/badge/commands/kaltinril/shadowdusk/shader-compile.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 401 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00401
Opus 5 $0.00000 $0.00200
Sonnet 5 $0.00000 $0.00080
Haiku 4.5 $0.00000 $0.00040

Measured yesterday against content hash 4247e5042ffd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

shader-compile scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/shader-compile.md · 42 lines

What it actually says

/shader-compile — Compile a single .fx shader file

Compiles one HLSL Effect (.fx) file to a target platform using ShadowDusk CLI, then reports the result.

Usage

Invoke as: /shader-compile <path-to-fx-file> [platform]

If no platform is specified, default to OpenGL (the most cross-platform target).

Steps

  1. Verify the input file exists and has a .fx or .hlsl extension.

  2. Run the compiler:

dotnet run --project src/ShadowDusk.Cli -- \
  --input "$INPUT_FILE" \
  --platform "$PLATFORM" \
  --output "$INPUT_FILE_WITHOUT_EXTENSION.mgfx"

Valid --platform values: OpenGL, DirectX, Metal

  1. On success, report:

    • Output file path and size
    • Compilation time
    • Techniques and passes found in the effect
    • Target platform
  2. On failure, report:

    • The exact error message from the compiler
    • Source file, line number, and column
    • The raw compiler diagnostic output
    • Suggested fix if the error pattern is recognized (e.g., undeclared identifier, wrong semantic name, unsupported feature)

Common HLSL .fx errors to recognize:

  • error X3004: undeclared identifier → typo or missing declaration
  • error X3000: syntax error → malformed syntax, often a missing semicolon
  • error X4507: maximum temp register index exceeded → shader too complex for SM 3.0 target
  • error X3501: 'main': entrypoint not found → wrong entry point name in technique declaration
  • Sampler type mismatch → sampler2D vs SamplerState (use SamplerState for DX10+)
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 42 lines · 0 tokens per session scan A 4247e5042ffd

Subscribe to this mod's changes

shader-compile is a command published in the GitHub repository kaltinril/ShadowDusk (14 stars, last pushed 23d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 401 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.