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.zipInstalls 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.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
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
.sdpkgasset folders and explicit.csprojshader 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>.sdpkgincludesAssetFoldersfor bothAssetsandEffects- The core game
.csprojoften 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.csprojshader link items. - The explicit linked/wildcard
.csprojpatterns in this skill are mainly for:- shared external shader folders (for example
..\..\shaders) - runner/test projects
- non-template layouts
- shared external shader folders (for example
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
WidthvsMyShader.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\\**\\*.sdsland..\\..\\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
Contentfor linked shaders,Generator="StrideShaderKeyGenerator"must be set explicitly on each shader item. - This wildcard setup was validated in a Stride runner project with:
StrideAssetUpdateGeneratedFilesStrideCleanAssetStrideCompileAsset- 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)
- Add the shader file to the repository.
- Example:
shaders/MyPass.sdsl
- Verify the Stride package includes the folder that contains the shader.
- Check
<project>.sdpkgAssetFolders. - Example valid entry:
AssetFolders:
- Path: !dir ../../shaders
- 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
.sdpkglooks correct. - Prefer linked
Noneitems for shaders (notContent) and setGenerator="StrideShaderKeyGenerator"so*.sdsl.cskey files regenerate. - Ensure generated
*.sdsl.csfiles are compiled (prefer recursive wildcardCompile Includepattern). - 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" />
- Refresh generated shader key files (especially in agent/CLI workflows, outside VS).
- In current Stride NuGet targets,
StrideAssetUpdateGeneratedFilesis a standalone target and may require_StridePrepareAssetCompilerfirst when invoked directly. - Run (PowerShell-safe quoted
/t:form):
dotnet msbuild src/MyStrideApp/MyStrideApp.csproj "/t:_StridePrepareAssetCompiler;StrideAssetUpdateGeneratedFiles" /p:Configuration=Debug
- Force a Stride asset rebuild (do not trust normal
dotnet buildup-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
- 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
- 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
.sdpkgAssetFolders, or - Shader file not linked in
.csprojwhen the project relies on explicit linked shaderContent
-
Action:
- Re-run the workflow above from step 2, especially steps 3-4
-
Stride asset build says many items are
up-to-datebut new shader still missing -
Meaning:
- Up-to-date inputs did not include your new shader path (or cache state is stale)
-
Action:
- Run
StrideCleanAssetthenStrideCompileAsset
- Run
-
C# bindings suddenly stop working after shader parameter rename/addition
-
Meaning:
- Generated
*.sdsl.cskeys are stale or missing, or code is using string keys manually
- Generated
-
Action:
- Run
_StridePrepareAssetCompiler;StrideAssetUpdateGeneratedFiles - Prefer generated
<ShaderName>Keysover string key lookup
- Run
-
Generated
*.sdsl.csfails to compile on a shaderfloatdefault value -
Meaning:
- The shader default literal was written as
100.0(double-like in generated C#) and the generated key file emitsParameterKeys.NewValue<float>(100.0)
- The shader default literal was written as
-
Action:
- Write explicit float literals in SDSL defaults (for example
100.0f) - Re-run generated-file update target
- Write explicit float literals in SDSL defaults (for example
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:
.sdpkgAssetFolders.csprojlinked shaderContentitems (if present in that project)
- Prefer generated
*.sdsl.cskey classes for parameter binding; avoid string keys unless necessary. - When reporting results, state whether
StrideAssetUpdateGeneratedFiles,StrideCleanAsset, andStrideCompileAssetwere run.
Quick Checklist
.sdslfile exists.sdpkgasset folder includes its directory.csprojlinks the shader (if project uses linked shaderContent).csprojuses linkedNoneshader items (preferred) or explicit generator metadata on linked shader itemsGenerator="StrideShaderKeyGenerator"set on linked shader itemsCompile Include="..\\..\\shaders\\**\\*.sdsl.cs"(or equivalent) present so generated keys compile_StridePrepareAssetCompiler;StrideAssetUpdateGeneratedFilesrun after shader changesStrideCleanAssetrunStrideCompileAssetrundotnet build/dotnet runrun 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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| stride-shader-asset-workflow (this skill) | 0 | 5mo | No flags | Intermediate |
| csharp-pro | 9 | 4mo | No flags | Intermediate |
| tdd-workflow | 0 | 4mo | Review | Intermediate |
| csharp-developer | 43 | 2mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by tebjan
View all by tebjan →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.
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
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.
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.
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.
write-script-csharp
windmill-labs
MUST use when writing C# scripts.