Agent SkillsBesty0728/Unity-Skills › unity-shadergraph

unity-shadergraph

GitHub

用于Unity Shader Graph的创建、结构检查及节点受控编辑。支持半自动查询与全自动修改,需先获取结构信息再操作。严格限制反射调用版本,禁止直接删除操作,适用于着色器图资产管理工作流。

SkillsForUnity/unity-skills~/skills/shadergraph/SKILL.md Besty0728/Unity-Skills

Trigger Scenarios

创建Shader Graph 检查Shader Graph结构 编辑黑板或节点 用户提及shader graph或着色器图

Install

npx skills add Besty0728/Unity-Skills --skill unity-shadergraph -g -y
More Options

Non-standard path

npx skills add https://github.com/Besty0728/Unity-Skills/tree/main/SkillsForUnity/unity-skills~/skills/shadergraph -g -y

Use without installing

npx skills use Besty0728/Unity-Skills@unity-shadergraph

指定 Agent (Claude Code)

npx skills add Besty0728/Unity-Skills --skill unity-shadergraph -a claude-code -g -y

安装 repo 全部 skill

npx skills add Besty0728/Unity-Skills --all -g -y

预览 repo 内 skill

npx skills add Besty0728/Unity-Skills --list

SKILL.md

Frontmatter
{
    "name": "unity-shadergraph",
    "description": "Create and inspect Shader Graph assets — create graphs, inspect structure, and perform constrained blackboard and node editing. Use when creating a Shader Graph, inspecting its structure, or making controlled edits to its blackboard or nodes, even if the user just says \"shader graph\" or \"着色器图\". 创建与检查 Shader Graph 资产(创建图、检查结构、受约束的黑板与节点编辑);当用户要创建 Shader Graph、检查其结构、或对黑板\/节点做受控编辑时使用。"
}

ShaderGraph Skills

Shader Graph asset workflows for Unity 2022.3+ with source-backed template handling, MultiJson inspection, and constrained internal-editor reflection writes.

Operating Mode

  • Query skills (shadergraph_list_templates, shadergraph_list_assets, shadergraph_get_info, shadergraph_get_structure, shadergraph_list_supported_nodes, shadergraph_list_properties, shadergraph_list_keywords) are SkillMode.SemiAuto — they run in all three modes without grant.
  • All other mutators (create graph / subgraph, add/move/connect/disconnect node, set node defaults/settings, add/update property/keyword, reimport) are SkillMode.FullAuto — under Approval they need user grant (grant triggers one server-side execute returning the result); under Auto / Bypass they execute directly.
  • shadergraph_remove_node, shadergraph_remove_property, shadergraph_remove_keyword carry SkillOperation.Delete and are auto-forbidden in Approval / Auto modes (NeverInSemi). Only Bypass or the user-managed Allowlist can run them.

Reflection Fragility

This module reaches into UnityEditor.ShaderGraph and UnityEditor.ShaderGraph.Internal via reflection (see ShaderGraphReflectionHelper.cs and ShaderGraphNodeRegistry.cs). The supported node whitelist, slot layout, and settings keys are version-pinned to com.unity.shadergraph 14.0.x (Unity 2022.3) with limited Unity 6 coverage. Treat the following as a hard contract:

  • Never assume an internal type, field, or slot id exists from memory — always cross-check with shadergraph_list_supported_nodes and shadergraph_get_structure first.
  • If a Shader Graph package update changes internal types or MultiJson schema, mutators may fail or silently no-op until the registry is updated.
  • If a skill returns an error mentioning a reflection / type lookup failure, do not retry with different argument shapes — report the version mismatch and stop.

Guardrails

Routing:

  • HLSL text shaders: use shader_*
  • Shader Graph / Sub Graph assets: use this module
  • Source-anchored design guidance before proposing graph architecture: load shadergraph-design

Runtime-first rules:

  • Always call shadergraph_get_structure before any node-level edit; treat returned nodeId and slotId as the only valid identifiers
  • Never invent slot names, node ids, or template availability from memory
  • shadergraph_set_node_defaults only applies to unconnected input slots; if the slot is connected, disconnect first
  • shadergraph_set_node_settings only writes the whitelist exposed by shadergraph_list_supported_nodes
  • PropertyNode only binds existing blackboard properties; create the property first with shadergraph_add_property
  • SubGraph editing is limited to ordinary nodes; this module does not edit SubGraphOutputNode structure

