ST

stride-shader-asset-workflow

Ensures Stride game engine shader assets are correctly linked and built.

Install

mkdir -p .claude/skills/stride-shader-asset-workflow && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11545" && unzip -o skill.zip -d .claude/skills/stride-shader-asset-workflow && rm skill.zip

Installs to .claude/skills/stride-shader-asset-workflow

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Use when adding, renaming, or debugging Stride SDSL shader files (`*.sdsl`) in a Stride project. Enforces the correct shader registration workflow across `.sdpkg` asset folders, `.csproj` linked shader items, generated shader key files (`*.sdsl.cs`), and forced Stride asset rebuild targets before runtime shader debugging, so agents do not misdiagnose stale asset database/module errors as shader code errors.
410 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Add new Stride shader files (.sdsl)
  • Rename or move existing shader files
  • Update generated C# key files (.sdsl.cs)
  • Verify project setup for Stride shaders
  • Resolve Stride shader errors related to asset compilation

How it works

The skill guides the user through a sequence of steps including adding shader files, updating project configurations, and running Stride asset compilation commands to ensure shaders are correctly registered and compiled.

Inputs & outputs

You give it
A new or modified Stride shader file (.sdsl) within a Stride project.
You get back
Updated generated C# shader key files (.sdsl.cs) and a correctly compiled Stride asset database.

When to use stride-shader-asset-workflow

  • Adding new SDSL shader files
  • Fixing shader loading errors
  • Updating shader key files after changes

About this skill

Stride Shader Asset Workflow

Overview

This skill defines the correct workflow for adding, updating, and debugging Stride shader files (*.sdsl) in C# projects.

It helps agents verify project setup, generated shader key files, and Stride asset compilation steps.

When To Use

  • Adding a new Stride shader file (*.sdsl) of any kind (compute, material/mixin, effect-related, or custom shader classes)
  • Renaming/moving shader files
  • Adding/changing shader parameters and needing updated generated C# key files (*.sdsl.cs)
  • Seeing Stride shader errors like E1202 ... mixin ... is not in the module
  • Seeing runtime behavior that suggests a new shader is not being loaded
  • Working in projects that use both .sdpkg asset folders and explicit .csproj shader links

Default Stride Template Layout (Usual Case)

