Agent skill

Dream Shader Optimize

by TypeDreamMoon in TypeDreamMoon/DreamShader

Clean up a machine-written DreamShader source — a decompiled or migrated .dss (or a 1.x .dsm / .dsf export) — into one a person would have written, without changing what it builds, and prove the…

MITAuto-check passedGame Development

Install Dream Shader Optimize

skills CLI
$ npx skills add TypeDreamMoon/DreamShader --skill dream-shader-optimize -a claude-code

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

GitHub CLI
$ gh skill install TypeDreamMoon/DreamShader dream-shader-optimize --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/TypeDreamMoon/DreamShader.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.skill/dream-shader-optimize .claude/skills/dream-shader-optimize && 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
dream-shader-optimize
GitHub stars
106
Token cost
~1.9k tokens
SKILL.md length
1,009 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

Clean up a machine-written DreamShader source — a decompiled or migrated .dss (or a 1.x .dsm / .dsf export) — into one a person would have written, without changing what it builds, and prove the…

  • Asked to optimize
  • SKILL.md covers The rule, Do this, The passes and A 1.x export, if the user…, plus 2 more sections
  • Calls pwsh and git
  • Make readable a source produced by the DreamShader decompiler

What it does

Dream Shader Optimize is an agent skill from TypeDreamMoon/DreamShader. Clean up a machine-written DreamShader source — a decompiled or migrated .dss (or a 1.x .dsm / .dsf export) — into one a person would have written, without changing what it builds, and prove the graph is unchanged. Use when asked to optimize, clean up, tidy, refactor or make readable a source produced by the DreamShader decompiler or by dsc migrate.

Its SKILL.md is about 1.9k 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 and Reverse engineering and malware. It works with Unreal Engine. The repository describes itself as: Unreal Engine Material DSL. Use Dream Shader Lang Write Unreal Material. Simple · Fast · Full syntax · HLSL GLSL Lang Support. The licence is MIT.

When your agent uses it

  • Asked to optimize
  • Make readable a source produced by the DreamShader decompiler

Example prompts

  • “/dream-shader-optimize”

What it can do on your machine

Read from SKILL.md and the folder at commit d20819f. 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

    Shell commands in SKILL.md call:

    • pwsh
    • git

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

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    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

Dream Shader Optimize loads about 1.9k tokens when it runs. Until then it costs about 93 tokens; SKILL.md has 1,009 words of instructions outside code blocks.

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

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 TypeDreamMoon/DreamShader at commit d20819f, republished under its MIT licence (© TypeDreamMoon). 1,009 words, ~1,941 tokens.