Validated behavior:

  • Unity 2022.3 + com.unity.shadergraph@14.0.12 does not ship GraphTemplates/; shadergraph_create_graph falls back to blank graph creation
  • Unity 6 ShaderGraph packages may provide actual template directories; template listing and template-copy creation remain available there
  • The supported node subset is runtime-filtered. The shared overlap is 28 nodes in live validation, while AppendVectorNode is currently Unity 6 only

Skills

shadergraph_list_templates

List Shader Graph templates shipped by the installed package.

shadergraph_create_graph

Create a Shader Graph asset from a package template or blank fallback.

shadergraph_create_subgraph

Create a blank Shader Sub Graph asset with a configured output slot.

shadergraph_list_assets

List Shader Graph and Sub Graph assets in the project.

shadergraph_get_info

Get a high-level summary of a Shader Graph or Sub Graph asset.

shadergraph_get_structure

Inspect the live graph structure. Returns real nodeId, position, slots, edges, properties, and keywords.

shadergraph_list_supported_nodes

List the constrained node whitelist, supported versions, slots, and editable settings.

shadergraph_add_node

Add a supported node by nodeType with optional initial settings and position.

shadergraph_remove_node

Remove a node by serialized nodeId; related edges are removed together.

shadergraph_move_node

Move a node by serialized nodeId.

shadergraph_connect_nodes

Connect a specific output slot to a specific input slot using nodeId + slotId.

shadergraph_disconnect_nodes

Disconnect one exact edge using the same four-tuple.

shadergraph_set_node_defaults

Set the default value of an unconnected input slot.

shadergraph_set_node_settings

Write whitelisted node settings only.

shadergraph_list_properties

List graph blackboard properties.

shadergraph_add_property

Add a constrained blackboard property.

shadergraph_update_property

Update a constrained blackboard property.

shadergraph_remove_property

Remove a graph property.

shadergraph_list_keywords

List graph blackboard keywords.

shadergraph_add_keyword

Add a graph keyword.

shadergraph_update_keyword

Update a graph keyword.

shadergraph_remove_keyword

Remove a graph keyword.

shadergraph_reimport

Force reimport of a Shader Graph asset after external edits.

Workflow

  1. Create or locate the target graph.
  2. Read shadergraph_get_structure.
  3. If needed, create blackboard properties or keywords first.
  4. Call shadergraph_list_supported_nodes to confirm node type, settings whitelist, and slot layout.
  5. Add/move nodes, then connect/disconnect using the live nodeId/slotId values.
  6. Re-read shadergraph_get_structure after each significant edit if the next step depends on topology.

Exact Signatures

Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file.

Version History

  • ec9f870 Current 2026-07-05 14:41

Same Skill Collection

