unity-shader

Create, read, list, and inspect HLSL/ShaderLab .shader files in Unity projects.

2|Updated May 18, 2026
One-click install
npx skills add https://github.com/pcone-mm/NewFPG --skill unity-shader-pcone-mm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-shader
Source: https://github.com/pcone-mm/NewFPG/tree/main/.agents/skills/unity-skills/skills/shader
Command: npx skills add https://github.com/pcone-mm/NewFPG --skill unity-shader-pcone-mm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing handwritten Unity shaders involves repetitive file operations and error-prone manual inspection of properties, keywords, and compilation errors. This Skill provides direct programmatic control over .shader files so you can create, query, and validate shaders without leaving your workflow. ## Core Features & Use Cases - Shader Creation: Generate .shader files from raw ShaderLab/HLSL source or use built-in Unlit and URP (Unlit/Lit) templates. - Inspection & Querying: Read shader source, list or find shaders by name, and retrieve property definitions, keyword lists, and variant counts for performance analysis. - Error Checking & Cleanup: Check shaders for compilation errors, toggle global shader keywords, and delete shader files (delete is restricted to Bypass mode or an explicit allowlist). - Use Case: Ask the assistant to create a URP Lit shader at Assets/Shaders/MyLit.shader, then check it for compilation errors and inspect its variant count to assess build performance impact. ## Quick Start Create a URP Unlit shader named Custom/MyShader saved to Assets/Shaders/MyShader.shader and then check it for compilation errors.

Frequently Asked Questions about unity-shader

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a shader file in Unity programmatically?

Use shader_create with a shaderName, savePath, and a template parameter containing raw ShaderLab/HLSL source code. If you omit the template, a built-in Unlit template with _MainTex and _Color is used. For URP presets, use shader_create_urp with type Unlit or Lit.

How do I check a Unity shader for compilation errors?

Call shader_check_errors with a shader name or asset path such as "Custom/MyShader" or "Assets/Shaders/My.shader". It returns the shader name, a hasErrors flag, and the message count so you can verify the shader compiles.

What is the difference between shader properties and material properties in Unity?

shader_get_properties returns the property definitions declared in the shader (name, type, range), not current values. To read or change actual values on a material instance, use material_get_properties or material_set_float/material_set_color from the material module.

Can I change a material's shader or set shader properties directly?

No shader_set_property, shader_apply, or shader_assign operations exist. Use material_set_shader to assign a shader to a material, and material_set_keyword for per-material keywords. Only global keywords are controlled via shader_set_global_keyword.

Why can't I delete a shader file in Approval or Auto mode?

shader_delete carries a Delete operation flag and is auto-forbidden in Approval and Auto modes. It only runs in Bypass mode or when the operation is added to the user-managed allowlist, preventing accidental asset loss.

Does this work with Unity ShaderGraph files?

No, this module only handles handwritten HLSL/ShaderLab .shader files. For node-based ShaderGraph assets, use the separate shadergraph module instead.