In a standard Stride game created from the template, shader files are usually placed in an Effects folder next to the platform-independent game core project (<GameName>.csproj), for example:

  • <SolutionRoot>/<GameName>/<GameName>.csproj
  • <SolutionRoot>/<GameName>/Effects/*.sdsl
  • <SolutionRoot>/<GameName>/<GameName>.sdpkg

Typical template behavior:

  • <GameName>.sdpkg includes AssetFolders for both Assets and Effects
  • The core game .csproj often has no explicit shader item entries
  • Shader files are picked up via SDK-style default items (None) + Stride's default target metadata (None Update="**\*.sdsl" Generator="StrideShaderKeyGenerator")

Practical implication:

  • If you are working inside a normal template game project and shaders live under the project folder (for example Effects/), you usually do not need explicit .csproj shader link items.
  • The explicit linked/wildcard .csproj patterns in this skill are mainly for:
    • shared external shader folders (for example ..\..\shaders)
    • runner/test projects
    • non-template layouts

Generated Shader Keys (Use These, Not String Keys)

Stride has a built-in shader key generator for .sdsl files:

  • VS custom tool: StrideShaderKeyGenerator
  • Output: *.sdsl.cs
  • Generated class pattern: <ShaderName>Keys

Use generated keys in C# when possible instead of string-based ParameterKeys.FindByName(...)/manual names.

Why:

  • Prevents binding bugs from wrong names or missing qualification (for example Width vs MyShader.Width)
  • Keeps parameter bindings in sync when shader parameters change

Important Trap: None vs Content Shader Items

Stride's default targets auto-apply the shader key generator to:

  • None Update="**\\*.sdsl" Generator="StrideShaderKeyGenerator"

If your project links shaders as Content items (common in runner/test projects), you might not get automatic key generation unless you set generator metadata explicitly on those linked items.

For linked shaders in a C# project (especially external/shared shader folders), prefer None items (so the default Stride metadata pattern matches), and set the generator explicitly anyway.

Preferred scalable pattern (works with subfolders):

<ItemGroup>
  <None Include="..\\..\\shaders\\**\\*.sdsl"
        Link="Assets\\%(RecursiveDir)%(Filename)%(Extension)"
        Generator="StrideShaderKeyGenerator" />
</ItemGroup>

<ItemGroup>
  <Compile Include="..\\..\\shaders\\**\\*.sdsl.cs"
           Link="Assets\\Generated\\%(RecursiveDir)%(Filename)%(Extension)"
           Visible="false"
           AutoGen="True"
           DesignTime="True" />
</ItemGroup>

Notes:

  • Generator="StrideShaderKeyGenerator" is the VS/custom-tool hook that produces *.sdsl.cs.
  • The recursive wildcard patterns (..\\..\\shaders\\**\\*.sdsl and ..\\..\\shaders\\**\\*.sdsl.cs) keep the project file small and automatically pick up new shaders/subfolders.
  • The Compile Include="..\\..\\shaders\\**\\*.sdsl.cs" pattern ensures generated key files are compiled when working in CLI/agent workflows and linked shader layouts.
  • If a project intentionally uses Content for linked shaders, Generator="StrideShaderKeyGenerator" must be set explicitly on each shader item.
  • This wildcard setup was validated in a Stride runner project with:
    • StrideAssetUpdateGeneratedFiles
    • StrideCleanAsset
    • StrideCompileAsset
    • a real GPU roundtrip run (compress + low-level decompressor fallback + verify pass)

C# Project Setup (Required for CLI/Agent Workflows)

In addition to Stride.Engine / Stride.Rendering, ensure the project has the asset compiler targets available (directly or transitively). In standalone runner/test projects, adding this package explicitly makes the CLI targets available:

<PackageReference Include="Stride.Core.Assets.CompilerApp" Version="4.3.x">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>build;buildTransitive</IncludeAssets>
</PackageReference>

Without the asset compiler targets, StrideAssetUpdateGeneratedFiles, StrideCleanAsset, and StrideCompileAsset may be unavailable.

Workflow (Do This In Order)

  1. Add the shader file to the repository.
  • Example: shaders/MyPass.sdsl
  1. Verify the Stride package includes the folder that contains the shader.
  • Check <project>.sdpkg AssetFolders.
  • Example valid entry:
AssetFolders:
  - Path: !dir ../../shaders
  1. If the project also links shader files in the .csproj, add the new shader there too.
  • This is easy to miss and can cause "mixin not in module" even if .sdpkg looks correct.
  • Prefer linked None items for shaders (not Content) and set Generator="StrideShaderKeyGenerator" so *.sdsl.cs key files regenerate.
  • Ensure generated *.sdsl.cs files are compiled (prefer recursive wildcard Compile Include pattern).
  • Example pattern:
<None Include="..\..\shaders\**\*.sdsl"
      Link="Assets\%(RecursiveDir)%(Filename)%(Extension)"
      Generator="StrideShaderKeyGenerator" />

<Compile Include="..\..\shaders\**\*.sdsl.cs"
         Link="Assets\Generated\%(RecursiveDir)%(Filename)%(Extension)"
         Visible="false"
         AutoGen="True"
         DesignTime="True" />
  1. Refresh generated shader key files (especially in agent/CLI workflows, outside VS).
  • In current Stride NuGet targets, StrideAssetUpdateGeneratedFiles is a standalone target and may require _StridePrepareAssetCompiler first when invoked directly.
  • Run (PowerShell-safe quoted /t: form):
dotnet msbuild src/MyStrideApp/MyStrideApp.csproj "/t:_StridePrepareAssetCompiler;StrideAssetUpdateGeneratedFiles" /p:Configuration=Debug
  1. Force a Stride asset rebuild (do not trust normal dotnet build up-to-date checks).
  • Run these targets explicitly:
dotnet msbuild src/MyStrideApp/MyStrideApp.csproj /t:StrideCleanAsset /p:Configuration=Debug
dotnet msbuild src/MyStrideApp/MyStrideApp.csproj /t:StrideCompileAsset /p:Configuration=Debug
  1. Build and run only after the asset rebuild.
dotnet build src/MyStrideApp/MyStrideApp.csproj -c Debug
dotnet run --project src/MyStrideApp/MyStrideApp.csproj -c Debug
  1. If still failing, then debug shader code/runtime bindings.
  • At this point, errors are more likely real shader syntax/semantics/binding issues.

Failure Signatures (Interpretation)

  • E1202: The mixin [X] ... is not in the module

  • Meaning:

    • Shader not included in Stride asset module yet (stale asset DB), or
    • Shader file not reachable via .sdpkg AssetFolders, or
    • Shader file not linked in .csproj when the project relies on explicit linked shader Content
  • Action:

    • Re-run the workflow above from step 2, especially steps 3-4
  • Stride asset build says many items are up-to-date but new shader still missing

  • Meaning:

    • Up-to-date inputs did not include your new shader path (or cache state is stale)
  • Action:

    • Run StrideCleanAsset then StrideCompileAsset
  • C# bindings suddenly stop working after shader parameter rename/addition

  • Meaning:

    • Generated *.sdsl.cs keys are stale or missing, or code is using string keys manually
  • Action:

    • Run _StridePrepareAssetCompiler;StrideAssetUpdateGeneratedFiles
    • Prefer generated <ShaderName>Keys over string key lookup
  • Generated *.sdsl.cs fails to compile on a shader float default value

  • Meaning:

    • The shader default literal was written as 100.0 (double-like in generated C#) and the generated key file emits ParameterKeys.NewValue<float>(100.0)
  • Action:

    • Write explicit float literals in SDSL defaults (for example 100.0f)
    • Re-run generated-file update target

Agent Rules (Preventing Workarounds Too Early)

  • Do not add low-level D3D/SharpDX shader dispatch workarounds for a newly-added shader until the explicit Stride asset rebuild workflow has been executed.
  • Always inspect both:
    • .sdpkg AssetFolders
    • .csproj linked shader Content items (if present in that project)
  • Prefer generated *.sdsl.cs key classes for parameter binding; avoid string keys unless necessary.
  • When reporting results, state whether StrideAssetUpdateGeneratedFiles, StrideCleanAsset, and StrideCompileAsset were run.

Quick Checklist

  • .sdsl file exists
  • .sdpkg asset folder includes its directory
  • .csproj links the shader (if project uses linked shader Content)
  • .csproj uses linked None shader items (preferred) or explicit generator metadata on linked shader items
  • Generator="StrideShaderKeyGenerator" set on linked shader items
  • Compile Include="..\\..\\shaders\\**\\*.sdsl.cs" (or equivalent) present so generated keys compile
  • _StridePrepareAssetCompiler;StrideAssetUpdateGeneratedFiles run after shader changes
  • StrideCleanAsset run
  • StrideCompileAsset run
  • dotnet build / dotnet run run after asset rebuild

When not to use it

  • Debugging low-level D3D/SharpDX shader dispatch issues before asset rebuild
  • When the issue is not related to Stride shader asset registration or compilation
  • When only needing execution guidance for an already defined shader

Limitations

  • Does not provide solutions for low-level D3D/SharpDX shader dispatch issues.
  • Requires manual inspection of .sdpkg AssetFolders and .csproj linked shader items.
  • Relies on specific Stride asset compilation targets being available in the project.

How it compares

This workflow provides a structured approach to managing Stride shader assets and their C# bindings, preventing common compilation and loading errors that manual processes might miss.

Compared to similar skills

stride-shader-asset-workflow side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
stride-shader-asset-workflow (this skill)05moNo flagsIntermediate
csharp-pro94moNo flagsIntermediate
tdd-workflow04moReviewIntermediate
csharp-developer432moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

csharp-pro

sickn33

Write modern C# code with advanced features like records, pattern matching, and async/await. Optimizes .NET applications, implements enterprise patterns, and ensures comprehensive testing. Use PROACTIVELY for C# refactoring, performance optimization, or complex .NET solutions.

953

tdd-workflow

DreamLab2025

Use this skill when writing new features, fixing bugs, or refactoring code in Verendar. Enforces test-driven development with 80%+ coverage using xUnit, FluentAssertions, NSubstitute, and Testcontainers. Activate proactively whenever the user is about to write new application code, fix a bug, or add

00

csharp-developer

zenobi-us

Expert C# developer specializing in modern .NET development, ASP.NET Core, and cloud-native applications. Masters C# 12 features, Blazor, and cross-platform development with emphasis on performance and clean architecture.

43151

performance-benchmark

dotnet

Generate and run ad hoc performance benchmarks to validate code changes. Use this when asked to benchmark, profile, or validate the performance impact of a code change in dotnet/runtime.

328

bug-fix

mono

Fix bugs in SkiaSharp C# bindings. Structured workflow for investigating, fixing, and testing bug reports. Triggers: Crash, exception, AccessViolationException, incorrect output, wrong behavior, memory leak, disposal issues, "fails", "broken", "doesn't work", "investigate issue", "fix issue", "look at #NNNN", any GitHub issue number referencing a bug. For adding new APIs, use `add-api` skill instead.

426

write-script-csharp

windmill-labs

MUST use when writing C# scripts.

318

Search skills

Search the agent skills registry