Download SKILL.mdSave it as .claude/skills/dream-shader-optimize/SKILL.md (or your agent's skills folder).
name
dream-shader-optimize
description
Clean up a machine-written DreamShader source — a decompiled or migrated .dss (or a 1.x .dsm / .dsf export) — into one a person would have written, without changing what it builds, and prove the graph is unchanged. Use when asked to optimize, clean up, tidy, refactor or make readable a source produced by the DreamShader decompiler or by dsc migrate.

dream-shader-optimize <file>

A decompiled or migrated source builds the right graph, but it reads like a machine wrote it. This skill turns it into the file a person would have written — and proves, node for node, that the graph did not change.

Paths below are relative to the plugin root, Plugins/DreamShader/.

The rule

Behaviour must not change. Renaming a local, inlining a value read once, naming a value read twice, moving repeated logic into a helper, swapping a class-exact node call for the HLSL that builds the same node — safe. Reordering lerp arguments, folding pow(x, 2) into x * x, dropping a saturate, renaming a parameter — not: those are changes, and they belong in a separate, explicitly requested edit.

Do this

1 — Read the file, its header warnings and the language. Every // Warning: DSHnnnn: … line under // Decompiled by DreamShader from … names something the text cannot state the way the asset has it; they are the work list (Docs/diagnostics/DSH9xxx.md). Read reference/dss.md.

A .dsm / .dsf from -Format Legacy? Do not clean 1.x text by hand. Decompile the asset again as 2.0 (the default) — or dsc migrate the file (dream-shader-migrate) — and optimize the .dss. The 2.0 text starts far cleaner: a value read once is already inline, one read twice already has one local, literals are exact.

2 — Capture the graph before touching anything. dump-graph generates the source in memory and writes a canonical JSON of each asset's graph — node classes, properties, connections, pin order; no coordinates, no GUIDs. It writes no asset:

bash
pwsh -File Plugins/DreamShader/.skill/dsc.ps1 dump-graph DShader/Decompiled/Materials/Game/M_Steel.dss -Out Saved/Optimize/before

If an asset of that path already exists on disk, dump-graph reads it as it stands instead of generating it (the run says so). A fresh decompile under Decompiled/ has none.

3 — Apply the passes below. Then check it.

4 — Prove nothing changed.

bash
pwsh -File Plugins/DreamShader/.skill/dsc.ps1 dump-graph DShader/Decompiled/Materials/Game/M_Steel.dss -Out Saved/Optimize/after
git diff --no-index -- Saved/Optimize/before Saved/Optimize/after

Every hunk is a behavioural difference. The only acceptable ones are those the user asked for, and the Constant nodes a -Readable decompile adds (the shader is the same). Anything else: undo that pass.

5 — Retarget, last. Move the file to the place that names the original asset, or give its export a /// @name /Game/Materials/Metal/M_Steel — the step that makes this source authoritative. Then compile -Force -CleanNew once; delete nothing until the rebuilt asset has been looked at in the editor.

6 — Report what changed, the dump diff verdict, and — separately — every header warning you could not resolve from the source alone. That list is for the human; it needs the original asset open.

The passes

Resolve the header warnings

Each // Warning: is something the asset has and the text could not say. Some are fixed in the source (a function asset that moved: correct the /// @asset path); some only in the original asset (re-assign it, decompile again); some are accepted with the user (a node property the language cannot state). Delete a warning line only once it is resolved or accepted.

Rename what deserves a name

Locals named after their node (Multiply_2, Sample, Combined) become what the value is: scanline, bandPhase, edgeFalloff.

  • A renamed local must be renamed in its #pragma layout(Node, Var = …) line too, or that position is orphaned.
  • A uniform's name is the parameter's name. Renaming it renames the parameter, and every material instance that overrides it silently loses the override. Keep the name — or rename with /// @name <the old name> above it, which keeps the parameter.
  • An export function's name is the asset's name: renaming it moves the asset unless /// @name keeps it.
Prefer HLSL to class-exact node calls

UE.Multiply(A = x, B = y) is x * y; UE.LinearInterpolate(A = a, B = b, Alpha = t) is lerp(a, b, t). Write the HLSL where it builds the same node, and keep UE.<Class>(…) where the language has no spelling for it. Or decompile again with -Readable, which does this throughout (the graph may gain Constant nodes; the shader does not change).

Show full SKILL.md (378 more words)Show less
Factor repeated logic

Logic written out twice becomes a helper (float3 Tint(float3 C, float K) { … }, no linkage keyword). A helper is inlined at each call, and two identical calls are one node, so the graph does not grow.

Keep the layout

#pragma layout(…) lines are the node positions of the original graph and #pragma region its comment boxes. They change no behaviour, and without them a large graph comes back auto-laid-out. Keep them.

Leave the numbers alone

The 2.0 decompiler writes the shortest decimal that reads back as the same float, so 6.2831855 is the value the asset holds. "Restoring" 6.2831853 changes nothing; rounding to 6.28 changes the material.

A 1.x export, if the user insists on keeping it

The 1.x exporter (-Format Legacy) is a migration starting point, not a guarantee. What to know about its text:

  • Settings always starts with Domain, ShadingModel and BlendMode, whether or not they were set. Backend is never written, so the file rebuilds on the project default — add Backend = "Graph"; if the graph must stay a plain material.
  • ShadingModel = "Substrate" is forced when a Base.FrontMaterial was decompiled. Do not "correct" it.
  • Struct-, array-, map- and set-valued node properties are dropped silently. A MaterialFunctionCall with no function becomes 0.0, and a graph cycle a default literal — both with a warning.
  • Literals are rounded to six decimals (6.2831853 → 6.283185): restore recognisable constants.
  • DS_Shared_N names are DreamShader's own reroute nodes, carried over from a graph DreamShader built.
  • ParameterName="…" means the identifier had to differ from the parameter: renaming the identifier is safe, deleting ParameterName is not.
  • It rebuilds into a second asset under Decompiled/… until Shader(Name=…) is retargeted.

The full table of what each decompiler reproduces: Docs/tools/decompiler.md.

Gotchas

  • Re-running the decompiler overwrites the cleaned file. Move it out of Decompiled/ once you own it.
  • @sort is the material instance's parameter order. Reordering the uniform lines is free; changing a @sort value changes what an artist sees.
  • A material instance decompiles to a .dsi of overrides only — there is little to optimize, and its uniform names must match the parent's exactly.
  • dump-graph boots the editor too. Capture before, apply every pass, capture after — two runs, not one per pass.

See also

© TypeDreamMoon, MIT. 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 .skill/dream-shader-optimize of TypeDreamMoon/DreamShader.

Open the folder on GitHubat commit d20819f

Compare with similar skills

Dream Shader Optimize 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.

Dream Shader Optimize compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dream Shader Optimize this skillTypeDreamMoon/DreamShader106—~1.9kAutomated safety check: PassMIT
Unreal Material and VFX Workflowflopperam/unreal-engine-mcp1.1k—~927Automated safety check: PassNone
UMG Material MCPwinyunq/UnrealMotionGraphicsMCP210—~913Automated safety check: PassMIT
Game DeveloperJeffallan/claude-skills12k—~1.5kAutomated safety check: PassMIT
Scenario Unreal Materialsscenario-labs/skills931—~4.6kAutomated safety check: PassMIT
Gamedev Shadersericrisco/rsc-harness174—~3.6kAutomated safety check: PassMIT

Similar skills

  • 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
  • UMG Material MCP

    winyunq/UnrealMotionGraphicsMCP

    Creates, edits and compiles Unreal Engine 5.8 material assets as one HLSL Custom node through the UMG MCP bridge, instead of editing .uasset files directly.

    210 GitHub stars~913 tokensUpdated 2 mo ago
    Game DevelopmentAuto-check passed
  • Game Developer

    Jeffallan/claude-skills

    Covers game programming in Unity and Unreal Engine: ECS design, physics, multiplayer networking, shaders and profiling toward a 60 FPS target.

    12k GitHub stars~1.5k tokensUpdated 6 days ago
    Game DevelopmentAuto-check passed
  • Scenario Unreal Materials

    scenario-labs/skills

    A skill your agent uses when a UE5 task involves materials or textures: a master material and instances for a kit, Substrate or legacy, Blendable vs Adaptive GBuffer, glass, emissive screens…

    931 GitHub stars~4.6k tokensUpdated yesterday
    Game DevelopmentAuto-check passed
  • Gamedev Shaders

    ericrisco/rsc-harness

    A skill your agent uses when authoring or debugging a shader, material, VFX, or full-screen post-process in a game engine — Godot 4.x .gdshader, Unity 6 URP/HDRP, Unreal 5.x Materials, effect…

    174 GitHub stars~3.6k tokensUpdated 2 days ago
    Game DevelopmentAuto-check passed
  • UMG MCP Authoring

    winyunq/UnrealMotionGraphicsMCP

    Builds and edits Unreal Engine UMG interfaces through the Unreal Motion Graphics MCP, covering widget trees, HLSL materials, Sequencer animations and readback checks.

    210 GitHub stars~2.6k tokensUpdated 2 mo ago
    Game DevelopmentAuto-check passed

More from TypeDreamMoon/DreamShader

  • Dream Shader Create

    TypeDreamMoon/DreamShader

    Write a new DreamShader source from a plain-language description — a material, material function, layer, material instance or Custom Pass pipeline — then check and compile it headlessly to prove it…

    106 GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Dream Shader Decompile

    TypeDreamMoon/DreamShader

    Export an existing Unreal material, material function, layer, layer blend, material instance or Custom Pass pipeline back into DreamShaderLang source headlessly, so a hand-built material graph or…

    106 GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Dream Shader Diagnose

    TypeDreamMoon/DreamShader

    Resolve a DreamShader compile error or warning — look its DSH code up, explain the cause, and fix the source — or find out why a DreamShader material silently comes out wrong.

    106 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Dream Shader Migrate

    TypeDreamMoon/DreamShader

    Rewrite DreamShaderLang 1.x sources (.dsm / .dsf / .dsh) as 2.0 .dss with dsc migrate, which proves each rewrite builds the same graph before it writes anything.

    106 GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Dream Shader Verify

    TypeDreamMoon/DreamShader

    Check and compile DreamShader sources headlessly — one file or the whole DShader tree — without opening the Unreal editor, and read back every diagnostic with its file, line and code.

    106 GitHub stars~2.1k tokensUpdated today
    Auto-check passed

Works with

Questions about Dream Shader Optimize

What does Dream Shader Optimize do?

Clean up a machine-written DreamShader source — a decompiled or migrated .dss (or a 1.x .dsm / .dsf export) — into one a person would have written, without changing what it builds, and prove the…. Dream Shader Optimize is an agent skill from TypeDreamMoon/DreamShader.dsf export) — into one a person would have written, without changing what it builds, and prove the graph is unchanged.