SkillsForUnity/unity-skills~/skills/adr/SKILL.md
SkillsForUnity/unity-skills~/skills/animator/SKILL.md
SkillsForUnity/unity-skills~/skills/architecture/SKILL.md
SkillsForUnity/unity-skills~/skills/asmdef/SKILL.md
SkillsForUnity/unity-skills~/skills/asset/SKILL.md
SkillsForUnity/unity-skills~/skills/async/SKILL.md
SkillsForUnity/unity-skills~/skills/batch/SKILL.md
SkillsForUnity/unity-skills~/skills/blueprints/SKILL.md
SkillsForUnity/unity-skills~/skills/bookmark/SKILL.md
SkillsForUnity/unity-skills~/skills/camera/SKILL.md
SkillsForUnity/unity-skills~/skills/cinemachine/SKILL.md
SkillsForUnity/unity-skills~/skills/cleaner/SKILL.md
SkillsForUnity/unity-skills~/skills/component/SKILL.md
SkillsForUnity/unity-skills~/skills/console/SKILL.md
SkillsForUnity/unity-skills~/skills/debug/SKILL.md
SkillsForUnity/unity-skills~/skills/decal/SKILL.md
SkillsForUnity/unity-skills~/skills/dotween/SKILL.md
SkillsForUnity/unity-skills~/skills/editor/SKILL.md
SkillsForUnity/unity-skills~/skills/event/SKILL.md
SkillsForUnity/unity-skills~/skills/gameobject/SKILL.md
SkillsForUnity/unity-skills~/skills/graphics/SKILL.md
SkillsForUnity/unity-skills~/skills/history/SKILL.md
SkillsForUnity/unity-skills~/skills/importer/SKILL.md
SkillsForUnity/unity-skills~/skills/inspector/SKILL.md
SkillsForUnity/unity-skills~/skills/light/SKILL.md
SkillsForUnity/unity-skills~/skills/material/SKILL.md
SkillsForUnity/unity-skills~/skills/navmesh/SKILL.md
SkillsForUnity/unity-skills~/skills/netcode-design/SKILL.md
SkillsForUnity/unity-skills~/skills/netcode/SKILL.md
SkillsForUnity/unity-skills~/skills/optimization/SKILL.md
SkillsForUnity/unity-skills~/skills/package/SKILL.md
SkillsForUnity/unity-skills~/skills/patterns/SKILL.md
SkillsForUnity/unity-skills~/skills/perception/SKILL.md
SkillsForUnity/unity-skills~/skills/performance/SKILL.md
SkillsForUnity/unity-skills~/skills/physics/SKILL.md
SkillsForUnity/unity-skills~/skills/postprocess/SKILL.md
SkillsForUnity/unity-skills~/skills/prefab/SKILL.md
SkillsForUnity/unity-skills~/skills/probuilder/SKILL.md
SkillsForUnity/unity-skills~/skills/profiler/SKILL.md
SkillsForUnity/unity-skills~/skills/project-scout/SKILL.md
SkillsForUnity/unity-skills~/skills/project/SKILL.md
SkillsForUnity/unity-skills~/skills/sample/SKILL.md
SkillsForUnity/unity-skills~/skills/scene-contracts/SKILL.md
SkillsForUnity/unity-skills~/skills/scene/SKILL.md
SkillsForUnity/unity-skills~/skills/script-roles/SKILL.md
SkillsForUnity/unity-skills~/skills/script/SKILL.md
SkillsForUnity/unity-skills~/skills/scriptableobject/SKILL.md
SkillsForUnity/unity-skills~/skills/scriptdesign/SKILL.md
SkillsForUnity/unity-skills~/skills/shader/SKILL.md
SkillsForUnity/unity-skills~/skills/SKILL.md
SkillsForUnity/unity-skills~/skills/smart/SKILL.md
SkillsForUnity/unity-skills~/skills/terrain/SKILL.md
SkillsForUnity/unity-skills~/skills/test/SKILL.md
SkillsForUnity/unity-skills~/skills/testability/SKILL.md
SkillsForUnity/unity-skills~/skills/timeline/SKILL.md
SkillsForUnity/unity-skills~/skills/ui/SKILL.md
SkillsForUnity/unity-skills~/skills/uitoolkit/SKILL.md
SkillsForUnity/unity-skills~/skills/urp/SKILL.md
SkillsForUnity/unity-skills~/skills/validation/SKILL.md
SkillsForUnity/unity-skills~/skills/volume/SKILL.md
SkillsForUnity/unity-skills~/skills/workflow/SKILL.md
SkillsForUnity/unity-skills~/skills/xr/SKILL.md
SkillsForUnity/unity-skills~/skills/yooasset-design/SKILL.md
SkillsForUnity/unity-skills~/skills/yooasset/SKILL.md
SkillsForUnity/unity-skills~/SKILL.md
SkillsForUnity/unity-skills~/skills/addressables-design/SKILL.md
SkillsForUnity/unity-skills~/skills/dotween-design/SKILL.md
SkillsForUnity/unity-skills~/skills/shadergraph-design/SKILL.md
SkillsForUnity/unity-skills~/skills/unitask-design/SKILL.md
SkillsForUnity/unity-skills~/skills/yaml-editing/SKILL.md

Metadata

Files
0
Version
ec9f870
Hash
cbea30e9
Indexed
2026-07-05 14:41

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-08 20:31
浙ICP备14020137号-1 $bản đồ khách truy cập$