When should I use Dream Shader Optimize?

Dream Shader Optimize fits situations like: asked to optimize; make readable a source produced by the DreamShader decompiler.

How do I install Dream Shader Optimize in Claude Code?

Run `npx skills add TypeDreamMoon/DreamShader --skill dream-shader-optimize -a claude-code`. Or copy the skill folder (.skill/dream-shader-optimize in TypeDreamMoon/DreamShader) into .claude/skills/dream-shader-optimize in your project. Claude Code loads it when a task matches its description.

How do I install Dream Shader Optimize in Codex?

Run `npx skills add TypeDreamMoon/DreamShader --skill dream-shader-optimize -a codex`. Or copy the skill folder (.skill/dream-shader-optimize in TypeDreamMoon/DreamShader) into .agents/skills/dream-shader-optimize in your project. Codex loads it when a task matches its description.

Can I use Dream Shader Optimize 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 TypeDreamMoon/DreamShader --skill dream-shader-optimize -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dream-shader-optimize, .gemini/skills/dream-shader-optimize, .github/skills/dream-shader-optimize and .opencode/skills/dream-shader-optimize in your project.

What does Dream Shader Optimize need to run?

Going by SKILL.md and its folder, Dream Shader Optimize needs the command-line tools its instructions call (pwsh and git).

Does Dream Shader Optimize access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Dream Shader Optimize 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 Dream Shader Optimize use?

Dream Shader Optimize is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dream Shader Optimize use?

About 1.9k tokens (SKILL.md is roughly 7.8k 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 Dream Shader Optimize?

Skills that share tags, products or a category with Dream Shader Optimize: Unreal Material and VFX Workflow (flopperam/unreal-engine-mcp, 1.1k stars), UMG Material MCP (winyunq/UnrealMotionGraphicsMCP, 210 stars), Game Developer (Jeffallan/claude-skills, 12k stars) and Scenario Unreal Materials (scenario-labs/skills, 931 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dream Shader Optimize?

TypeDreamMoon (a GitHub user) maintains it in TypeDreamMoon/DreamShader, which has 106 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 9, 2026.

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