Agent Skills › Besty0728/Unity-Skills

Besty0728/Unity-Skills

GitHub

辅助记录Unity架构决策(ADR),用于技术方案选型、优缺点权衡及固化决策理由。适用于用户询问选哪个方案、对比库或模式,或需记录设计决策背景时使用。

71 skills 1,370

Install All Skills

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

List skills in collection

npx skills add Besty0728/Unity-Skills --list

Skills in Collection (71)

辅助记录Unity架构决策(ADR),用于技术方案选型、优缺点权衡及固化决策理由。适用于用户询问选哪个方案、对比库或模式,或需记录设计决策背景时使用。
在多个技术方案间抉择 对比不同的库或设计模式 记录某个设计决策的来龙去脉 用户直接询问“选哪个”或“用哪个方案好”
SkillsForUnity/unity-skills~/skills/adr/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-adr -g -y
SKILL.md
Frontmatter
{
    "name": "unity-adr",
    "description": "Helps record Unity architecture decisions (ADR) — compare options, weigh tradeoffs, and lock in a chosen approach with rationale. Use when choosing between technical approaches, comparing libraries or patterns, or documenting why a design decision was made, even if the user just asks \"选哪个\" or \"用哪个方案好\". 帮助记录 Unity 架构决策(ADR:技术选型、方案对比、权衡优缺点、固化决策与理由);当用户要在多个技术方案间抉择、对比库或模式、或记录某个设计决策的来龙去脉时使用。"
}

Unity ADR

Use this when architecture choices may be revisited later or when multiple plausible options exist.

Output Format

  • Decision
  • Context
  • Options considered
  • Chosen option
  • Why this option won
  • Consequences
  • Revisit triggers

Example Use Cases

  • Coroutine vs UniTask
  • Direct reference vs event-driven communication
  • ScriptableObject config vs in-scene authoring
  • One assembly vs multiple asmdef
  • Runtime logic in MonoBehaviour vs pure C# service

Guardrails

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

  • Keep ADRs short.
  • Record only decisions that materially affect code generation or architecture direction.
用于编辑Unity Animator控制器及控制运行时参数。支持创建控制器、管理状态与过渡、设置各类参数,并在运行时驱动动画或分配控制器到游戏对象。
搭建或连接Animator 调整动画状态机 在运行时驱动动画参数 用户提到'动画'或'状态机'
SkillsForUnity/unity-skills~/skills/animator/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-animator -g -y
SKILL.md
Frontmatter
{
    "name": "unity-animator",
    "description": "Edit Unity Animator Controllers and control runtime parameters — manage states, transitions, layers, and parameters (float\/int\/bool\/trigger). Use when setting up or wiring an Animator, adjusting animation state machines, or driving animation parameters at runtime, even if the user just mentions \"动画\" or \"状态机\". 编辑 Unity Animator Controller 并控制运行时参数(状态、过渡、层、参数 float\/int\/bool\/trigger);当用户要搭建或连接 Animator、调整动画状态机、或在运行时驱动动画参数时使用。"
}

Unity Animator Skills

Control Unity's Mecanim system — create Animator Controllers, add layers' states / transitions / parameters, assign controllers to GameObjects, set parameters at runtime, and play states.

Operating Mode

  • Approval:查询类 skill(animator_get_parameters / animator_get_info / animator_list_states,源码标 SkillMode.SemiAuto)直接执行;其余变更类(create_controller / add_parameter / set_parameter / play / assign_controller / add_state / add_transition,标 SkillMode.FullAuto)需用户 grant,grant 后服务端一步执行返结果。
  • Auto / Bypass:所有 skill 直接执行;Auto 走 AI 自我评估,Bypass 全放行。
  • 本模块不含 Delete / PlayMode / Reload / 高危 skill,无 Bypass-only 拦截项。
  • animator_set_parameter / animator_play 作用于场景中已挂 Animator 的 GameObject;如果当前不在 Play mode,状态机只在 Editor 预览模式推进,效果与 runtime 不完全等价。

DO NOT (common hallucinations):

  • animator_create_clip / animator_add_clip do not exist → AnimationClips are created via Unity Editor or asset import
  • animator_set_speed does not exist → use component_set_property on Animator component with propertyName="speed"

Routing:

  • For Timeline animation → use timeline module
  • For component properties on Animator → use component module
  • For animation import settings → use importer module

Skills Overview

Skill Description
animator_create_controller Create new Animator Controller
animator_add_parameter Add parameter to controller
animator_get_parameters List all parameters
animator_set_parameter Set parameter value at runtime
animator_play Play animation state
animator_get_info Get Animator component info
animator_assign_controller Assign controller to GameObject
animator_list_states List states in controller
animator_add_state Add a state to a controller layer
animator_add_transition Add a transition between two states

Parameter Types

Type Description Example Use
float Decimal value Speed, blend weights
int Integer value State index
bool True/false IsGrounded, IsRunning
trigger One-shot signal Jump, Attack

Skills

animator_create_controller

Create a new Animator Controller.

Parameter Type Required Default Description
name string Yes - Controller name
folder string No "Assets/Animations" Save folder

Returns: {success, name, path}

animator_add_parameter

Add a parameter to a controller.

Parameter Type Required Default Description
controllerPath string Yes - Controller asset path
paramName string Yes - Parameter name
paramType string Yes - float/int/bool/trigger
defaultFloat float No 0 Initial float value
defaultInt int No 0 Initial int value
defaultBool bool No false Initial bool value

animator_get_parameters

Get all parameters from a controller.

Parameter Type Required Description
controllerPath string Yes Controller asset path

Returns: {controller, parameters: [{name, type, defaultFloat, defaultInt, defaultBool}]}

animator_set_parameter

Set a parameter value at runtime (supports name/instanceId/path).

Parameter Type Required Description
name string No* GameObject name
instanceId int No* GameObject instance ID
path string No* GameObject hierarchy path
paramName string Yes Parameter name
paramType string Yes float/int/bool/trigger
floatValue float No* Float value
intValue int No* Integer value
boolValue bool No* Boolean value

*At least one identifier required. Use the appropriate value for paramType (trigger doesn't need a value).

animator_play

Play a specific animation state (supports name/instanceId/path).

Parameter Type Required Default Description
name string No* - GameObject name
instanceId int No* 0 GameObject instance ID
path string No* null GameObject hierarchy path
stateName string Yes - Animation state name
layer int No 0 Animator layer
normalizedTime float No 0 Start time (0-1)

*At least one identifier required.

animator_get_info

Get Animator component information (supports name/instanceId/path).

Parameter Type Required Default Description
name string No null GameObject name
instanceId int No 0 GameObject instance ID
path string No null GameObject hierarchy path

Returns: {gameObject, instanceId, hasController, controllerPath, speed, applyRootMotion, updateMode, cullingMode, layerCount, parameterCount}

animator_assign_controller

Assign a controller to a GameObject (supports name/instanceId/path).

Parameter Type Required Description
name string No* GameObject name
instanceId int No* GameObject instance ID
path string No* GameObject hierarchy path
controllerPath string Yes Controller asset path

*At least one identifier required.

animator_list_states

List all states in a controller layer.

Parameter Type Required Default Description
controllerPath string Yes - Controller asset path
layer int No 0 Layer index

Returns: {controller, layer, layerName, stateCount, states: [{name, tag, speed, hasMotion}]}

animator_add_state

Add a state to an Animator Controller layer.

Parameter Type Required Default Description
controllerPath string Yes - Controller asset path
stateName string Yes - Name for the new state
clipPath string No null Animation clip asset path to assign
layer int No 0 Layer index

Returns: {success, controller, stateName, layer}

animator_add_transition

Add a transition between two states in an Animator Controller.

Parameter Type Required Default Description
controllerPath string Yes - Controller asset path
fromState string Yes - Source state name
toState string Yes - Destination state name
layer int No 0 Layer index
hasExitTime bool No true Whether transition waits for exit time
duration float No 0.25 Transition duration in seconds

Returns: {success, from, to, layer, hasExitTime, duration}


Example: Complete Animation Setup

import unity_skills

# 1. Create controller
unity_skills.call_skill("animator_create_controller",
    name="PlayerController",
    folder="Assets/Animations"
)

# 2. Add parameters
unity_skills.call_skill("animator_add_parameter",
    controllerPath="Assets/Animations/PlayerController.controller",
    paramName="Speed", paramType="float", defaultFloat=0
)
unity_skills.call_skill("animator_add_parameter",
    controllerPath="Assets/Animations/PlayerController.controller",
    paramName="IsGrounded", paramType="bool", defaultBool=True
)
unity_skills.call_skill("animator_add_parameter",
    controllerPath="Assets/Animations/PlayerController.controller",
    paramName="Jump", paramType="trigger"
)

# 3. Assign to character
unity_skills.call_skill("animator_assign_controller",
    name="Player",
    controllerPath="Assets/Animations/PlayerController.controller"
)

# 4. Control at runtime
unity_skills.call_skill("animator_set_parameter",
    name="Player", paramName="Speed", paramType="float", floatValue=5.0
)

# Trigger jump
unity_skills.call_skill("animator_set_parameter",
    name="Player", paramName="Jump", paramType="trigger"
)

# Play specific state
unity_skills.call_skill("animator_play", name="Player", stateName="Idle")

Best Practices

  1. Create controller before adding parameters
  2. Use meaningful parameter names
  3. Triggers reset automatically after firing
  4. Set parameters before playing states
  5. Use layers for independent animations (body + face)
  6. States must exist in controller before playing

Exact Signatures

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

为Unity游戏架构提供建议,涵盖模块划分、解耦、SOLID原则及重构方向。适用于规划代码结构、降低耦合或决定重构策略的场景,强调最小化架构与显式依赖管理。
规划代码结构 划分职责边界 降低模块耦合度 决定重构方向
SkillsForUnity/unity-skills~/skills/architecture/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-architecture -g -y
SKILL.md
Frontmatter
{
    "name": "unity-architecture",
    "description": "Advises on Unity gameplay and system architecture — module boundaries, decoupling, scene composition, SOLID structure, refactor direction. Use when planning how to organize code, splitting responsibilities, reducing coupling, or choosing a refactor direction, before writing structural code. 为 Unity 游戏与系统架构提供建议(模块边界、解耦、场景组织、SOLID、重构方向);当用户要规划代码结构、划分职责、降低耦合或决定重构方向时使用。"
}

Unity Architecture Advisor

Use this before generating lots of gameplay scripts or when the user asks for a cleaner architecture.

Workflow

  1. Identify scope: prototype, small game, or long-lived project.
  2. Define the core loop and the minimum runtime systems needed.
  3. Recommend the smallest architecture that fits the scope.
  4. Separate:
    • scene/bootstrap layer
    • gameplay/domain logic
    • data/config assets
    • view/presentation layer
  5. Call out what should stay simple now vs what is worth abstracting.

Output Format

When using this skill, structure the advice as:

  • Project tier: prototype / small-game / long-lived
  • Recommended modules: 3-7 modules with one-line responsibilities
  • Scene/bootstrap plan: where composition and initialization happen
  • Data ownership: what belongs in scene objects, ScriptableObjects, or pure C# classes
  • Communication rules: direct refs, interfaces, events, or commands
  • Performance risks: only the hot paths that matter
  • Do now / skip now: avoid over-engineering

Default Guidance

  • Prefer thin MonoBehaviour scripts as composition bridges.
  • Put reusable gameplay rules in plain C# classes when possible.
  • Use ScriptableObject for authored config and shared static data, not as a default dump for runtime state.
  • Keep dependencies explicit. Avoid hidden global state unless the project size clearly justifies a small service layer.
  • Favor simple module boundaries over framework-heavy architecture.

Explicit Execution Order and Entry Guards

Most "random" gameplay bugs trace back to two silent assumptions: that scripts run in a predictable order, and that Update runs only when its data is ready. Neither is true unless you make them so.

Make startup order explicit

Do not rely on Script Execution Order panels or accidental Awake ordering. Prefer these patterns in order of preference:

  • One Bootstrap script as the single entry point. It owns the initialization sequence and calls sub.Init() on the managers it creates. Only this one script has [DefaultExecutionOrder(-10000)].
  • Pull, don't push: a subscriber that needs data calls source.GetValue() on demand or subscribes to an event. A publisher that pushes into others during its own Awake creates hidden order dependencies.
  • Reserve [DefaultExecutionOrder(n)] for load-bearing singletons only (Bootstrap, InputRouter, SceneController). If more than 3-4 scripts need it, the architecture is wrong, not the ordering.

The analogous ECS pattern — [UpdateBefore(typeof(BarSystem))] / [UpdateAfter] — works because the framework validates contradictions at sort time. In MonoBehaviour code the compiler won't catch them; be conservative. Source: EntitiesSamples/Docs/systems.md:32 — "if the ordering attributes of a group's children create a contradiction, an exception is thrown".

Make update preconditions explicit

Every Update / LateUpdate / FixedUpdate should open with guard clauses that early-return when the system is not ready. Prefer the cheapest check first:

void Update() {
    if (!_isInitialized) return;       // construction-time
    if (_dataSource == null) return;   // dependency-level
    if (_paused) return;               // gameplay-state
    // real work here
}

A missing guard is the difference between "doesn't run yet" (safe) and "runs with stale/null data and silently corrupts state" (debug nightmare). The ECS equivalent is state.RequireForUpdate<Config>() in OnCreate, which turns the precondition into a system-level invariant. Source: Dots101/Entities101/Assets/HelloCube/3. Prefabs/SpawnSystem.cs:17-19 — the system does not update unless a Spawner entity exists.

Guardrails

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

  • Do not start from a giant reusable framework unless the project truly needs it.
  • Do not add layers just to satisfy textbook SOLID wording.
  • Prefer a small architecture that can grow, not an impressive one that slows iteration.

Load Related Advisory Modules When Needed

为Unity项目提供程序集定义(asmdef)规划建议,包括模块边界划分、依赖关系梳理、编辑器与运行时代码拆分及编译优化。适用于解决编译缓慢或程序集结构混乱问题。
编译太慢 程序集怎么分 规划 asmdef 结构 理顺程序集依赖 加速编译 拆分编辑器与运行时代码
SkillsForUnity/unity-skills~/skills/asmdef/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-asmdef -g -y
SKILL.md
Frontmatter
{
    "name": "unity-asmdef",
    "description": "Advises on Unity assembly definitions (asmdef) — module boundaries, dependency graphs, editor\/runtime\/test splits, and faster compile times. Use when planning asmdef layout, untangling assembly dependencies, speeding up compilation, or splitting editor and runtime code, even if the user just says \"编译太慢\" or \"程序集怎么分\". 为 Unity 程序集定义(asmdef)提供建议(模块边界、依赖关系、editor\/runtime\/test 拆分、加快编译);当用户要规划 asmdef 结构、理顺程序集依赖、加速编译或拆分编辑器与运行时代码时使用。"
}

Unity asmdef Advisor

Use this skill when the project is large enough that compile boundaries and dependency direction matter.

Recommend Only When Worth It

asmdef is usually worth discussing when:

  • the project has multiple domains/systems
  • editor code and runtime code are mixed
  • compile times are becoming noticeable
  • tests should be isolated cleanly

Output Format

  • Whether asmdef is justified now
  • Proposed assemblies
  • Allowed dependency direction
  • Editor/runtime/test split
  • Migration steps
  • Risks or churn to avoid

Default Guidance

  • Prefer a few meaningful assemblies over many tiny ones.
  • Split editor code from runtime first.
  • Keep the dependency graph directional and shallow.

Guardrails

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

  • Do not introduce asmdef fragmentation for a tiny prototype.
  • Do not create circular dependencies or force everything through a shared dumping-ground assembly.
管理Unity AssetDatabase,支持资源的导入、删除、移动、复制、查找及元数据查询。适用于工程资源整理与文件操作,区分半自动与全自动模式,并明确高危操作的权限限制。
整理工程资源 导入或移动文件 查询资源元数据 用户提及'资源'或'资产'
SkillsForUnity/unity-skills~/skills/asset/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-asset -g -y
SKILL.md
Frontmatter
{
    "name": "unity-asset",
    "description": "Manage the Unity AssetDatabase — import, delete, move\/rename, duplicate, find, get info, and create assets. Use when organizing project assets, importing or relocating files, querying asset metadata, or scripting AssetDatabase operations, even if the user just says \"资源\" or \"资产\". 管理 Unity AssetDatabase(导入、删除、移动\/重命名、复制、查找、获取信息、创建资源);当用户要整理工程资源、导入或移动文件、查询资源元数据时使用。"
}

Unity Asset Skills

BATCH-FIRST: Use *_batch skills when operating on 2+ assets.

Operating Mode

  • Approval:本模块 Mixed —— asset_find / asset_get_info / asset_get_labelsSkillMode.SemiAuto,可直接执行;写类 skill (asset_move / asset_move_batch / asset_duplicate / asset_create_folder / asset_refresh / asset_reimport* / asset_set_labels) 走默认 SkillMode.FullAuto,需 grant。
  • Auto / Bypass:FullAuto 直接执行。
  • 含 NeverInSemi 高危 skillasset_import (标 RiskLevel = "high" —— 写入项目);asset_delete / asset_delete_batch (Operation.Delete)。这些在 Approval/Auto 下返 MODE_FORBIDDEN,仅 Bypass 或 Allowlist 命中可调。

DO NOT (common hallucinations):

  • asset_create does not exist → use asset_create_folder (folders), material_create (materials), script_create (scripts)
  • asset_rename does not exist → use asset_move with new path
  • asset_search does not exist → use asset_find with searchFilter syntax (e.g. t:Texture2D player)
  • asset_copy does not exist → use asset_duplicate

Routing:

  • For texture/model/audio import settings → use importer module (SkillMode.FullAuto)
  • For material creation → use material module (SkillMode.FullAuto)
  • For script creation → use script module

Skills Overview

Single Object Batch Version Use Batch When
asset_import asset_import_batch Importing 2+ files
asset_delete asset_delete_batch Deleting 2+ assets
asset_move asset_move_batch Moving 2+ assets

No batch needed:

  • asset_duplicate - Duplicate single asset
  • asset_find - Search assets (returns list)
  • asset_create_folder - Create folder
  • asset_refresh - Refresh AssetDatabase
  • asset_get_info - Get asset information
  • asset_reimport - Force reimport asset
  • asset_reimport_batch - Reimport multiple assets

Skills

asset_import

Import an external file into the project.

Parameter Type Required Description
sourcePath string Yes External file path
destinationPath string Yes Project destination

asset_import_batch

Import multiple external files.

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

items currently expects a JSON string, not a native array.

Returns: {success, totalItems, successCount, failCount, results: [{success, sourcePath, destinationPath}]}

import json

unity_skills.call_skill("asset_import_batch", items=json.dumps([
    {"sourcePath": "C:/Downloads/tex1.png", "destinationPath": "Assets/Textures/tex1.png"},
    {"sourcePath": "C:/Downloads/tex2.png", "destinationPath": "Assets/Textures/tex2.png"}
]))

asset_delete

Delete an asset from the project.

Parameter Type Required Description
assetPath string Yes Asset path to delete

asset_delete_batch

Delete multiple assets.

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

items currently expects a JSON string, not a native array.

Returns: {success, totalItems, successCount, failCount, results: [{success, path}]}

import json

unity_skills.call_skill("asset_delete_batch", items=json.dumps([
    {"path": "Assets/Textures/old1.png"},
    {"path": "Assets/Textures/old2.png"}
]))

asset_move

Move or rename an asset.

Parameter Type Required Description
sourcePath string Yes Current asset path
destinationPath string Yes New path/name

asset_move_batch

Move multiple assets.

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

items currently expects a JSON string, not a native array.

Returns: {success, totalItems, successCount, failCount, results: [{success, sourcePath, destinationPath}]}

import json

unity_skills.call_skill("asset_move_batch", items=json.dumps([
    {"sourcePath": "Assets/Old/mat1.mat", "destinationPath": "Assets/New/mat1.mat"},
    {"sourcePath": "Assets/Old/mat2.mat", "destinationPath": "Assets/New/mat2.mat"}
]))

asset_duplicate

Duplicate an asset.

Parameter Type Required Description
assetPath string Yes Asset to duplicate

asset_find

Find assets by search filter.

Parameter Type Required Default Description
searchFilter string Yes - Search query
limit int No 50 Max results to return

Search Filter Syntax:

Filter Example Description
t:Type t:Texture2D By type
l:Label l:Architecture By label
name player By name
Combined t:Material player Multiple filters

Returns: {count, totalFound, assets: [{path, name, type}]}

asset_create_folder

Create a folder in the project.

Parameter Type Required Description
folderPath string Yes Full folder path

asset_refresh

Refresh the AssetDatabase after external changes.

No parameters.

asset_get_info

Get information about an asset.

Parameter Type Required Description
assetPath string Yes Asset path

asset_reimport

Force reimport of an asset.

Parameter Type Required Description
assetPath string Yes Asset path to reimport

asset_reimport_batch

Reimport multiple assets matching a pattern.

Parameter Type Required Description
searchFilter string No AssetDatabase search filter (default *)
folder string No Folder root to search (default Assets)
limit int No Max assets to reimport (default 100)

asset_set_labels

Set labels on an asset (overwrites existing labels).

Parameter Type Required Description
assetPath string Yes Asset path
labels string Yes Comma-separated labels (e.g. "ui,icon,hud"). Empty entries are dropped

Returns: {success, assetPath, labels: [...]}

asset_get_labels

Get the labels currently attached to an asset.

Parameter Type Required Description
assetPath string Yes Asset path

Returns: {success, assetPath, labels: [...]}


Minimal Example

import unity_skills

# GOOD: 1 API call instead of 4
unity_skills.call_skill("asset_move_batch", items=[
    {"sourcePath": "Assets/tex1.png", "destinationPath": "Assets/Textures/tex1.png"},
    {"sourcePath": "Assets/tex2.png", "destinationPath": "Assets/Textures/tex2.png"},
    {"sourcePath": "Assets/tex3.png", "destinationPath": "Assets/Textures/tex3.png"},
    {"sourcePath": "Assets/tex4.png", "destinationPath": "Assets/Textures/tex4.png"}
])

Best Practices

  1. Organize assets in logical folders
  2. Use consistent naming conventions
  3. Refresh after external file changes
  4. Use search filters for efficiency
  5. Backup before bulk delete operations

Exact Signatures

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

为Unity异步与生命周期策略提供建议,指导在Update、协程、UniTask和定时器间选择。涵盖代码调度、清理、取消及所有权管理,强调事件驱动与简单性,避免过度依赖重型方案。
决定如何编写异步代码 在协程与UniTask之间进行选择 需要调度定时器 处理任务取消与资源清理 询问'异步怎么写'或'用协程还是UniTask'
SkillsForUnity/unity-skills~/skills/async/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-async -g -y
SKILL.md
Frontmatter
{
    "name": "unity-async",
    "description": "Advises on Unity async and lifecycle strategy — choosing among Update, coroutines, UniTask, and timers, plus cleanup and cancellation. Use when deciding how to write async code, choosing between coroutine and UniTask, scheduling timers, or handling cancellation and cleanup, even if the user just asks \"异步怎么写\" or \"用协程还是UniTask\". 为 Unity 异步与生命周期策略提供建议(在 Update、协程、UniTask、定时器间取舍,以及清理与取消);当用户要决定异步代码怎么写、在协程与 UniTask 间选择、调度定时器或处理取消与清理时使用。"
}

Unity Async Strategy

Use this skill when the user is deciding how runtime work should be scheduled or cleaned up.

Guardrails

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

  • Do not recommend UniTask just because it looks more advanced than coroutine.
  • Prefer the simplest scheduling model that fits the use case.

Decision Ladder

  1. First ask whether the task needs per-frame work at all.
  2. If not, prefer events, callbacks, or explicit method calls.
  3. If a short Unity-bound sequence is needed, prefer coroutine.
  4. Recommend UniTask only when:
    • the project already uses it, or
    • the user explicitly wants it and accepts the dependency.
  5. Use Update only for true continuous simulation, polling, or input loops that cannot be event-driven.

Specific Guidance

  • Avoid many unrelated Update methods if a more event-driven flow works.
  • Cache references used in hot paths.
  • Always define lifecycle ownership:
    • who starts the work
    • who cancels or stops it
    • when it is cleaned up
  • In MonoBehaviour, prefer OnEnable / OnDisable / OnDestroy for subscribe-unsubscribe symmetry.
  • Use IDisposable mainly for pure C# lifetimes, temporary subscriptions, or scope-based cleanup helpers, not as a cargo-cult replacement for Unity lifecycle methods.

Output Format

  • Recommended scheduling model
  • Why it fits
  • Lifecycle / cancellation owner
  • Hot-path risks
  • Why the heavier alternative is unnecessary, if applicable
提供Unity批量操作与异步任务编排能力,涵盖批量查询、预览确认执行、后台任务调度轮询及场景清理。适用于一次性处理大量对象或长时任务,支持半自动与全自动模式,确保批量编辑安全可控。
用户要求批量修改场景对象属性或名称 需要查询或筛选大量游戏对象、组件或资产 执行先预览后提交的批量变更操作 运行、监控或取消后台异步作业
SkillsForUnity/unity-skills~/skills/batch/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-batch -g -y
SKILL.md
Frontmatter
{
    "name": "unity-batch",
    "description": "Unified batch and async-job orchestration — batch queries, preview-confirm-execute mutations, background job scheduling and polling, and bulk scene operations. Use when an operation touches many objects at once, running or polling long async jobs, or applying preview-then-commit bulk edits, even if the user just says \"批量\" or \"一次性改很多\". 统一的批量与异步任务编排(批量查询、预览-确认-执行变更、后台任务调度与轮询、批量场景操作);当用户要一次性操作大量对象、运行或轮询长时异步任务、或执行先预览后提交的批量编辑时使用。"
}

Unity Batch Skills

Batch workflow orchestration for query, preview, execution, reports, and async jobs.

Operating Mode

本模块共 22 个 skill,按 Operation 区分为两类:

  • 18 个 SemiAuto(query / preview / report / job 查询类):batch_query_gameobjects / batch_query_components / batch_query_assets / batch_preview_rename / batch_preview_set_property / batch_preview_replace_material / batch_report_get / batch_report_list / job_status / job_progress / job_logs / job_list / batch_fix_missing_scripts / batch_standardize_naming / batch_set_render_layer / batch_replace_material / batch_validate_scene_objects / batch_cleanup_temp_objects。Approval 模式下可直接执行。
  • 4 个 FullAuto(Execute 类,C# 未标 Mode 走默认 SkillMode.FullAuto):batch_execute / job_wait / job_cancel / batch_retry_failed。Approval 模式下首次调用返 MODE_RESTRICTED,走 grant 协议。
  • Auto / Bypass:两类都直接执行。不含 NeverInSemi 高危 skill(无 Delete/MayEnterPlayMode/MayTriggerReload 标记)。

注意:batch_execute(confirmToken) 本身放行,但它执行的 preview 内容可能包括对场景对象的删除/改属性等高影响动作 —— 请确保 batch_preview_* 返回的 sample/risk 字段已审阅。confirmToken 一次性消费、过期需重新 preview。

DO NOT (common hallucinations):

  • Always call a batch_preview_* skill first — batch_execute requires a confirmToken from a preview, it cannot be called directly
  • batch_run does not exist → use batch_execute(confirmToken)
  • job_poll / job_result do not exist → use job_status to check and retrieve async job results
  • batch_delete / batch_move do not exist → use asset module for asset-level operations

Routing:

  • For asset-level bulk operations (move, copy, delete) → asset module
  • For workflow session/task undo tracking → workflow module
  • For scene object validation → batch_validate_scene_objects (this module)
  • For async job polling → job_status / job_wait (this module)

Skills

batch_query_gameobjects

Query GameObjects with unified batch filters. queryJson supports name/path/instanceId/tag/layer/active/componentType/sceneName/parentPath/prefabSource/includeInactive/limit.

Parameter Type Required Default Description
queryJson string No null JSON query filter envelope
sampleLimit int No 20 Max sample objects returned

batch_query_components

Query components with unified batch filters. Optional componentType narrows the result.

Parameter Type Required Default Description
queryJson string No null JSON query filter envelope
componentType string No null Optional component type constraint
sampleLimit int No 20 Max sample objects returned

batch_query_assets

Query project assets by type, path pattern, and labels. Read-only.

Parameter Type Required Default Description
searchFilter string No null Raw Unity AssetDatabase filter string
folder string No "Assets" Search root folder
typeFilter string No null Asset type (prefix t: optional, e.g. Texture2D)
namePattern string No null Case-insensitive regex for filename
labelFilter string No null Asset label (prefix l: optional)
maxResults int No 200 Max results returned

batch_preview_rename

Preview batch renaming. mode supports prefix / suffix / replace / regex_replace.

Parameter Type Required Default Description
queryJson string No null JSON query filter envelope
mode string No "prefix" Rename mode
prefix string No null Prefix to add
suffix string No null Suffix to add
search string No null Plain text search term
replacement string No null Plain text replacement
regexPattern string No null Regex search pattern
regexReplacement string No null Regex replacement text
sampleLimit int No DefaultSampleLimit Max preview items

batch_preview_set_property

Preview setting a component property or field across queried targets.

Parameter Type Required Default Description
queryJson string No null JSON query filter envelope
componentType string No null Target component type
propertyName string No null Property or field name
value string No null Literal value
referencePath string No null Scene reference path
referenceName string No null Scene reference object name
assetPath string No null Asset reference path
sampleLimit int No DefaultSampleLimit Max preview items

batch_preview_replace_material

Preview replacing Renderer materials across queried targets.

Parameter Type Required Default Description
queryJson string No null JSON query filter envelope
materialPath string No null Replacement material asset path
sampleLimit int No DefaultSampleLimit Max preview items

batch_execute

Execute a previously previewed batch operation by confirmToken. Large operations return a jobId.

Parameter Type Required Default Description
confirmToken string Yes - Preview confirmation token
runAsync bool No true Run as async job
chunkSize int No 100 Batch execution chunk size
progressGranularity int No 10 Emit a progressEvent every N items processed

batch_report_get

Get a batch execution report by reportId.

Parameter Type Required Default Description
reportId string Yes - Batch report identifier

batch_report_list

List recent batch reports.

Parameter Type Required Default Description
limit int No 20 Max reports returned

job_status

Get status for an asynchronous UnitySkills job.

Parameter Type Required Default Description
jobId string Yes - Job identifier

job_progress

Get fine-grained progress events for a job via incremental polling. Use offset to fetch only new events since the last call (pass previous totalCount as next offset).

Note: Also exposed as HTTP GET /jobs/{id}/progress and Python client.get_job_progress(job_id, offset) — all three paths share the same response shape.

Parameter Type Required Default Description
jobId string Yes - Job identifier
offset int No 0 Skip first N events (use previous totalCount for incremental polling)

Response fields: jobId, status, totalCount, offset, events[] (timestamp ms, progress, stage, description), terminal.

job_logs

Get structured logs for a UnitySkills job.

Parameter Type Required Default Description
jobId string Yes - Job identifier
limit int No 100 Max log entries returned

job_list

List recent UnitySkills jobs.

Parameter Type Required Default Description
limit int No 20 Max jobs returned

job_wait

Wait for a UnitySkills job to finish or until timeoutMs elapses.

Parameter Type Required Default Description
jobId string Yes - Job identifier
timeoutMs int No 10000 Wait timeout in milliseconds

job_cancel

Cancel a UnitySkills job if the job supports cancellation.

Parameter Type Required Default Description
jobId string Yes - Job identifier

batch_fix_missing_scripts

Preview batch removal of missing scripts. Execute with batch_execute(confirmToken).

Parameter Type Required Default Description
queryJson string No null JSON query filter envelope
sampleLimit int No DefaultSampleLimit Max preview items

batch_standardize_naming

Preview standardizing names by trimming whitespace and normalizing separators. Execute with batch_execute(confirmToken).

Parameter Type Required Default Description
queryJson string No null JSON query filter envelope
separator string No "_" Replacement separator
sampleLimit int No DefaultSampleLimit Max preview items

batch_set_render_layer

Preview setting GameObject layers in batch. Execute with batch_execute(confirmToken).

Parameter Type Required Default Description
queryJson string No null JSON query filter envelope
layer string No null Target layer name
recursive bool No false Apply recursively to children
sampleLimit int No DefaultSampleLimit Max preview items

batch_replace_material

Preview replacing materials in batch. Execute with batch_execute(confirmToken).

Parameter Type Required Default Description
queryJson string No null JSON query filter envelope
materialPath string No null Replacement material asset path
sampleLimit int No DefaultSampleLimit Max preview items

batch_validate_scene_objects

Analyze scene objects for missing scripts, missing references, duplicate names, and empty objects.

Parameter Type Required Default Description
issueLimit int No 100 Max issues returned

batch_cleanup_temp_objects

Preview deleting temporary helper objects by common temp-name patterns. Execute with batch_execute(confirmToken).

Parameter Type Required Default Description
queryJson string No null JSON query filter envelope
patternsCsv string No null Comma-separated temp-name patterns
sampleLimit int No DefaultSampleLimit Max preview items

batch_retry_failed

Re-run only the failed items from a previous batch execution report. Returns a new jobId and originalReportId.

Parameter Type Required Default Description
reportId string Yes Prior batch report ID to resume from
runAsync bool No true Whether to run asynchronously (returns jobId)
chunkSize int No 100 Chunk size per retry batch

Exact Signatures

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

为Unity小游戏提供轻量级起步架构蓝图,涵盖平台、射击、跑酷等七种类型。适用于从零开始搭建核心结构或询问特定玩法组织方式时,输出最小可行方案,避免过度设计。
用户要求从零开始制作小游戏 询问特定游戏类型(如平台跳跃、塔防)的核心结构搭建方法 需要小游戏初始架构建议
SkillsForUnity/unity-skills~/skills/blueprints/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-blueprints -g -y
SKILL.md
Frontmatter
{
    "name": "unity-blueprints",
    "description": "Advises on starter architecture blueprints for small games — platformer, shooter, runner, puzzle, tower-defense, clicker, card. Use when starting a small game from scratch, scaffolding a genre's core structure, or asking how to organize a specific game type, even if the user just says \"做个平台跳跃\" or \"塔防怎么搭\". 为小游戏提供起步架构蓝图(平台跳跃、射击、跑酷、解谜、塔防、点击、卡牌);当用户要从零开始做小游戏、搭建某类型的核心结构、或询问特定玩法怎么组织时使用。"
}

Unity Gameplay Blueprints

Use this skill when starting a new mini-game or vertical slice and a lightweight architecture skeleton is more useful than raw code volume.

Supported Blueprint Styles

  • 2D platformer
  • top-down shooter
  • endless runner
  • puzzle / interaction game
  • tower defense
  • clicker / incremental
  • card / turn-based prototype

Output Format

  • Core loop
  • Recommended scenes
  • Recommended modules
  • Initial script list
  • Data/config assets
  • UI responsibilities
  • What to deliberately keep simple

Guardrails

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

  • Provide the smallest viable blueprint, not a giant reusable framework.
  • Prefer a short script inventory over “future-proof” template sprawl.
管理Unity场景视图书签,支持保存当前相机视角与选中对象、快速跳转至已存位置、列出或删除书签。适用于标记视角、收藏机位或在已存场景位置间切换导航。
用户要求保存或恢复场景视角 用户希望收藏某个特定机位 用户需要在已保存的场景位置之间进行导航 用户提及“标记视角”或“存个机位”
SkillsForUnity/unity-skills~/skills/bookmark/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-bookmark -g -y
SKILL.md
Frontmatter
{
    "name": "unity-bookmark",
    "description": "Manage Scene View bookmarks — save the current selection plus camera pivot\/rotation\/size under a name, then jump back later. Use when saving or restoring Scene View viewpoints, bookmarking a camera angle, or navigating between saved scene locations, even if the user just says \"标记视角\" or \"存个机位\". 管理 Scene View 书签(以命名方式保存当前选中对象与相机 pivot\/旋转\/大小,之后快速跳回);当用户要保存或恢复场景视角、收藏某个机位、或在已存位置间切换时使用。"
}

Bookmark Skills

Save and recall Scene View camera positions.

Guardrails

Operating Mode (v1.9 three-tier):

  • Approval (default): bookmark_set / bookmark_goto / bookmark_list 都标 SkillMode.SemiAuto,Approval 模式下可直接执行,无需走 grant 协议。与 workflow 模块文档保持一致(C# WorkflowSkills.cs 内三者均为 SemiAuto)。
  • Auto / Bypass: SemiAuto and FullAuto run directly.
  • Auto-forbidden in this module: bookmark_delete (SkillOperation.Delete). Reachable only under Bypass mode or via a user-managed Allowlist entry; the grant flow returns MODE_FORBIDDEN. Bookmarks themselves are in-memory only — bookmark_delete only removes the entry, no asset I/O.

DO NOT (common hallucinations):

  • bookmark_save does not exist → use bookmark_set
  • bookmark_load / bookmark_restore do not exist → use bookmark_goto
  • bookmark_remove does not exist → use bookmark_delete
  • Bookmarks save Scene View position + current selection, not scene state

Routing:

  • For workflow snapshots (object state undo) → use workflow module
  • For scene save/load → use scene module

Skills

bookmark_set

Save current Scene View camera position as a bookmark. Parameters:

  • bookmarkName (string): Bookmark name.

bookmark_goto

Move Scene View camera to a saved bookmark. Parameters:

  • bookmarkName (string): Bookmark name.

bookmark_list

List all saved bookmarks. Parameters: None.

bookmark_delete

Delete a saved bookmark. Parameters:

  • bookmarkName (string): Bookmark name.

Exact Signatures

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

控制Unity场景视图与游戏相机,支持移动旋转、创建配置、调整FOV/裁剪面及截图。涵盖Scene View取景、Game Camera属性修改及Culling设置,提供详细路由指引以区分不同相机操作模式。
用户请求移动或旋转Unity视图镜头 需要创建新相机或调整现有相机的FOV和裁剪面 提及'镜头'或'相机'且涉及场景视图取景 执行特定相机截图(如单相机离屏渲染或编辑器视图截图)
SkillsForUnity/unity-skills~/skills/camera/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-camera -g -y
SKILL.md
Frontmatter
{
    "name": "unity-camera",
    "description": "Control Unity Scene View and Game cameras — move\/rotate the view, create and configure cameras, set FOV\/clip planes\/projection. Use when framing the Scene View, creating or adjusting cameras, tweaking FOV or clipping planes, or scripting camera setup, even if the user just says \"镜头\" or \"相机\". 控制 Unity Scene View 与游戏相机(移动\/旋转视图、创建与配置相机、设置 FOV\/裁剪面\/投影);当用户要取景 Scene View、创建或调整相机、修改 FOV 或裁剪面时使用。"
}

Camera Skills

Control the Scene View camera and Game Cameras (creation, transform, properties, screenshot, culling, orthographic toggle).

Operating Mode

  • Approval (default): mutating skills (camera_set_transform, camera_create, camera_set_properties, camera_set_culling_mask, camera_screenshot, camera_sceneview_screenshot, camera_set_orthographic, camera_align_view_to_object, camera_look_at) need user grant; grant triggers a single server-side execution that returns the result.
  • Auto / Bypass: those skills execute directly.
  • Query skills (camera_get_info, camera_get_properties, camera_list) are SkillMode.SemiAuto — they run in all three modes without grant.
  • This module contains no Delete / PlayMode / Reload / high-risk skills (no NeverInSemi).

Guardrails

DO NOT (common hallucinations):

  • camera_move / camera_rotate do not exist → use camera_set_transform (Scene View) or gameobject_set_transform (Game Camera)
  • camera_set_fov does not exist → use camera_set_properties with fieldOfView parameter
  • camera_* skills control two different cameras: camera_set_transform/camera_look_at/camera_align_view_to_object control the Scene View camera; camera_create/camera_set_properties/camera_screenshot control Game Cameras
  • camera_delete does not exist → use gameobject_delete on the camera GameObject

Routing:

  • For Cinemachine virtual cameras → use cinemachine module
  • For Game Camera component properties → camera_set_properties / camera_get_properties (this module)
  • For screenshots → three options: scene_screenshot (scene module) = the Game View final composite (all cameras + UI; Play mode = live runtime frame); camera_screenshot (this module) = a single Game Camera off-screen render; camera_sceneview_screenshot (this module) = the editor Scene View (developer viewport, incl. grid/gizmos)

Skills

camera_align_view_to_object

Align Scene View camera to look at an object. Parameters:

  • name (string, optional): Target GameObject name.
  • instanceId (int, optional): Target GameObject instance ID.
  • path (string, optional): Target GameObject hierarchy path.

camera_get_info

Get Scene View camera position and rotation. Parameters: None.

camera_set_transform

Set Scene View camera position/rotation manually. Parameters:

  • posX, posY, posZ (float): Position.
  • rotX, rotY, rotZ (float): Rotation (Euler).
  • size (float, optional): Orthographic size or pivot distance (default 5).
  • instant (bool, optional): Move instantly (default true).

camera_look_at

Focus Scene View camera on a world-space point. Parameters:

  • x, y, z (float): Target point.
  • Does not support targetName or GameObject lookup. For object focus, use camera_align_view_to_object.

camera_create

Create a new Game Camera.

Parameter Type Required Default Description
name string No "New Camera" Name of the new camera GameObject
x float No 0 Position X
y float No 1 Position Y
z float No -10 Position Z
addAudioListener bool No false Also attach an AudioListener component

Returns: { success, name, instanceId }

camera_get_properties

Get Game Camera properties (supports name/instanceId/path).

Parameter Type Required Default Description
name string No null Name of the camera GameObject
instanceId int No 0 Instance ID of the camera GameObject
path string No null Hierarchy path of the camera GameObject

Returns: { success, name, fieldOfView, nearClipPlane, farClipPlane, orthographic, orthographicSize, depth, cullingMask, clearFlags, backgroundColor, rect }

camera_set_properties

Set Game Camera properties (FOV, clip planes, clear flags, background color, depth).

Parameter Type Required Default Description
name string No null Name of the camera GameObject
instanceId int No 0 Instance ID of the camera GameObject
path string No null Hierarchy path of the camera GameObject
fieldOfView float? No null Camera field of view
nearClipPlane float? No null Near clipping plane distance
farClipPlane float? No null Far clipping plane distance
depth float? No null Camera rendering depth
clearFlags string No null Clear flags (e.g. Skybox, SolidColor, Depth, Nothing)
bgR float? No null Background color red component
bgG float? No null Background color green component
bgB float? No null Background color blue component

Returns: { success, name }

camera_set_culling_mask

Set Game Camera culling mask by layer names (comma-separated).

Parameter Type Required Default Description
layerNames string Yes - Comma-separated layer names
name string No null Name of the camera GameObject
instanceId int No 0 Instance ID of the camera GameObject
path string No null Hierarchy path of the camera GameObject

Returns: { success, cullingMask }

camera_screenshot

Capture a screenshot from a Game Camera to file.

Parameter Type Required Default Description
savePath string No "Assets/screenshot.png" File path to save the screenshot
width int No 1920 Screenshot width in pixels
height int No 1080 Screenshot height in pixels
name string No null Name of the camera GameObject
instanceId int No 0 Instance ID of the camera GameObject
path string No null Hierarchy path of the camera GameObject

Returns: { success, path, width, height }

camera_sceneview_screenshot

Capture the editor Scene View (the developer's editing viewport — can overlook the whole scene incl. off-camera objects). Distinct from scene_screenshot (Game View / player camera) and camera_screenshot (one Game Camera). By default captures the full Scene View incl. grid/gizmos/selection (on-screen read); auto-falls back to a clean offscreen render if the editor build lacks the internal API. The Scene View window must be open and visible for the overlay capture.

Parameter Type Required Default Description
filename string No "sceneview.png" Bare filename only (no path separators); saved under Assets/Screenshots/
includeOverlays bool No true True = full Scene View with grid/gizmos/selection (falls back to a clean render if unsupported); false = clean offscreen scene render only

Returns: { success, path, width, height, mode, note }mode is "screen_with_overlays" or "offscreen_clean".

camera_set_orthographic

Switch Game Camera between orthographic and perspective mode.

Parameter Type Required Default Description
orthographic bool Yes - True for orthographic, false for perspective
orthographicSize float? No null Orthographic size (only applies in orthographic mode)
name string No null Name of the camera GameObject
instanceId int No 0 Instance ID of the camera GameObject
path string No null Hierarchy path of the camera GameObject

Returns: { success, orthographic, orthographicSize }

camera_list

List all cameras in the scene.

Parameter Type Required Default Description

Returns: { count, cameras: [{ name, instanceId, path, depth, orthographic, enabled }] }


Exact Signatures

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

用于配置Unity Cinemachine虚拟相机,支持VCam、FreeLook等类型及Body/Aim/Noise管线调校。通过反射适配CM2/3版本,提供创建、检查、属性设置等功能,需用户授权或Bypass模式执行,依赖Cinemachine包。
创建或调校Cinemachine相机 设置跟随/注视目标 配置噪声效果 构建运镜效果 用户提及'虚拟相机'或'运镜'
SkillsForUnity/unity-skills~/skills/cinemachine/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-cinemachine -g -y
SKILL.md
Frontmatter
{
    "name": "unity-cinemachine",
    "description": "Set up Cinemachine Virtual Cameras — VCam\/FreeLook\/ClearShot\/StateDriven cameras and the Body\/Aim\/Noise pipeline. Use when creating or tuning Cinemachine cameras, configuring follow\/look-at or noise, or building cinematic camera behavior, even if the user just says \"虚拟相机\" or \"运镜\". 配置 Cinemachine 虚拟相机(VCam\/FreeLook\/ClearShot\/StateDriven 及 Body\/Aim\/Noise 管线);当用户要创建或调校 Cinemachine 相机、设置跟随\/注视或噪声、或构建运镜效果时使用。"
}

Cinemachine Skills

Control Cinemachine Virtual Cameras and brain settings. Works with Cinemachine 2.x and 3.x through a runtime reflection adapter (CinemachineAdapter / CinemachineSkills).

Operating Mode

  • Approval:查询类 skill(cinemachine_inspect_vcam / cinemachine_list_components / cinemachine_get_brain_info,源码标 SkillMode.SemiAuto)直接执行;其余配置/创建类(cinemachine_create_vcam / cinemachine_set_targets / cinemachine_set_lens / cinemachine_configure_body / cinemachine_configure_aim 等,标 SkillMode.FullAuto)需用户 grant,grant 后服务端一步执行返结果。
  • Auto / Bypass:未被禁列表拦截的 skill 直接执行。
  • 本模块含 Delete 类 skillcinemachine_set_component(替换/移除 pipeline component)、cinemachine_target_group_remove_membercinemachine_remove_extension 标记为 SkillOperation.Delete,被 IsForbiddenInSemi 静态拦截 —— 仅 Bypass 模式或加入 Allowlist 才能调用。
  • 包依赖:必须安装 com.unity.cinemachine 包(CM 2.x 或 3.x)。未安装时所有 skill 返回 { error = "Cinemachine 未安装..." } 的 stub —— 调用方应先用 package_* 系列 skill 确认安装状态。
  • 反射脆弱性:CM2 ↔ CM3 之间 API 名变化大(CinemachineVirtualCameraCinemachineCameraCinemachineComponentBase 改名等)。本模块通过 CinemachineAdapter 反射桥接,遇 CM 早期预览版(< 3.0.0-pre.5)可能因 API 漂移返回失败 —— 优先用 cinemachine_inspect_vcam 探测当前可用字段,再决定 propertyName

DO NOT (common hallucinations):

  • cinemachine_create does not exist → use cinemachine_create_vcam for virtual cameras
  • cinemachine_set_target / cinemachine_set_follow / cinemachine_set_lookat do not exist → use cinemachine_set_targets (sets both Follow and LookAt in one call)
  • cinemachine_add_brain does not exist → CinemachineBrain is auto-added to Main Camera on first VCam creation
  • Cinemachine 2.x uses CinemachineVirtualCamera; Cinemachine 3.x uses CinemachineCamera — skills handle this automatically

Additional compatibility notes:

  • CM3 priority access should use Priority.Value as the lowest common API when writing compatibility code.
  • Early CM3 previews before 3.0.0-pre.5 changed core camera APIs significantly and are outside the current support baseline.

Routing:

  • For basic Game Camera operations → use camera module
  • For Scene View camera → use camera module's camera_set_transform/camera_look_at
  • For camera animation sequences → use timeline module with Cinemachine track

Skills

cinemachine_create_vcam

Create a new Virtual Camera. Parameters:

  • name (string): Name of the VCam GameObject.
  • folder (string): Parent folder path (default: "Assets/Settings").

cinemachine_inspect_vcam

Deeply inspect a VCam, returning fields and tooltips. Parameters:

  • vcamName (string, optional): Name of the VCam GameObject.
  • instanceId (int, optional): VCam instance ID.
  • path (string, optional): VCam hierarchy path.

cinemachine_set_vcam_property

Set any property on VCam or its pipeline components. Parameters:

  • vcamName (string): Name of the VCam.
  • instanceId (int, optional): VCam Instance ID.
  • path (string, optional): VCam hierarchy path.
  • componentType (string): "Main" (VCam itself), "Lens", or Component name (e.g. "OrbitalFollow").
  • propertyName (string): Field or property name.
  • value (object): New value.
  • fov (float, optional): Lens FOV shortcut. When supplied without propertyName, routes to cinemachine_set_lens.
  • nearClip (float, optional): Lens near clip shortcut.
  • farClip (float, optional): Lens far clip shortcut.
  • orthoSize (float, optional): Lens orthographic size shortcut.

cinemachine_set_targets

Set Follow and LookAt targets. Parameters:

  • vcamName (string): Name of the VCam.
  • instanceId (int, optional): VCam Instance ID (preferred for precision).
  • path (string, optional): VCam hierarchy path.
  • followName (string, optional): GameObject name to follow.
  • lookAtName (string, optional): GameObject name to look at.

cinemachine_set_component

Switch VCam pipeline component (Body/Aim/Noise). Parameters:

  • vcamName (string): Name of the VCam.
  • stage (string): "Body", "Aim", or "Noise".
  • componentType (string): Type name (e.g. "OrbitalFollow", "Composer") or "None" to remove.

cinemachine_add_component

DEPRECATED — Use cinemachine_set_component instead for proper pipeline control (Body/Aim/Noise stages). Add a Cinemachine component (legacy, supports CM2 and CM3). Parameters:

  • vcamName (string): Name of the VCam.
  • instanceId (int, optional): VCam Instance ID.
  • path (string, optional): VCam hierarchy path.
  • componentType (string): Type name (e.g., "OrbitalFollow").

cinemachine_set_lens

Quickly configure Lens settings (FOV, Near, Far, OrthoSize). Parameters:

  • vcamName (string): Name of the VCam.
  • fov (float, optional): Field of View.
  • nearClip (float, optional): Near Clip Plane.
  • farClip (float, optional): Far Clip Plane.
  • orthoSize (float, optional): Orthographic Size.

cinemachine_list_components

List all available Cinemachine component names. Parameters:

  • None.

cinemachine_impulse_generate

Trigger an Impulse at location or via Source. Parameters:

  • sourceParams (string, optional): JSON string for parameters, e.g., {"velocity": {"x": 0, "y": -1, "z": 0}}.

cinemachine_get_brain_info

Get info about the Active Camera and Blend. Parameters:

  • None.

cinemachine_create_target_group

Create a CinemachineTargetGroup. Parameters:

  • name (string): Name of the new TargetGroup GameObject.

cinemachine_target_group_add_member

Add or update a member in a TargetGroup. Parameters:

  • groupName (string): Name of the TargetGroup.
  • targetName (string): Name of the member GameObject.
  • weight (float): Member weight (default 1).
  • radius (float): Member radius (default 1).

cinemachine_target_group_remove_member

Remove a member from a TargetGroup. Parameters:

  • groupName (string): Name of the TargetGroup.
  • targetName (string): Name of the member GameObject.

cinemachine_set_spline

Assign a SplineContainer to a VCam's SplineDolly component (Body stage). Parameters:

  • vcamName (string): Name of the VCam.
  • splineName (string): Name of the GameObject with SplineContainer.

cinemachine_add_extension

Add a CinemachineExtension to a VCam. Parameters:

  • vcamName (string): Name of the VCam.
  • extensionName (string): Type name of the extension (e.g., "CinemachineStoryboard", "CinemachineImpulseListener").

cinemachine_remove_extension

Remove a CinemachineExtension from a VCam. Parameters:

  • vcamName (string): Name of the VCam.
  • extensionName (string): Type name of the extension.

cinemachine_set_active

Force activation of a VCam (SOLO) by setting highest priority. Parameters:

  • vcamName (string): Name of the VCam to activate.

cinemachine_create_mixing_camera

Create a Cinemachine Mixing Camera. Parameters:

  • name (string): Name of the new GameObject.

cinemachine_mixing_camera_set_weight

Set the weight of a child camera within a Mixing Camera. Parameters:

  • mixerName (string, optional): Name of the Mixing Camera.
  • mixerInstanceId (int, optional): Mixing Camera instance ID.
  • mixerPath (string, optional): Mixing Camera hierarchy path.
  • mixerEntityId (string, optional): Mixing Camera entity ID (Unity 6000.4+, preferred).
  • childName (string, optional): Name of the child VCam.
  • childInstanceId (int, optional): Child VCam instance ID.
  • childPath (string, optional): Child VCam hierarchy path.
  • childEntityId (string, optional): Child VCam entity ID (Unity 6000.4+, preferred).
  • weight (float): Weight value, usually 0.0–1.0 (default 1).

cinemachine_create_clear_shot

Create a Cinemachine Clear Shot Camera. Parameters:

  • name (string): Name of the new GameObject.

cinemachine_create_state_driven_camera

Create a Cinemachine State Driven Camera. Parameters:

  • name (string): Name of the new GameObject.
  • targetAnimatorName (string, optional): Name of the GameObject with the Animator to bind.

cinemachine_state_driven_camera_add_instruction

Add a state mapping instruction to a State Driven Camera. Parameters:

  • cameraName (string, optional): Name of the State Driven Camera.
  • cameraInstanceId (int, optional): State Driven Camera instance ID.
  • cameraPath (string, optional): State Driven Camera hierarchy path.
  • cameraEntityId (string, optional): State Driven Camera entity ID (Unity 6000.4+, preferred).
  • stateName (string): Name of the animation state (e.g., "Run").
  • childCameraName (string, optional): Name of the child VCam to activate for this state.
  • childInstanceId (int, optional): Child VCam instance ID.
  • childPath (string, optional): Child VCam hierarchy path.
  • childEntityId (string, optional): Child VCam entity ID (Unity 6000.4+, preferred).
  • minDuration (float, optional): Minimum duration in seconds (default 0).
  • activateAfter (float, optional): Delay in seconds before activation (default 0).

cinemachine_set_noise

Configure Noise settings (Basic Multi Channel Perlin). Parameters:

  • vcamName (string): Name of the VCam.
  • amplitudeGain (float): Noise Amplitude.
  • frequencyGain (float): Noise Frequency.

cinemachine_set_priority

Set explicit priority value for a Virtual Camera. Higher priority wins activation. Parameters:

  • vcamName (string, optional): VCam name. Provide one of name/instanceId/path.
  • instanceId (int, optional): VCam Instance ID.
  • path (string, optional): VCam hierarchy path.
  • priority (int): Priority value (default 10).

cinemachine_set_blend

Set default blend or per-camera-pair blend on the CinemachineBrain. Leave fromCamera/toCamera empty for default blend. Parameters:

  • style (string): Blend style — Cut/EaseInOut/EaseIn/EaseOut/HardIn/HardOut/Linear (default EaseInOut).
  • time (float): Blend duration in seconds (default 2).
  • fromCamera (string, optional): Source VCam name for per-pair blend.
  • toCamera (string, optional): Destination VCam name for per-pair blend.

cinemachine_set_brain

Configure CinemachineBrain properties: update method, default blend, debug display. Parameters:

  • updateMethod (string, optional): FixedUpdate/LateUpdate/SmartUpdate/ManualUpdate.
  • blendUpdateMethod (string, optional): FixedUpdate/LateUpdate.
  • defaultBlendStyle (string, optional): Blend style name (see cinemachine_set_blend).
  • defaultBlendTime (float, optional): Default blend duration in seconds.
  • showDebugText (bool, optional): Show Cinemachine debug text overlay.
  • showCameraFrustum (bool, optional): Draw active camera frustum gizmo.
  • ignoreTimeScale (bool, optional): Ignore Time.timeScale for blends.

cinemachine_create_sequencer

Create a Sequencer camera (CM3) or BlendList camera (CM2) that plays child cameras in sequence. Parameters:

  • name (string): Name of the new GameObject.
  • loop (bool): Whether to loop the sequence (default false).

cinemachine_sequencer_add_instruction

Add a child camera instruction to a Sequencer/BlendList camera. Parameters:

  • sequencerName (string, optional): Sequencer camera name.
  • sequencerInstanceId (int, optional): Sequencer Instance ID.
  • sequencerPath (string, optional): Sequencer hierarchy path.
  • sequencerEntityId (string, optional): Sequencer entity ID (Unity 6000.4+, preferred).
  • childCameraName (string, optional): Child VCam name.
  • childInstanceId (int, optional): Child VCam Instance ID.
  • childPath (string, optional): Child VCam hierarchy path.
  • childEntityId (string, optional): Child VCam entity ID (Unity 6000.4+, preferred).
  • hold (float): Duration to hold on this child in seconds (default 2).
  • blendStyle (string): Blend style to use entering this child (default EaseInOut).
  • blendTime (float): Blend duration in seconds (default 2).

Provide at least one identifier for each of sequencer and child camera.

cinemachine_create_freelook

Create a FreeLook camera. CM2 uses CinemachineFreeLook; CM3 builds CinemachineCamera + OrbitalFollow(ThreeRing) + RotationComposer. Parameters:

  • name (string): Name of the new GameObject.
  • followName (string, optional): GameObject to follow.
  • lookAtName (string, optional): GameObject to look at.

cinemachine_configure_camera_manager

Configure ClearShot/StateDriven/Sequencer camera manager properties in one call. Applies only the properties whose matching component exists on the target. Parameters:

  • cameraName (string, optional): Camera manager name. Provide one of name/instanceId/path.
  • cameraInstanceId (int, optional): Camera manager Instance ID.
  • cameraPath (string, optional): Camera manager hierarchy path.
  • activateAfter (float, optional): ClearShot — delay before activation.
  • minDuration (float, optional): ClearShot — minimum duration on a shot.
  • randomizeChoice (bool, optional): ClearShot — randomize shot selection.
  • animatorName (string, optional): StateDriven — name of the GameObject carrying the Animator.
  • layerIndex (int, optional): StateDriven — Animator layer index.
  • defaultBlendStyle (string, optional): Default blend style (shared by ClearShot/StateDriven).
  • defaultBlendTime (float, optional): Default blend duration in seconds.
  • loop (bool, optional): Sequencer — loop playback.

cinemachine_configure_body

Configure the Body stage component (Follow, OrbitalFollow, ThirdPersonFollow, PositionComposer, FramingTransposer, etc.) in one call. Only fields matching the active component are applied. Parameters:

  • vcamName (string, optional): VCam name. Provide one of name/instanceId/path.
  • instanceId (int, optional): VCam Instance ID.
  • path (string, optional): VCam hierarchy path.

Follow / Transposer:

  • offsetX / offsetY / offsetZ (float, optional): Follow offset vector.
  • bindingMode (string, optional): Binding/target attachment mode (e.g. LockToTarget, WorldSpace).
  • dampingX / dampingY / dampingZ (float, optional): Positional damping.

OrbitalFollow / OrbitalTransposer:

  • orbitStyle (string, optional): Sphere or ThreeRing.
  • radius (float, optional): Sphere orbit radius.
  • topHeight / topRadius (float, optional): Top ring parameters.
  • midHeight / midRadius (float, optional): Middle ring parameters.
  • bottomHeight / bottomRadius (float, optional): Bottom ring parameters.

ThirdPersonFollow:

  • shoulderX / shoulderY / shoulderZ (float, optional): Shoulder offset.
  • verticalArmLength (float, optional): Vertical arm length.
  • cameraSide (float, optional): 0 = left, 1 = right.

PositionComposer / FramingTransposer:

  • cameraDistance (float, optional): Distance between camera and target.
  • screenX / screenY (float, optional): On-screen target position (0–1).
  • deadZoneWidth / deadZoneHeight (float, optional): Dead zone size (0–1).

cinemachine_configure_aim

Configure the Aim stage component (RotationComposer, Composer, PanTilt, POV, etc.) in one call. Only fields matching the active component are applied. Parameters:

  • vcamName (string, optional): VCam name. Provide one of name/instanceId/path.
  • instanceId (int, optional): VCam Instance ID.
  • path (string, optional): VCam hierarchy path.

Composer / RotationComposer:

  • screenX / screenY (float, optional): Target on-screen position.
  • deadZoneWidth / deadZoneHeight (float, optional): Dead zone size.
  • softZoneWidth / softZoneHeight (float, optional): Soft zone size.
  • horizontalDamping / verticalDamping (float, optional): Composition damping.
  • lookaheadTime / lookaheadSmoothing (float, optional): Target lookahead tuning.
  • centerOnActivate (bool, optional): Re-center on activation.

PanTilt / POV:

  • referenceFrame (string, optional): Reference frame for pan/tilt axes.
  • panValue / tiltValue (float, optional): Explicit pan/tilt values.

Target offset:

  • targetOffsetX / targetOffsetY / targetOffsetZ (float, optional): Offset from target pivot.

cinemachine_configure_extension

Configure a Cinemachine extension (CinemachineConfiner, CinemachineDeoccluder/Collider, CinemachineFollowZoom, CinemachineGroupFraming, etc.). If extensionName is omitted, the first extension on the VCam is used. Parameters:

  • vcamName (string, optional): VCam name. Provide one of name/instanceId/path.
  • instanceId (int, optional): VCam Instance ID.
  • path (string, optional): VCam hierarchy path.
  • extensionName (string, optional): Extension type name (e.g. CinemachineConfiner).

Confiner:

  • boundingShapeName (string, optional): Name of the bounding shape GameObject.
  • damping (float, optional): Damping applied when confining.
  • slowingDistance (float, optional): Slow-down distance inside the bounding shape.

Deoccluder / Collider:

  • cameraRadius (float, optional): Camera collision radius.
  • strategy (string, optional): Deocclusion strategy name.
  • maximumEffort (int, optional): Maximum raycast iterations.
  • smoothingTime (float, optional): Smoothing time for occlusion changes.

FollowZoom:

  • width (float, optional): Target width in world units.
  • fovMin / fovMax (float, optional): FOV clamp range.

GroupFraming:

  • framingMode (string, optional): Framing mode name.
  • framingSize (float, optional): Desired framing size.
  • sizeAdjustment (string, optional): Size adjustment strategy name.

cinemachine_configure_impulse_source

Configure CinemachineImpulseSource definition (shape, duration, gains). If no source is specified, the first CinemachineImpulseSource in the scene is used. Parameters:

  • sourceName (string, optional): Source name. Provide one of name/instanceId/path; omit all to pick the first source.
  • sourceInstanceId (int, optional): Source Instance ID.
  • sourcePath (string, optional): Source hierarchy path.
  • amplitudeGain (float, optional): Amplitude gain multiplier.
  • frequencyGain (float, optional): Frequency gain multiplier.
  • impactRadius (float, optional): Impact radius in world units.
  • duration (float, optional): Signal duration in seconds.
  • dissipationRate (float, optional): Dissipation rate over distance.

Minimal Example

import unity_skills

# Create a vcam that follows and looks at the player
unity_skills.call_skill("cinemachine_create_vcam", name="PlayerCam")
unity_skills.call_skill("cinemachine_set_targets", vcamName="PlayerCam", followName="Player", lookAtName="Player")

Exact Signatures

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

用于清理和审计Unity项目,查找未使用资源、重复项、丢失引用及空文件夹。支持项目瘦身、发布前审计,提供预览与确认删除机制,避免误删。
用户要求清理或瘦身Unity项目 排查重复或孤立资源 发布前进行项目审计
SkillsForUnity/unity-skills~/skills/cleaner/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-cleaner -g -y
SKILL.md
Frontmatter
{
    "name": "unity-cleaner",
    "description": "Clean up and audit a Unity project — find unused assets, content-hash duplicates, missing references, and empty folders. Use when reducing project bloat, hunting duplicate or orphaned assets, or auditing before a release, even if the user just says \"清理项目\" or \"瘦身\". 清理与审计 Unity 工程(查找未使用资源、内容哈希重复项、丢失引用、空文件夹);当用户要给项目瘦身、排查重复或孤立资源、或发布前审计时使用。"
}

Unity Cleaner Skills

Safety: cleaner_delete_assets uses a two-step confirmToken handshake. Call without confirmToken to preview; call again with the returned token (5-minute TTL) to actually delete. There is no dryRun parameter.

Guardrails

Operating Mode (v1.9 three-tier):

  • Approval (default): all analyze/query skills (cleaner_find_unused_assets, cleaner_find_duplicates, cleaner_find_missing_references, cleaner_get_asset_usage, cleaner_find_empty_folders, cleaner_find_large_assets, cleaner_get_dependency_tree) are SemiAuto — run directly.
  • Auto / Bypass: SemiAuto and FullAuto run directly.
  • Auto-forbidden in this module: cleaner_delete_assets, cleaner_delete_empty_folders (both carry SkillOperation.Delete). In Approval/Auto these return MODE_FORBIDDEN — they are reachable only under Bypass mode or via a user-managed Allowlist entry; the grant flow does not unlock them.
  • cleaner_fix_missing_scripts is an Execute | Modify operation (it replaces missing component references with null in place, no asset deletion), so it does not trigger the NeverInSemi gate. In Auto / Bypass it runs directly; in Approval it still requires the standard grant handshake before execution.
  • cleaner_delete_assets additionally uses a two-step confirmToken handshake even when the mode gate allows it — preview first (no token), then confirm with the returned token (5-minute TTL).

DO NOT (common hallucinations):

  • cleaner_delete / cleaner_remove do not exist → cleaner skills only find/report; use asset_delete to actually remove
  • cleaner_fix does not exist → use cleaner_fix_missing_scripts specifically for missing script references
  • cleaner_scan / cleaner_find_unused do not exist → use specific skills: cleaner_find_unused_assets, cleaner_find_duplicates, cleaner_find_missing_references, cleaner_find_empty_folders, cleaner_find_large_assets

Routing:

  • To delete found assets → use asset module's asset_delete / asset_delete_batch
  • For project validation → use validation module

Skills Overview

Skill Description
cleaner_find_unused_assets Find assets not referenced by others
cleaner_find_duplicates Find duplicate files by content hash
cleaner_find_missing_references Find missing scripts/asset references
cleaner_delete_assets Delete assets via two-step confirmToken (preview → confirm)
cleaner_get_asset_usage Find what references a specific asset
cleaner_find_empty_folders Find empty folders in the project
cleaner_find_large_assets Find largest assets by file size
cleaner_delete_empty_folders Delete all empty folders
cleaner_fix_missing_scripts Remove missing script components from GameObjects
cleaner_get_dependency_tree Get dependency tree for an asset

Skills

cleaner_find_unused_assets

Find potentially unused assets of a specific type.

Parameter Type Required Default Description
assetType string No "Material" Asset type filter
searchPath string No "Assets" Search path
limit int No 100 Max results

Returns: {success, assetType, potentiallyUnusedCount, assets: [{path, name, type, sizeBytes}]}

# Find unused materials
result = call_skill("cleaner_find_unused_assets", assetType="Material")

# Find unused textures in a specific folder
result = call_skill("cleaner_find_unused_assets", 
    assetType="Texture2D", searchPath="Assets/Textures")

cleaner_find_duplicates

Find duplicate files by MD5 hash.

Parameter Type Required Default Description
assetType string No "Texture2D" Asset type
searchPath string No "Assets" Search path
limit int No 50 Max groups

Returns: {success, duplicateGroupCount, totalWastedBytes, totalWastedMB, groups: [{count, sizeBytes, wastedBytes, files}]}

# Find duplicate textures
result = call_skill("cleaner_find_duplicates", assetType="Texture2D")
print(f"Wasted space: {result['totalWastedMB']:.2f} MB")

cleaner_find_missing_references

Find components with missing scripts or null references.

Parameter Type Required Default Description
includeInactive bool No true Include inactive objects

Returns: {success, issueCount, missingScripts, missingReferences, issues: [{type, gameObject, path, ...}]}

# Scan for all missing references
result = call_skill("cleaner_find_missing_references")
print(f"Missing scripts: {result['missingScripts']}")
print(f"Missing references: {result['missingReferences']}")

cleaner_delete_assets

Delete specified assets with two-step confirmation.

⚠️ Safety First: Deletion requires TWO calls - first preview, then confirm.

Step 1 - Preview (no confirmToken):

Parameter Type Required Description
paths string[] Yes Asset paths to delete

Returns: {action: "preview", confirmToken, assetsToDelete, message}

Step 2 - Confirm (with confirmToken):

Parameter Type Required Description
confirmToken string Yes Token from preview step

Returns: {action: "deleted", deletedCount, results}

# Step 1: Preview what will be deleted
preview = call_skill("cleaner_delete_assets", 
    paths=["Assets/Unused/mat1.mat", "Assets/Unused/mat2.mat"])
print(preview['message'])  # Shows: "⚠️ PREVIEW ONLY - 2 assets will be deleted..."
print(preview['assetsToDelete'])  # Full list with sizes

# Step 2: Confirm deletion using token (expires in 5 minutes)
if input("Proceed? (y/n): ") == 'y':
    result = call_skill("cleaner_delete_assets", 
        confirmToken=preview['confirmToken'])
    print(result['message'])  # "Successfully deleted 2 assets"

cleaner_get_asset_usage

Find what objects reference a specific asset.

Parameter Type Required Description
assetPath string Yes Asset path
limit int No Max results (default 50)

Returns: {success, asset, usedByCount, usedBy: [{path, name, type}]}

# Check what uses a texture
result = call_skill("cleaner_get_asset_usage",
    assetPath="Assets/Textures/player.png")

cleaner_find_empty_folders

Find empty folders in the project.

Parameter Type Required Default Description
searchPath string No "Assets" Search path

Returns: { success, count, folders }

# Find empty folders
result = call_skill("cleaner_find_empty_folders")
print(f"Found {result['count']} empty folders")

cleaner_find_large_assets

Find largest assets by file size.

Parameter Type Required Default Description
searchPath string No "Assets" Search path
limit int No 20 Max results
minSizeBytes long No 0 Minimum file size in bytes

Returns: { success, count, assets: [{ path, sizeBytes, sizeMB }] }

# Find top 10 largest assets over 1 MB
result = call_skill("cleaner_find_large_assets", limit=10, minSizeBytes=1048576)
for a in result['assets']:
    print(f"{a['sizeMB']:.2f} MB - {a['path']}")

cleaner_delete_empty_folders

Delete all empty folders.

Parameter Type Required Default Description
searchPath string No "Assets" Search path

Returns: { success, deleted, total }

# Delete all empty folders
result = call_skill("cleaner_delete_empty_folders")
print(f"Deleted {result['deleted']} of {result['total']} empty folders")

cleaner_fix_missing_scripts

Remove missing script components from GameObjects.

Parameter Type Required Default Description
includeInactive bool No true Include inactive objects

Returns: { success, removedComponents }

# Remove all missing script components
result = call_skill("cleaner_fix_missing_scripts")
print(f"Removed {result['removedComponents']} missing script components")

cleaner_get_dependency_tree

Get dependency tree for an asset.

Parameter Type Required Default Description
assetPath string Yes - Asset path
recursive bool No true Recursively resolve dependencies

Returns: { success, assetPath, dependencyCount, dependencies: [{ path, type }] }

# Get full dependency tree for a prefab
result = call_skill("cleaner_get_dependency_tree",
    assetPath="Assets/Prefabs/Player.prefab")
print(f"Dependencies: {result['dependencyCount']}")

Example Workflow: Clean Project

import unity_skills

# 1. Find all missing references and fix them
missing = unity_skills.call_skill("cleaner_find_missing_references")
for issue in missing['issues']:
    if issue['type'] == 'MissingScript':
        print(f"⚠️ Missing script on: {issue['path']}")

# 2. Find duplicate textures
dupes = unity_skills.call_skill("cleaner_find_duplicates", assetType="Texture2D")
if dupes['totalWastedMB'] > 10:
    print(f"🗑️ {dupes['totalWastedMB']:.1f} MB wasted on duplicates")

# 3. Find unused materials
unused = unity_skills.call_skill("cleaner_find_unused_assets", assetType="Material")
print(f"📦 {unused['potentiallyUnusedCount']} potentially unused materials")

# 4. Preview cleanup
paths_to_delete = [a['path'] for a in unused['assets'][:5]]
preview = unity_skills.call_skill("cleaner_delete_assets", 
    paths=paths_to_delete)
print(f"Would free: {preview['totalMB']:.2f} MB")
# To actually delete, call again with preview['confirmToken'] within 5 minutes.

Exact Signatures

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

管理Unity GameObject组件,支持添加、移除、列出、复制、启用/禁用及读写字段。适用于挂载或移除组件、对象间复制、开关组件及序列化属性修改等场景。
用户要求添加或移除组件 用户需要读取或修改组件属性 用户要求启用或禁用组件 用户需要在不同对象间复制组件
SkillsForUnity/unity-skills~/skills/component/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-component -g -y
SKILL.md
Frontmatter
{
    "name": "unity-component",
    "description": "Manage GameObject components — add, remove, list, copy, enable\/disable, and read\/set component fields. Use when attaching or removing components, copying components between objects, toggling them, or reading\/writing their serialized fields, even if the user just says \"加个组件\" or \"改组件属性\". 管理 GameObject 组件(添加、移除、列出、复制、启用\/禁用、读写组件字段);当用户要挂载或移除组件、在对象间复制组件、开关组件或读写其序列化字段时使用。"
}

Unity Component Skills

BATCH-FIRST: Use *_batch skills when operating on 2+ objects to reduce API calls from N to 1.

Operating Mode

  • Approval:本模块 Mixed —— component_list / component_get_propertiesSkillMode.SemiAuto,可直接执行;写类 skill (component_add / component_set_property / component_set_enabled / component_copy 等) 标 SkillMode.FullAuto,需 grant 单次执行返结果。
  • Auto / Bypass:FullAuto 直接执行。
  • 含 NeverInSemi 高危 skillcomponent_remove / component_remove_batch(Operation.Delete)。这些在 Approval/Auto 下返 MODE_FORBIDDEN,仅 Bypass 或 Allowlist 命中可调。

DO NOT (common hallucinations):

  • component_create / component_get do not exist → use component_add (add) and component_get_properties (read)
  • component_find does not exist → use component_list to list components on an object
  • componentType is case-sensitive — Rigidbody not rigidbody, BoxCollider not boxcollider
  • Custom scripts need exact class name; if namespaced, use Namespace.ClassName

Routing:

  • To create a C# component script → use script module's script_create first, then component_add
  • To set multiple properties at once → use component_set_property_batch
  • To enable/disable a component → component_set_enabled (not component_set_property)

Object Targeting: All single-object skills accept name (string), instanceId (int, preferred), and path (string, hierarchy path). Provide at least one.

Skills Overview

Single Object Batch Version Use Batch When
component_add component_add_batch Adding to 2+ objects
component_remove component_remove_batch Removing from 2+ objects
component_set_property component_set_property_batch Setting on 2+ objects
component_set_serialized_property component_set_serialized_property_batch Setting Inspector SerializedProperty paths

Other Skills (no batch):

  • component_list - List all components on an object
  • component_get_properties - Get component property values
  • component_set_enabled - Enable/disable a component (Behaviour, Renderer, Collider)
  • component_copy - Copy a component from one object to another
  • component_get_serialized_properties - List Inspector SerializedProperty paths
  • component_copy_exact - Copy a component and verify serialized fields match

Single-Object Skills

component_add

Add a component to a GameObject.

Parameter Type Required Description
name string No* GameObject name
instanceId int No* Instance ID (preferred)
path string No* Hierarchy path
componentType string Yes Component type name

*At least one identifier required

Returns: {success, gameObject, instanceId, component, fullTypeName} (returns {warning, gameObject, instanceId} instead if a single-instance component already exists)

component_remove

Remove a component from a GameObject.

Parameter Type Required Description
name string No* GameObject name
instanceId int No* Instance ID
componentType string Yes Component type to remove

Returns: {success, gameObject, removed} (removed is the requested componentType string)

component_list

List all components on a GameObject.

Parameter Type Required Description
name string No* GameObject name
instanceId int No* Instance ID

Returns: {gameObject, instanceId, path, componentCount, components: [{type, fullType, enabled, keyProperties?}]} (keyProperties only present when includeProperties=true)

component_set_property

Set a component property value.

Parameter Type Required Description
name string No* GameObject name
instanceId int No* Instance ID
componentType string Yes Component type
propertyName string Yes Property to set
value any Cond. New value (for basic types, vectors, colors)
referencePath string No Scene object hierarchy path (for scene references)
referenceName string No Scene object name (for scene references)
assetPath string No Project asset path (for asset references: Material, Texture, AudioClip, ScriptableObject, Prefab, etc.)

Provide one of: value (basic types), referencePath/referenceName (scene objects), or assetPath (project assets).

value type examples:

# float / int / bool / string
call_skill("component_set_property", name="Obj", componentType="Rigidbody", propertyName="mass", value=2.5)
call_skill("component_set_property", name="Obj", componentType="Rigidbody", propertyName="useGravity", value=False)

# Vector3 (JSON object with x, y, z)
call_skill("component_set_property", name="Obj", componentType="Transform", propertyName="localPosition",
           value={"x": 1, "y": 2, "z": 3})

# Color (JSON object with r, g, b, a — values 0-1)
call_skill("component_set_property", name="Obj", componentType="Light", propertyName="color",
           value={"r": 1, "g": 0.5, "b": 0, "a": 1})

# Enum (use string name)
call_skill("component_set_property", name="Obj", componentType="Rigidbody", propertyName="interpolation",
           value="Interpolate")

Returns: {success, gameObject, component, property, valueSet, valueType} (valueSet is the string form of the actual value applied; valueType is the resolved target type name)

component_get_properties

Get all properties of a component.

Parameter Type Required Description
name string No* GameObject name
instanceId int No* Instance ID
componentType string Yes Component type

Returns: {gameObject, component, fullTypeName, properties: [{name, type, fullType, value, canWrite}], fields: [{name, type, fullType, value, isSerializable}]}

component_get_serialized_properties

List Inspector serialized properties on a component via SerializedObject.

Parameter Type Required Description
name string No* GameObject name
instanceId int No* Instance ID
path string No* Hierarchy path
componentType string Yes Component type
includeChildren bool No Include nested properties
limit int No Max properties returned

Returns: {success, gameObject, component, fullTypeName, properties}

component_set_serialized_property

Set an Inspector serialized property by propertyPath.

Parameter Type Required Description
name string No* GameObject name
instanceId int No* Instance ID
path string No* Hierarchy path
componentType string Yes Component type
propertyPath string Yes SerializedProperty path, e.g. items.Array.data[0]
value string Cond. Primitive/vector/color/enum value
referenceName string No Scene object name for ObjectReference
referenceInstanceId int No Scene object instance ID for ObjectReference
referencePath string No Scene object path for ObjectReference
assetPath string No Project asset path for ObjectReference
objectType string No Expected object/component type for references

Provide value for scalar properties, or a scene/project reference for ObjectReference fields.

Returns: {success, gameObject, component, propertyPath, valueSet}


Batch Skills

component_add_batch

Add components to multiple objects.

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

Returns: {success, totalItems, successCount, failCount, results: [{success, gameObject, componentType, added}]}

unity_skills.call_skill("component_add_batch", items=[
    {"name": "Enemy1", "componentType": "Rigidbody"},
    {"name": "Enemy2", "componentType": "Rigidbody"},
    {"name": "Enemy3", "componentType": "Rigidbody"}
])

component_remove_batch

Remove components from multiple objects.

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

Returns: {success, totalItems, successCount, failCount, results: [{success, gameObject, componentType, removed}]}

unity_skills.call_skill("component_remove_batch", items=[
    {"instanceId": 12345, "componentType": "BoxCollider"},
    {"instanceId": 12346, "componentType": "BoxCollider"}
])

component_set_property_batch

Set properties on multiple objects.

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

Returns: {success, totalItems, successCount, failCount, results: [{success, gameObject, componentType, property, oldValue, newValue}]}

unity_skills.call_skill("component_set_property_batch", items=[
    {"name": "Enemy1", "componentType": "Rigidbody", "propertyName": "mass", "value": 2.0},
    {"name": "Enemy2", "componentType": "Rigidbody", "propertyName": "mass", "value": 2.0}
])

component_set_serialized_property_batch

Set Inspector serialized properties on multiple components.

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects

Item properties: name, instanceId, path, componentType, propertyPath, value, referenceName, referenceInstanceId, referencePath, assetPath, objectType

Returns: {success, totalItems, successCount, failCount, results}


Common Component Types

Physics

Type Description
Rigidbody Physics simulation
BoxCollider Box collision
SphereCollider Sphere collision
CapsuleCollider Capsule collision
MeshCollider Mesh-based collision
CharacterController Character movement

Rendering

Type Description
MeshRenderer Render meshes
SkinnedMeshRenderer Animated meshes
SpriteRenderer 2D sprites
LineRenderer Draw lines
TrailRenderer Motion trails

Audio

Type Description
AudioSource Play sounds
AudioListener Receive audio

UI

Type Description
Canvas UI container
Image UI images
Text UI text (legacy)
Button Clickable button

Example: Efficient Physics Setup

import unity_skills

# BAD: 6 API calls
unity_skills.call_skill("component_add", name="Box1", componentType="Rigidbody")
unity_skills.call_skill("component_add", name="Box2", componentType="Rigidbody")
unity_skills.call_skill("component_add", name="Box3", componentType="Rigidbody")
unity_skills.call_skill("component_set_property", name="Box1", componentType="Rigidbody", propertyName="mass", value=2.0)
unity_skills.call_skill("component_set_property", name="Box2", componentType="Rigidbody", propertyName="mass", value=2.0)
unity_skills.call_skill("component_set_property", name="Box3", componentType="Rigidbody", propertyName="mass", value=2.0)

# GOOD: 2 API calls
unity_skills.call_skill("component_add_batch", items=[
    {"name": "Box1", "componentType": "Rigidbody"},
    {"name": "Box2", "componentType": "Rigidbody"},
    {"name": "Box3", "componentType": "Rigidbody"}
])
unity_skills.call_skill("component_set_property_batch", items=[
    {"name": "Box1", "componentType": "Rigidbody", "propertyName": "mass", "value": 2.0},
    {"name": "Box2", "componentType": "Rigidbody", "propertyName": "mass", "value": 2.0},
    {"name": "Box3", "componentType": "Rigidbody", "propertyName": "mass", "value": 2.0}
])

Best Practices

  1. Add colliders before Rigidbody for physics
  2. Use component_list to verify additions
  3. Check property names with component_get_properties first
  4. Some properties are read-only (will fail to set)
  5. Use full type names for custom scripts (e.g., "MyNamespace.MyScript")

Additional Skills

component_copy

Copy a component from one GameObject to another.

Parameter Type Required Default Description
sourceName string No* null Source GameObject name
sourceInstanceId int No* 0 Source Instance ID
sourcePath string No* null Source hierarchy path
targetName string No* null Target GameObject name
targetInstanceId int No* 0 Target Instance ID
targetPath string No* null Target hierarchy path
componentType string Yes - Component type to copy

*At least one source identifier and one target identifier required

Returns: { success, source, target, componentType }

component_copy_exact

Copy a component from one GameObject to another and verify serialized Inspector fields match.

Parameter Type Required Default Description
sourceName string No* null Source GameObject name
sourceInstanceId int No* 0 Source Instance ID
sourcePath string No* null Source hierarchy path
targetName string No* null Target GameObject name
targetInstanceId int No* 0 Target Instance ID
targetPath string No* null Target hierarchy path
componentType string Yes - Component type to copy

Returns: { success, source, target, componentType, verified, mismatchCount, mismatches? }

component_set_enabled

Enable or disable a component (Behaviour, Renderer, Collider, etc.).

Parameter Type Required Default Description
name string No* null GameObject name
instanceId int No* 0 Instance ID
path string No* null Hierarchy path
componentType string Yes - Component type to enable/disable
enabled bool No true Whether to enable or disable

*At least one identifier required

Returns: { success, gameObject, componentType, enabled }


Exact Signatures

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

用于捕获、查询和调整Unity编辑器控制台设置。支持读取/过滤日志、写入自定义消息、导出日志及配置错误暂停等选项,辅助调试与日志管理。
查看控制台输出 过滤错误或警告 输出日志消息 调整控制台设置 用户说看日志或控制台
SkillsForUnity/unity-skills~/skills/console/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-console -g -y
SKILL.md
Frontmatter
{
    "name": "unity-console",
    "description": "Capture and query the Unity Editor console — read\/filter logs, write custom log entries, and adjust console settings. Use when inspecting console output, filtering errors or warnings, emitting log messages, or configuring the console, even if the user just says \"看日志\" or \"控制台\". 捕获并查询 Unity 编辑器控制台(读取\/过滤日志、写入自定义日志、调整控制台设置);当用户要查看控制台输出、过滤错误或警告、输出日志消息时使用。"
}

Unity Console Skills

Work with the Unity console - capture logs, write messages, and debug your project.

Operating Mode

  • Approval: 只读 skill(console_get_logs / console_get_stats,标 SkillMode.SemiAuto)直接执行;其余 skill(console_start_capture / console_stop_capture / console_clear / console_log / console_export / console_set_pause_on_error / console_set_collapse / console_set_clear_on_play,默认 SkillMode.FullAuto)需用户 grant,grant 后一步执行返结果。
  • Auto / Bypass: 直接执行。
  • 本模块不含 Delete / PlayMode / Reload / RiskLevel=high 类 skill —— 没有 IsForbiddenInSemi 拦截,不需要 Bypass 才能跑的高危操作。

DO NOT (common hallucinations):

  • console_filter does not exist → use console_get_logs with filter parameter
  • console_read does not exist → use console_get_logs
  • console_write does not exist → use console_log
  • Do not confuse with debug_get_logsconsole_get_logs reads captured buffer, debug_get_logs reads all console entries

Routing:

  • For compilation errors specifically → use debug module's debug_check_compilation
  • For error stack traces → use debug module's debug_get_stack_trace
  • For console settings (collapse, clear-on-play) → console_set_collapse / console_set_clear_on_play (this module)

Skills Overview

Skill Description
console_start_capture Start capturing logs
console_stop_capture Stop capturing logs
console_get_logs Get captured logs
console_clear Clear console
console_log Write log message
console_set_pause_on_error Enable or disable Error Pause in Play mode
console_export Export console logs to a file
console_get_stats Get log statistics (count by type)
console_set_collapse Set console log collapse mode
console_set_clear_on_play Set clear on play mode

Skills

console_start_capture

Start capturing Unity console logs.

No parameters.

console_stop_capture

Stop capturing logs.

No parameters.

console_get_logs

Get Unity Console logs (reads existing console history directly; if console_start_capture is active, returns captured buffer with timestamps instead).

Parameter Type Required Default Description
type string No "All" All / Error / Warning / Log
filter string No null Substring content filter
limit int No 100 Max results

Returns (two shapes depending on mode):

  • Capture mode (console_start_capture active): {count, logs: [{type, message, time}], source: "capture"}time formatted HH:mm:ss.fff
  • Direct mode (default, reads Unity Console history): {count, logs: [{type, message, file, line}], source: "console"}type is Error / Warning / Log, file / line from Unity's LogEntry

console_clear

Clear the Unity console.

No parameters.

console_log

Write a custom log message.

Parameter Type Required Default Description
message string Yes - Log message
type string No "Log" Log/Warning/Error

console_set_pause_on_error

Enable or disable Error Pause in Play mode.

Parameter Type Required Default Description
enabled bool No true Enable or disable error pause

Returns: { success, enabled }

console_export

Export console logs to a file. Uses captured buffer when console_start_capture is active; otherwise reads directly from Unity Console history (no setup needed).

Parameter Type Required Default Description
savePath string No "Assets/console_log.txt" File path to save logs

Returns: { success, path, count, source }

console_get_stats

Get log statistics (count by type). Uses captured buffer when console_start_capture is active; otherwise reads directly from Unity Console history.

No parameters.

Returns (two shapes depending on mode):

  • Capture mode (buffer present, i.e. console_start_capture was called or buffer is non-empty): {success, total, source: "capture", logs, warnings, errors, exceptions, asserts}
  • Direct mode (no capture buffer, reads Unity Console history): {success, total, source: "console", logs, warnings, errors}exceptions / asserts are not reported in direct mode (folded into errors)

console_set_collapse

Set console log collapse mode.

Parameter Type Required Default Description
enabled bool Yes - Enable or disable collapse mode

Returns: { success, setting, enabled }

console_set_clear_on_play

Set clear on play mode.

Parameter Type Required Default Description
enabled bool Yes - Enable or disable clear on play

Returns: { success, setting, enabled }


Example Usage

import unity_skills

# Start capturing logs before play mode
unity_skills.call_skill("console_start_capture")

# Enter play mode
unity_skills.call_skill("editor_play")
# ... gameplay generates logs ...
unity_skills.call_skill("editor_stop")

# Get all captured logs
logs = unity_skills.call_skill("console_get_logs")
for log in logs['logs']:
    print(f"[{log['type']}] {log['message']}")

# Get only errors
errors = unity_skills.call_skill("console_get_logs", type="Error")
if errors['count'] > 0:
    print(f"Found {errors['count']} errors!")

# Write custom log
unity_skills.call_skill("console_log",
    message="AI Agent: Task completed",
    type="Log"
)

# Write warning
unity_skills.call_skill("console_log",
    message="AI Agent: Performance issue detected",
    type="Warning"
)

# Clear and stop
unity_skills.call_skill("console_clear")
unity_skills.call_skill("console_stop_capture")

Best Practices

  1. Start capture before play mode for runtime logs
  2. Filter by Error to quickly find problems
  3. Use custom logs to mark AI agent actions
  4. Clear console before starting new capture session
  5. Stop capture when done to free resources

Exact Signatures

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

用于Unity编辑器调试与诊断。支持读取控制台错误、强制重新编译、获取堆栈及系统信息。适用于排查编译失败、检查报错或收集系统状态,包含只读与安全执行模式说明。
诊断编译失败 检查改动后的报错 强制重新编译脚本 收集系统或内存诊断信息 用户询问'为什么报错'或'编译状态'
SkillsForUnity/unity-skills~/skills/debug/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-debug -g -y
SKILL.md
Frontmatter
{
    "name": "unity-debug",
    "description": "Inspect debug, diagnostics and compile state — read console errors, force recompile, get stack traces, and list system\/memory info. Use when diagnosing compile failures, checking errors after a change, forcing recompilation, or gathering system diagnostics, even if the user just says \"为什么报错\" or \"编译状态\". 检查调试、诊断与编译状态(读取控制台错误、强制重新编译、获取堆栈、列出系统\/内存信息);当用户要诊断编译失败、改动后检查报错、强制重编或收集系统诊断时使用。"
}

Debug Skills

Debug utilities for error checking and diagnostics.

Operating Mode

  • Approval: 只读类 skill(unity_diagnose / debug_get_errors / debug_get_logs / debug_check_compilation / debug_get_system_info / debug_get_stack_trace / debug_get_assembly_info / debug_get_defines / debug_get_memory_info,全部标 SkillMode.SemiAuto)直接执行;debug_force_recompile / debug_set_defines 默认 SkillMode.FullAuto,需用户 grant,grant 后一步执行返结果。
  • Auto / Bypass: 直接执行。
  • 本模块含 Reload 类高危 skilldebug_force_recompile(标 MayTriggerReload=true)必然触发 Domain Reload;debug_set_defines 修改 PlayerSettings 的 scripting defines 也会触发重编译 —— 这些 skill 在 Approval / Auto 下会被 IsForbiddenInSemi 自动拦截,仅 Bypass 或 Allowlist 命中可执行,调用后服务端会短暂不可用。

DO NOT (common hallucinations):

  • debug_compile / debug_recompile do not exist → use debug_force_recompile
  • debug_run does not exist → use editor_play (editor module)
  • debug_clear does not exist → use console_clear (console module)
  • debug_set_defines triggers Domain Reload — server will be temporarily unavailable

Routing:

  • For runtime console logs → use console module's console_get_logs / console_start_capture
  • For play mode control → use editor module
  • For script compile feedback → use script module's script_get_compile_feedback

Skills

unity_diagnose

Aggregated Editor health snapshot — call this FIRST when triaging problems. Combines console errors, compile state, recent workflow tasks, recent jobs, and server stats in a single response. Avoids chaining 4-5 individual skills.

Parameters:

  • errorLimit (int, optional, default 20, range 1-200): Max console entries to return.
  • includeWarnings (bool, optional, default true): Include warnings (false = errors only).
  • includeRecentJobs (bool, optional, default true): Include the 10 most recent async jobs.

Returns: { summary: { healthy, consoleErrorCount, consoleWarningCount, isCompiling, serverRunning, hint }, compile, console, workflow, server, recentJobs }

debug_get_logs

Get console logs filtered by type and content. Parameters:

  • type (string, optional): Filter by type (Error/Warning/Log). Default: Error.
  • filter (string, optional): Filter by content.
  • limit (int, optional): Max entries. Default: 50.

debug_get_errors

Get only active errors and exceptions from console. Parameters:

  • limit (int, optional): Max entries. Default: 50.

debug_check_compilation

Check if there are any compilation errors. Parameters: None.

debug_force_recompile

Force Unity to recompile all scripts. Parameters: None.

debug_get_system_info

Get system and Unity environment information. Parameters: None.

debug_get_stack_trace

Get stack trace for a log entry by index.

Parameter Type Required Default Description
entryIndex int Yes - Index of the log entry to retrieve stack trace for

Returns: { index, message, stackTrace }

debug_get_assembly_info

Get project assembly information.

Parameters: None.

Returns: { success, count, assemblies }

debug_get_defines

Get scripting define symbols for current platform.

Parameters: None.

Returns: { success, buildTargetGroup, defines }

debug_set_defines

Set scripting define symbols for current platform.

Parameter Type Required Default Description
defines string Yes - Scripting define symbols to set

Returns: { success, buildTargetGroup, defines, serverAvailability }

debug_get_memory_info

Get memory usage information.

Parameters: None.

Returns: { success, totalAllocatedMB, totalReservedMB, totalUnusedReservedMB, monoUsedSizeMB, monoHeapSizeMB }


Exact Signatures

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

用于在Unity URP中创建、配置和管理Decal Projector贴花及渲染器特性。支持查询、批量修改属性及确保渲染特性启用,适用于添加或编辑贴花场景。
用户要在 URP 中添加贴花 配置 Decal Projector 启用 Decal Renderer Feature 用户说 '贴花' 或 'decal'
SkillsForUnity/unity-skills~/skills/decal/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-decal -g -y
SKILL.md
Frontmatter
{
    "name": "unity-decal",
    "description": "Create and configure URP Decal Projectors plus DecalRendererFeature setup — project decals onto surfaces and wire the renderer feature. Use when adding decals in URP, configuring a Decal Projector, or enabling the Decal Renderer Feature, even if the user just says \"贴花\" or \"decal\". 创建与配置 URP Decal Projector 并设置 DecalRendererFeature(将贴花投射到表面、接入渲染器特性);当用户要在 URP 中添加贴花、配置 Decal Projector 或启用 Decal Renderer Feature 时使用。"
}

Decal Skills

URP Decal Projector creation and configuration (URP only; HDRP decal APIs are not covered here).

Operating Mode

  • Query skills (decal_get_info, decal_find_all) are SkillMode.SemiAuto — they run in all three modes without grant.
  • Mutating skills (decal_create, decal_set_properties, decal_set_properties_batch, decal_ensure_renderer_feature) are SkillMode.FullAuto — under Approval they need user grant (grant triggers one server-side execute returning the result); under Auto / Bypass they execute directly.
  • decal_delete carries SkillOperation.Delete and is auto-forbidden in Approval / Auto modes (NeverInSemi). Only Bypass or the user-managed Allowlist can run it.

URP Package Stub

This module is compiled against com.unity.render-pipelines.universal (URP). When URP is not installed, every skill returns a stub { error: "Universal Render Pipeline package … is not installed." } (RenderPipelineSkillsCommon.NoURP()). The stub is a diagnostic payload, not a permission denial — it does not require grant and is not treated as NeverInSemi.

Guardrails

Routing:

  • For renderer feature management in general: urp
  • For DecalProjector scene operations: this module

Runtime-first rules:

  • Call decal_ensure_renderer_feature before assuming the current URP renderer is decal-ready
  • Use decal_get_info / decal_find_all to discover real projector state before editing
  • decal_set_properties_batch expects items to be a JSON array string
  • This module targets the URP Decal workflow first; do not assume HDRP decal APIs are covered here

Skills

decal_create

Create a Decal Projector.

decal_get_info

Inspect a Decal Projector.

decal_set_properties

Modify Decal Projector properties.

decal_find_all

List Decal Projectors in the scene.

decal_delete

Delete a Decal Projector GameObject.

decal_set_properties_batch

Batch-edit Decal Projectors.

decal_ensure_renderer_feature

Ensure the target URP renderer has a DecalRendererFeature.


Exact Signatures

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

自动化DOTween Free/Pro的编辑器期配置、诊断与模块发现。支持探测安装状态、校验设置、列出模块,以及批量添加和调校DOTweenAnimation组件(需Pro版)。适用于项目接入、环境验证及动画组件配置场景。
用户需要在项目中接入DOTween 校验DOTween的安装或模块状态 配置DOTweenAnimation组件 提及DOTween或配置动画插件
SkillsForUnity/unity-skills~/skills/dotween/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-dotween -g -y
SKILL.md
Frontmatter
{
    "name": "unity-dotween",
    "description": "Automate DOTween Free\/Pro at editor time — probe\/validate\/configure DOTween settings, list modules\/shortcuts, and add\/batch\/stagger\/tune DOTweenAnimation components. Use when setting up DOTween in a project, validating its install\/modules, or configuring DOTweenAnimation components in the editor, even if the user just says \"DOTween\" or \"配置动画插件\". 在编辑器期自动化 DOTween Free\/Pro(探测\/校验\/配置 DOTween 设置、列出模块\/快捷方法、添加\/批量\/错峰\/调校 DOTweenAnimation 组件);当用户要在项目中接入 DOTween、校验其安装\/模块、或配置 DOTweenAnimation 组件时使用。"
}

DOTween Skills

DOTween Free/Pro support for project diagnostics, settings, module/API discovery, and runtime script generation. DOTween Pro-only DOTweenAnimation editor-time configuration remains available through dotween_pro_* skills.

Guardrails

Operating Mode (v1.9 three-tier):

  • Approval (default): query/diagnostic skills (dotween_get_status, dotween_settings_get, dotween_settings_find, dotween_settings_validate, dotween_list_modules, dotween_list_shortcuts, dotween_pro_get_animation, dotween_pro_list_animations) run directly. Mutators (settings configure, script generators, all other dotween_pro_*) are FullAuto — on MODE_RESTRICTED, run the grant protocol.
  • Auto / Bypass: SemiAuto and FullAuto run directly.
  • Auto-forbidden in this module: dotween_generate_tween_script, dotween_generate_sequence_script, dotween_generate_lifetime_script (all carry MayTriggerReload = true, RiskLevel = "high" because writing a new .cs triggers script compilation + Domain Reload). Reachable only under Bypass mode or via a user-managed Allowlist entry; the grant flow returns MODE_FORBIDDEN.
  • When DOTween Free/Pro is missing, the DOTweenPresenceDetector does not add the DOTWEEN / DOTWEEN_PRO defines, so most skills return a "not installed" diagnostic instead of executing. The dotween_pro_* family additionally requires Pro because DG.Tweening.DOTweenAnimation is Pro-only.

Prerequisites:

  • DOTween Free or Pro must be installed. DOTweenPresenceDetector adds DOTWEEN / DOTWEEN_PRO defines automatically after install.
  • Free skills work with DOTween Free and Pro: status, settings read/find/validate/configure, module/shortcut listing, runtime script generation.
  • dotween_pro_* skills require DOTween Pro because DG.Tweening.DOTweenAnimation is Pro-only.

Do not confuse Free with Pro:

  • Free skills do not create or emulate DOTweenAnimation components.
  • Runtime tween generation creates .cs scripts only; it does not auto-attach scripts to scene objects because Unity may need a Domain Reload first.
  • For source-level runtime API design rules, load dotween-design.

Free Skills

Diagnostics and settings

  • dotween_get_status — report DOTween/Pro install status, DOTweenSettings.asset path, and visible module count.
  • dotween_settings_find — list project assets named DOTweenSettings.
  • dotween_settings_get — read common DOTweenSettings.asset fields.
  • dotween_settings_validate — report missing settings, duplicate settings, invalid capacities, and notable SafeMode warnings.
  • dotween_settings_configure — edit Resources/DOTweenSettings.asset; parameters: defaultEaseType?, defaultAutoKill?, defaultLoopType?, safeMode?, logBehaviour?, tweenersCapacity?, sequencesCapacity?.

API discovery

  • dotween_list_modules — list loaded DG.Tweening.DOTweenModule*, ShortcutExtensions, TweenExtensions, and TweenSettingsExtensions types. Optional: includeMethods=false, methodLimit=20.
  • dotween_list_shortcuts — list public extension methods. Optional filters: targetType, methodPrefix, limit=100.

Runtime script generation

All generation skills require className, default folder=Assets/Scripts/DOTween, optional namespaceName, and never overwrite existing files.

  • dotween_generate_tween_script — create one runtime tween MonoBehaviour.
  • dotween_generate_sequence_script — create one runtime Sequence MonoBehaviour; optional stepsJson array of {op:"Append|Join|AppendInterval", tweenKind, duration}.
  • dotween_generate_lifetime_script — create a lifecycle-safe wrapper with SetLink(gameObject) by default and KillTween() on disable/destroy.

Common parameters: targetKind=Transform, tweenKind=DOMove, duration=1, ease=OutQuad, loops=1, autoPlay=true, useSetLink=true.

Supported v1 targetKind / tweenKind pairs:

  • Transform: DOMove, DOLocalMove, DORotate, DOLocalRotate, DOScale, DOPunchPosition, DOShakePosition
  • RectTransform: DOAnchorPos, DOSizeDelta
  • CanvasGroup: DOFade
  • Graphic / Image: DOColor, DOFade
  • Generic: DOTween.To

Example:

dotween_generate_tween_script className=HeroPanelIntro targetKind=RectTransform tweenKind=DOAnchorPos duration=0.35 ease=OutBack

Sequence example:

dotween_generate_sequence_script className=ButtonPop targetKind=Transform stepsJson='[
  {"op":"Append","tweenKind":"DOScale","duration":0.12},
  {"op":"AppendInterval","duration":0.05},
  {"op":"Join","tweenKind":"DOPunchPosition","duration":0.25}
]'

Pro Skills

dotween_pro_add_animation

Add one DOTweenAnimation to a GameObject and configure all core fields. Parameters: target / animationType / endValueV3? / endValueFloat? / endValueColor? / endValueV2? / endValueString? / endValueRect? / duration=1 / ease="OutQuad" / loops=1 / loopType="Yoyo" / delay=0 / isRelative=false / isFrom=false / autoPlay=true / autoKill=true / id?

dotween_pro_batch_add_animation

Add the same animation to multiple GameObjects. Parameters: targetsJson (JSON string array) + all params of dotween_pro_add_animation.

dotween_pro_stagger_animations

Batch-add with incrementing delay — UI cascade entrance pattern. Parameters: targetsJson / animationType / endValueV3? / endValueFloat? / endValueColor? / endValueV2? / duration=0.5 / ease="OutBack" / loops=1 / loopType="Yoyo" / baseDelay=0 / staggerDelay=0.1 / isFrom=true / autoPlay=true / autoKill=true

dotween_pro_set_duration

Change duration on an existing DOTweenAnimation. Parameters: target, animationIndex=0, duration.

dotween_pro_set_ease

Change ease on an existing DOTweenAnimation. Parameters: target, animationIndex=0, ease="OutQuad", easeCurveJson?.

dotween_pro_set_loops

Change loops count and optional loopType. Parameters: target, animationIndex=0, loops, loopType?.

dotween_pro_set_animation_field

Generic setter for DOTweenAnimation fields except duration/ease/easeType/easeCurve/loops/loopType; use dedicated skills for those.

dotween_pro_get_animation

Read all serialized fields of one DOTweenAnimation. Parameters: target, animationIndex=0.

dotween_pro_list_animations

List DOTweenAnimation components on a target or across the scene. Parameters: target?, recursive=false.

dotween_pro_copy_animation

Copy all fields from sourceTarget[sourceIndex] to a new DOTweenAnimation on destTarget.

dotween_pro_remove_animation

Remove one DOTweenAnimation component by index.

animationType → endValue mapping

animationType Required parameter
Move / LocalMove / Rotate / LocalRotate / Scale / PunchPosition / PunchRotation / PunchScale / ShakePosition / ShakeRotation / ShakeScale / AnchorPos3D endValueV3 ("1,2,3" or "[1,2,3]")
AnchorPos / UIWidthHeight endValueV2 ("1,2")
Fade / FillAmount / CameraOrthoSize / CameraFieldOfView / Value endValueFloat
Color / CameraBackgroundColor endValueColor ("#FF8800" or "1,0.5,0,1")
Text endValueString
UIRect endValueRect ("x,y,width,height")

Exact Signatures

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

控制Unity编辑器状态,支持进入/退出/暂停Play模式、选中对象、撤销重做及执行菜单命令。需严格区分读写权限,注意高危操作在特定模式下受限,避免使用不存在的命令名。
用户要求进入或退出Play Mode 需要选中或获取当前选中的游戏对象 执行撤销或重做操作 通过菜单路径执行编辑器命令
SkillsForUnity/unity-skills~/skills/editor/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-editor -g -y
SKILL.md
Frontmatter
{
    "name": "unity-editor",
    "description": "Control the Unity Editor — enter\/exit\/pause play mode, select objects, undo\/redo, and execute menu items. Use when driving Editor state, entering or leaving play mode, changing the selection, or running menu commands, even if the user just says \"进入运行\" or \"选中物体\". 控制 Unity 编辑器(进入\/退出\/暂停 play mode、选中对象、撤销\/重做、执行菜单项);当用户要操控编辑器状态、进出 play mode、改变选中、或运行菜单命令时使用。"
}

Unity Editor Skills

Control the Unity Editor itself - enter play mode, manage selection, undo/redo, and execute menu items.

Operating Mode

  • Approval:本模块 Mixed —— editor_get_selection / editor_get_context / editor_get_state / editor_get_tags / editor_get_layersSkillMode.SemiAuto,可直接执行;其余 editor_select / editor_undo / editor_redo / editor_execute_menu 默认 FullAuto,Approval 模式下需 grant。
  • Auto / Bypass:FullAuto 直接执行。
  • 含 NeverInSemi 高危 skilleditor_play / editor_stop / editor_pause(标 MayEnterPlayMode = true,进出 PlayMode 会丢失运行时改动)。这些在 Approval/Auto 下返 MODE_FORBIDDEN,仅 Bypass 或 Allowlist 命中可调。

DO NOT (common hallucinations):

  • editor_run does not exist → use editor_play to enter play mode
  • editor_compile / editor_recompile do not exist → use debug_force_recompile
  • editor_save does not exist → use editor_execute_menu with menuPath "File/Save"
  • editor_execute_menu requires exact menu path — typos cause silent failure

Routing:

  • For compilation check → use debug module's debug_check_compilation
  • For console errors → use debug module's debug_get_errors
  • For scene save → scene_save (scene module) or editor_execute_menu menuPath="File/Save"

Skills Overview

Skill Description
editor_play Enter play mode
editor_stop Exit play mode
editor_pause Toggle pause
editor_select Select GameObject
editor_get_selection Get selected objects
editor_get_context Get full editor context (selection, assets, scene)
editor_undo Undo last action
editor_redo Redo last action
editor_get_state Get editor state
editor_execute_menu Execute menu item
editor_get_tags Get all tags
editor_get_layers Get all layers
console_set_pause_on_error Pause play mode on error (console module)

Skills

editor_play

Enter play mode. Warning: any unsaved scene changes made during Play mode will be lost when exiting.

Returns: {success, mode, jobId}mode="playing", jobId returned from AsyncJobService so callers can poll entering_play_mode completion.

editor_stop

Exit play mode.

Returns: {success, mode}mode="stopped".

editor_pause

Toggle pause state.

Returns: {success, paused}paused is the new boolean state.

editor_select

Select a GameObject.

Parameter Type Required Description
name string No* Object name
instanceId int No* Instance ID (preferred)
path string No* Object path

*One identifier required

editor_get_selection

Get currently selected objects.

Returns: {count, objects: [{name, instanceId}]}

editor_get_context

Get full editor context including selection, assets, and scene info.

Parameter Type Required Default Description
includeComponents bool No false Include component list
includeChildren bool No false Include children info

Returns:

  • selectedGameObjects: Objects in Hierarchy (instanceId, path, tag, layer)
  • selectedAssets: Assets in Project window (GUID, path, type, isFolder)
  • activeScene: Current scene info (name, path, isDirty)
  • focusedWindow: Name of focused editor window
  • isPlaying, isCompiling: Editor state

editor_undo

Undo the last action.

editor_redo

Redo the last undone action.

editor_get_state

Get current editor state.

Returns: {isPlaying, isPaused, isCompiling, timeSinceStartup, unityVersion, platform}

editor_execute_menu

Execute a menu command.

Parameter Type Required Description
menuPath string Yes Menu item path

Common Menu Paths:

Menu Path Action
File/Save Save current scene
File/Build Settings... Open build settings
Edit/Play Toggle play mode
GameObject/Create Empty Create empty object
Window/General/Console Open console
Assets/Refresh Refresh assets

editor_get_tags

Get all available tags.

Returns: {tags: [string]}

editor_get_layers

Get all available layers.

Returns: {layers: [{index, name}]}

Pause On Error

Pause-on-error is provided by the console module, not the editor module.

Use console_set_pause_on_error from console/SKILL.md.


Example Usage

import unity_skills

# Check editor state before operations
state = unity_skills.call_skill("editor_get_state")
if state['isCompiling']:
    print("Wait for compilation to finish")

# Get full context (useful for understanding current state)
context = unity_skills.call_skill("editor_get_context", includeComponents=True)
for obj in context['selectedGameObjects']:
    print(f"Selected: {obj['name']} (ID: {obj['instanceId']})")

# Select and operate on object
unity_skills.call_skill("editor_select", name="Player")
selection = unity_skills.call_skill("editor_get_selection")

# Safe experimentation with undo
unity_skills.call_skill("gameobject_delete", name="TestObject")
unity_skills.call_skill("editor_undo")  # Restore if needed

# Execute menu command
unity_skills.call_skill("editor_execute_menu", menuPath="File/Save")

Best Practices

  1. Check editor state before play mode operations
  2. Don't modify scene during play mode (changes lost)
  3. Use undo for safe experimentation
  4. Use editor_get_context to get instanceId for batch operations
  5. Menu commands must match exact paths

Exact Signatures

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

用于在Unity编辑器期配置和修改UnityEvent的持久化监听器。支持查询、添加、移除、清空及触发事件回调,适用于按钮点击或组件间通信的场景绑定。
事件绑定 按钮点击 Inspector挂接UnityEvent 连接触发器回调
SkillsForUnity/unity-skills~/skills/event/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-event -g -y
SKILL.md
Frontmatter
{
    "name": "unity-event",
    "description": "Wire UnityEvent persistent listeners at editor time — add, remove, and configure serialized event callbacks on components. Use when hooking up UnityEvents in the Inspector, wiring button or trigger callbacks, or scripting persistent listener setup, even if the user just says \"事件绑定\" or \"按钮点击\". 在编辑器期连接 UnityEvent 持久化监听器(在组件上添加、移除、配置序列化的事件回调);当用户要在 Inspector 里挂接 UnityEvent、连接按钮或触发器回调、或脚本化设置持久监听时使用。"
}

Event Skills

Inspect and modify persistent listeners on UnityEvents (e.g. Button.onClick, Toggle.onValueChanged) — the same listeners you see in the Inspector's event drop slots.

Operating Mode

  • Approval:查询类 skill(event_get_listeners / event_list_events / event_get_listener_count,源码标 SkillMode.SemiAuto)直接执行;其余变更/调用类(event_add_listener / event_set_listener / event_set_listener_state / event_invoke / event_add_listener_batch / event_copy_listeners,标 SkillMode.FullAuto)需用户 grant,grant 后服务端一步执行返结果。
  • Auto / Bypass:未被禁列表拦截的 skill 直接执行。
  • 本模块含 Delete 类 skillevent_remove_listenerevent_clear_listeners 标记为 SkillOperation.Delete,被 IsForbiddenInSemi 静态拦截 —— 仅 Bypass 模式或加入 Allowlist 才能调用。
  • event_invoke 只在 Play mode / runtime 下有效;编辑器空跑时仅触发 EditorAndRuntime 监听。event_add_listener 等写入的是 persistent listener(序列化到 prefab/scene),即可在编辑器时配置。

DO NOT (common hallucinations):

  • event_create / event_trigger do not exist → UnityEvents are declared in component source code; this module only wires listeners
  • event_subscribe does not exist → use event_add_listener
  • event_remove does not exist → use event_remove_listener
  • event_add_listener requires exact component type and method name on the target

Routing:

  • For XR interaction events → use xr module's xr_add_interaction_event
  • For C# event code → write via script module

Skills

event_get_listeners

Get persistent listeners of a UnityEvent. Parameters:

  • name / instanceId / path: Target GameObject locator.
  • componentName (string): Component name.
  • eventName (string): Event field name (e.g. "onClick").

event_add_listener

Add a persistent listener to a UnityEvent (Editor time). Parameters:

  • name / instanceId / path, componentName, eventName: Target event.
  • targetObjectName, targetComponentName, methodName: Method to call.
  • mode (string, optional): "RuntimeOnly", "EditorAndRuntime", "Off".
  • argType (string, optional): "void", "int", "float", "string", "bool".
  • floatArg, intArg, stringArg, boolArg: Argument value if needed.

event_remove_listener

Remove a persistent listener by index. Parameters:

  • name / instanceId / path, componentName, eventName: Target event.
  • index (int): Listener index.

event_invoke

Invoke a UnityEvent explicitly (Runtime only). Parameters:

  • name / instanceId / path, componentName, eventName: Target event.

event_clear_listeners

Remove all persistent listeners from a UnityEvent.

Parameter Type Required Default Description
name string No null GameObject name
instanceId int No 0 GameObject instance ID
path string No null GameObject hierarchy path
componentName string No null Component name
eventName string No null Event field name (e.g. "onClick")

Returns: { success, removed }

event_set_listener_state

Set a listener's call state (Off, RuntimeOnly, EditorAndRuntime).

Parameter Type Required Default Description
name string No null GameObject name
instanceId int No 0 GameObject instance ID
path string No null GameObject hierarchy path
componentName string No null Component name
eventName string No null Event field name
index int No 0 Listener index
state string No null Call state: "Off", "RuntimeOnly", or "EditorAndRuntime"

Returns: { success, index, state }

event_set_listener

Replace a persistent listener at a specific index.

Parameter Type Required Default Description
name string No null GameObject name
instanceId int No 0 GameObject instance ID
path string No null GameObject hierarchy path
componentName string No null Source component name
eventName string No null Event field name
index int No 0 Listener index to replace
targetName string No null Target GameObject name
targetInstanceId int No 0 Target GameObject instance ID
targetPath string No null Target hierarchy path
targetComponentName string No null Target component name, or GameObject
methodName string No null Public method or set_PropertyName
mode string No RuntimeOnly Off, RuntimeOnly, or EditorAndRuntime
argType string No void void, int, float, string, bool, object
floatArg float No 0 Static float argument
intArg int No 0 Static int argument
stringArg string No null Static string argument
boolArg bool No false Static bool argument
objectReferenceName string No null Scene object argument name
objectReferenceInstanceId int No 0 Scene object argument instance ID
objectReferencePath string No null Scene object argument path
objectAssetPath string No null Project asset argument path
objectType string No null Object/component type for object argument

Returns: { success, index, target, targetType, method, state, argType }

event_list_events

List all UnityEvent fields on a component.

Parameter Type Required Default Description
name string No null GameObject name
instanceId int No 0 GameObject instance ID
path string No null GameObject hierarchy path
componentName string No null Component name

Returns: { success, component, count, events }

event_add_listener_batch

Add multiple listeners at once. items: JSON array of {targetObjectName, targetComponentName, methodName}.

Parameter Type Required Default Description
name string No null GameObject name
instanceId int No 0 GameObject instance ID
path string No null GameObject hierarchy path
componentName string No null Component name
eventName string No null Event field name
items string No null JSON array of {targetObjectName, targetComponentName, methodName}

Returns: { success, added, total }

event_copy_listeners

Copy listeners from one event to another.

Parameter Type Required Default Description
sourceObject string Yes - Source GameObject name
sourceComponent string Yes - Source component name
sourceEvent string Yes - Source event field name
targetObject string Yes - Target GameObject name
targetComponent string Yes - Target component name
targetEvent string Yes - Target event field name

Returns: { success, copied }

event_get_listener_count

Get the number of persistent listeners on a UnityEvent.

Parameter Type Required Default Description
name string No null GameObject name
instanceId int No 0 GameObject instance ID
path string No null GameObject hierarchy path
componentName string No null Component name
eventName string No null Event field name

Returns: { success, count }


Exact Signatures

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

用于Unity场景中GameObject的创建、删除、移动、旋转、缩放、父子关系调整、查找及批量编辑。支持Transform操作与层级管理,强调批量处理以提升效率,并明确路由规则避免幻觉调用。
用户需要创建或删除游戏物体 用户要求移动、旋转或缩放场景中的对象 用户希望调整物体的父子层级关系 用户需要根据名称或标签查找物体
SkillsForUnity/unity-skills~/skills/gameobject/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-gameobject -g -y
SKILL.md
Frontmatter
{
    "name": "unity-gameobject",
    "description": "Create and manipulate GameObjects — create, delete, move, rotate, scale, parent, find, rename, batch-edit. Use when building or restructuring a scene hierarchy, spawning or removing objects, or adjusting transforms, even if the user doesn't say \"GameObject\". 创建与操控 GameObject(增删、移动、旋转、缩放、父子、查找、重命名、批量编辑);当用户要搭建或调整场景层级、新建或删除物体、修改 Transform 时使用。"
}

Unity GameObject Skills

BATCH-FIRST: Use *_batch skills when operating on 2+ objects to reduce API calls from N to 1.

Operating Mode

  • Approval:本模块多为 SkillMode.FullAuto,调用需用户 grant;grant 后服务端一步执行并返结果。
  • Auto / Bypass:直接执行。
  • 含 NeverInSemi 高危 skillgameobject_delete / gameobject_delete_batch(标记 Operation.Delete)。这些在 Approval/Auto 下返 MODE_FORBIDDEN,仅 Bypass 或用户 Allowlist 命中可调。

DO NOT (common hallucinations):

  • gameobject_move / gameobject_rotate / gameobject_set_scale do not exist → use gameobject_set_transform (handles position, rotation, and scale together)
  • gameobject_set_position does not exist → use gameobject_set_transform with posX/posY/posZ
  • gameobject_add_component does not exist → use component_add (component module)
  • gameobject_get_transform does not exist → use gameobject_get_info (returns position/rotation/scale)

Routing:

  • To add/remove components → use component module
  • To set material/color → use material module
  • To search objects by name/tag/component → gameobject_find (this module) or scene_find_objects (scene module, SkillMode.SemiAuto)

Object Targeting: All single-object skills accept entityId (string, Unity 6000.4+ preferred — returned by all object skills), name (string), instanceId (int, Unity < 6000.4 preferred), and path (string, hierarchy path like "Parent/Child"). Provide at least one. Priority: entityId > instanceId > path > name. On Unity 6000.4+ use entityIdinstanceId is reported as 0. When only name is shown in a parameter table, entityId, instanceId, and path are also accepted.

Skills Overview

Single Object Batch Version Use Batch When
gameobject_create gameobject_create_batch Creating 2+ objects
gameobject_delete gameobject_delete_batch Deleting 2+ objects
gameobject_duplicate gameobject_duplicate_batch Duplicating 2+ objects
gameobject_rename gameobject_rename_batch Renaming 2+ objects
gameobject_set_transform gameobject_set_transform_batch Moving 2+ objects
gameobject_set_active gameobject_set_active_batch Toggling 2+ objects
gameobject_set_parent gameobject_set_parent_batch Parenting 2+ objects
- gameobject_set_layer_batch Setting layer on 2+ objects
- gameobject_set_tag_batch Setting tag on 2+ objects

Query Skills (no batch needed):

  • gameobject_find - Find objects by name/tag/layer/component
  • gameobject_get_info - Get detailed object information

Single-Object Skills

gameobject_create

Create a new GameObject (primitive or empty).

Parameter Type Required Default Description
name string Yes - Object name
primitiveType string No null Cube/Sphere/Capsule/Cylinder/Plane/Quad (null=Empty)
x, y, z float No 0 Local position (relative to parent if set)
parentEntityId string No null Parent entityId (Unity 6000.4+, preferred)
parentName string No null Parent object name
parentInstanceId int No 0 Parent instance ID
parentPath string No null Parent hierarchy path

Returns: {success, name, entityId, instanceId, path, parent, position}

gameobject_delete

Delete a GameObject.

Parameter Type Required Description
entityId string No* Entity ID (Unity 6000.4+, preferred)
name string No* Object name
instanceId int No* Instance ID
path string No* Hierarchy path

*At least one identifier required

gameobject_duplicate

Duplicate a GameObject.

Parameter Type Required Description
entityId string No* Entity ID (Unity 6000.4+, preferred)
name string No* Object name
instanceId int No* Instance ID
path string No* Hierarchy path

Returns: {originalName, copyName, copyEntityId, copyInstanceId, copyPath}

gameobject_rename

Rename a GameObject.

Parameter Type Required Description
entityId string No* Entity ID (Unity 6000.4+, preferred)
name string No* Current object name
instanceId int No* Instance ID
newName string Yes New name

Returns: {success, oldName, newName, entityId, instanceId}

gameobject_find

Find GameObjects matching criteria.

Parameter Type Required Default Description
name string No null Name filter
tag string No null Tag filter
layer string No null Layer filter
component string No null Component type filter
useRegex bool No false Use regex for name
limit int No 50 Max results

Returns: {count, objects: [{name, entityId, instanceId, path, tag, layer, position}]}

gameobject_get_info

Get detailed GameObject information.

Parameter Type Required Description
entityId string No* Entity ID (Unity 6000.4+, preferred)
name string No* Object name
instanceId int No* Instance ID
path string No* Hierarchy path

Returns: {name, entityId, instanceId, path, tag, layer, active, position, rotation, scale, parent, parentPath, childCount, children: [{name, entityId, instanceId, path}], components}

gameobject_set_transform

Set position, rotation, and/or scale. Supports world / local / RectTransform spaces.

Parameter Type Required Description
entityId string No* Entity ID (Unity 6000.4+, preferred)
name string No* Object name
instanceId int No* Instance ID
path string No* Hierarchy path
posX/posY/posZ float No World position
rotX/rotY/rotZ float No World rotation (euler)
scaleX/scaleY/scaleZ float No Local scale
localPosX/localPosY/localPosZ float No Local position (relative to parent; works for both 3D and UI)
anchoredPosX/anchoredPosY float No RectTransform anchored position (UI only)
anchorMinX/anchorMinY float No RectTransform anchor min (0-1, UI only)
anchorMaxX/anchorMaxY float No RectTransform anchor max (0-1, UI only)
pivotX/pivotY float No RectTransform pivot (0-1, UI only)
sizeDeltaX/sizeDeltaY float No RectTransform size delta (UI only)
width/height float No Convenience aliases for sizeDeltaX/sizeDeltaY (UI only)

*At least one identifier required. RectTransform / anchored* / anchor* / pivot* / sizeDelta* / width / height only apply to UI elements; ignored on regular Transforms.

gameobject_set_parent

Set parent-child relationship.

Parameter Type Required Description
childEntityId string No* Child entity ID (Unity 6000.4+, preferred)
childName string No* Child object name
childInstanceId int No* Child instance ID
childPath string No* Child hierarchy path
parentEntityId string No* Parent entity ID (Unity 6000.4+, preferred)
parentName string No* Parent object name (empty string = unparent)
parentInstanceId int No* Parent instance ID
parentPath string No* Parent hierarchy path

*At least one child identifier required; omit all parent identifiers to unparent

Returns: {success, child, childEntityId, parent, parentEntityId, newPath}

gameobject_set_active

Enable or disable a GameObject.

Parameter Type Required Description
entityId string No* Entity ID (Unity 6000.4+, preferred)
name string No* Object name
instanceId int No* Instance ID
path string No* Hierarchy path
active bool Yes Enable state

*At least one identifier required

Returns: {success, name, entityId, active}


Batch Skills

gameobject_create_batch

Create multiple GameObjects in one call.

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

Item properties: name, primitiveType, x, y, z, rotX, rotY, rotZ, scaleX, scaleY, scaleZ, parentEntityId, parentName, parentInstanceId, parentPath

Returns: {success, totalItems, successCount, failCount, results: [{success, name, instanceId, path, position}]}

unity_skills.call_skill("gameobject_create_batch", items=[
    {"name": "Parent", "primitiveType": "Empty"},
    {"name": "Child1", "primitiveType": "Cube", "x": 0, "parentName": "Parent"},
    {"name": "Child2", "primitiveType": "Sphere", "x": 2, "parentName": "Parent"}
])

gameobject_delete_batch

Delete multiple GameObjects.

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

Returns: {success, totalItems, successCount, failCount, results: [{success, name}]}

# By names
unity_skills.call_skill("gameobject_delete_batch", items=["Cube1", "Cube2", "Cube3"])

# By instanceId (preferred for precision)
unity_skills.call_skill("gameobject_delete_batch", items=[
    {"instanceId": 12345},
    {"instanceId": 12346}
])

# By path
unity_skills.call_skill("gameobject_delete_batch", items=[
    {"path": "Environment/Cube1"},
    {"path": "Environment/Cube2"}
])

gameobject_duplicate_batch

Duplicate multiple GameObjects.

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

Returns: {success, totalItems, successCount, failCount, results: [{success, originalName, copyName, copyInstanceId, copyPath}]}

unity_skills.call_skill("gameobject_duplicate_batch", items=[
    {"instanceId": 12345},
    {"instanceId": 12346}
])

gameobject_rename_batch

Rename multiple GameObjects.

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

Returns: {success, totalItems, successCount, failCount, results: [{success, oldName, newName, instanceId}]}

unity_skills.call_skill("gameobject_rename_batch", items=[
    {"instanceId": 12345, "newName": "Enemy_01"},
    {"instanceId": 12346, "newName": "Enemy_02"}
])

gameobject_set_transform_batch

Set transforms for multiple objects.

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

Item properties (each item supports identifier + any subset of transform fields):

  • Identifier: entityId / name / instanceId / path (at least one required)
  • World: posX, posY, posZ, rotX, rotY, rotZ, scaleX, scaleY, scaleZ
  • Local: localPosX, localPosY, localPosZ
  • RectTransform (UI only): anchoredPosX, anchoredPosY, anchorMinX, anchorMinY, anchorMaxX, anchorMaxY, pivotX, pivotY, sizeDeltaX, sizeDeltaY, width, height

Returns: {success, totalItems, successCount, failCount, results: [{success, name, position, rotation, scale}]}

unity_skills.call_skill("gameobject_set_transform_batch", items=[
    {"name": "Cube1", "posX": 0, "posY": 1},
    {"instanceId": 12345, "posX": 2, "posY": 1},
    {"path": "Env/Cube3", "posX": 4, "posY": 1}
])

gameobject_set_active_batch

Toggle multiple objects. Each item supports identifier (entityId / name / instanceId / path) + active (bool).

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

Returns: {success, totalItems, successCount, failCount, results: [{success, name, active}]}

unity_skills.call_skill("gameobject_set_active_batch", items=[
    {"name": "Enemy1", "active": False},
    {"name": "Enemy2", "active": False}
])

gameobject_set_parent_batch

Parent multiple objects. Each item supports childEntityId/childName/childInstanceId/childPath and parentEntityId/parentName/parentInstanceId/parentPath.

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

Returns: {success, totalItems, successCount, failCount, results: [{success, child, parent}]}

unity_skills.call_skill("gameobject_set_parent_batch", items=[
    {"childName": "Wheel1", "parentName": "Car"},
    {"childInstanceId": 12345, "parentName": "Car"},
    {"childPath": "Wheels/Wheel3", "parentPath": "Vehicles/Car"}
])

gameobject_set_layer_batch

Set layer for multiple objects. Each item supports identifier (entityId / name / instanceId / path) + layer (string layer name) + optional recursive (bool, default false — propagates layer to children).

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

Returns: {success, totalItems, successCount, failCount, results: [{success, name, layer}]}

unity_skills.call_skill("gameobject_set_layer_batch", items=[
    {"name": "Enemy1", "layer": "Water"},
    {"name": "Enemy2", "layer": "Water"}
])

gameobject_set_tag_batch

Set tag for multiple objects. Each item supports identifier (entityId / name / instanceId / path) + tag (string tag name).

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

Returns: {success, totalItems, successCount, failCount, results: [{success, name, tag}]}

unity_skills.call_skill("gameobject_set_tag_batch", items=[
    {"name": "Enemy1", "tag": "Enemy"},
    {"name": "Enemy2", "tag": "Enemy"}
])

Minimal Example

import unity_skills

# GOOD: 3 API calls instead of 6
unity_skills.call_skill("gameobject_create_batch", items=[
    {"name": "Floor", "primitiveType": "Plane"},
    {"name": "Wall1", "primitiveType": "Cube"},
    {"name": "Wall2", "primitiveType": "Cube"}
])
unity_skills.call_skill("gameobject_set_transform_batch", items=[
    {"name": "Wall1", "posX": -5, "scaleY": 3},
    {"name": "Wall2", "posX": 5, "scaleY": 3}
])
unity_skills.call_skill("gameobject_set_tag_batch", items=[
    {"name": "Wall1", "tag": "Wall"},
    {"name": "Wall2", "tag": "Wall"}
])

Exact Signatures

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

管理Unity工程级GraphicsSettings与QualitySettings,支持URP/HDRP。涵盖读取渲染管线资产、质量档位及Shader剥离配置,并允许设置默认管线、调整画质等级及管理Always Included Shaders,用于全面配置项目图形与渲染性能。
用户要求配置或查看工程图形/画质设置 需要指定或切换SRP渲染管线资产 调整质量等级(Quality Levels) 提及'画质设置'或'渲染管线配置' 检查或修改Shader剥离(Stripping)配置
SkillsForUnity/unity-skills~/skills/graphics/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-graphics -g -y
SKILL.md
Frontmatter
{
    "name": "unity-graphics",
    "description": "Manage project-wide GraphicsSettings and QualitySettings for SRP — read and edit render pipeline assets, quality tiers, and graphics tier settings. Use when configuring project graphics\/quality settings, assigning an SRP asset, or adjusting quality levels, even if the user just says \"画质设置\" or \"渲染管线配置\". 管理面向 SRP 的工程级 GraphicsSettings 与 QualitySettings(读取与编辑渲染管线资产、质量档位、图形层级设置);当用户要配置工程图形\/画质设置、指定 SRP 资产或调整质量等级时使用。"
}

Graphics Skills

Project-wide graphics and quality settings (GraphicsSettings + QualitySettings) for Unity 2022.3+. Works in Built-in, URP and HDRP — does not depend on any SRP package being installed.

Operating Mode

  • Query skills (graphics_get_overview, graphics_get_quality_settings, graphics_get_render_pipeline_assets, graphics_list_always_included_shaders, graphics_get_shader_stripping) are SkillMode.SemiAuto — they run in all three modes without grant.
  • Mutating skills (graphics_set_quality_level, graphics_set_default_render_pipeline, graphics_set_quality_render_pipeline, graphics_add_always_included_shader, graphics_remove_always_included_shader, graphics_set_shader_stripping) are SkillMode.FullAuto — under Approval they need user grant (grant triggers one server-side execute returning the result); under Auto / Bypass they execute directly.
  • This module contains no Delete / PlayMode / Reload / high-risk skills (no NeverInSemi). graphics_remove_always_included_shader is a list mutation, not a SkillOperation.Delete.

Guardrails

Routing:

  • For current render pipeline detection only: project_get_render_pipeline
  • For SRP/quality configuration: use this module, not project_*

Skills

graphics_get_overview

Get a graphics/quality/render-pipeline summary.

graphics_get_quality_settings

List quality levels and their render pipeline overrides.

graphics_set_quality_level

Switch the active quality level.

graphics_get_render_pipeline_assets

List default/current/per-quality render pipeline assets.

graphics_set_default_render_pipeline

Set or clear the default SRP asset.

graphics_set_quality_render_pipeline

Assign or clear the SRP asset for a specific quality level.

graphics_list_always_included_shaders

List shaders in Always Included Shaders.

graphics_add_always_included_shader

Add a shader to Always Included Shaders.

graphics_remove_always_included_shader

Remove a shader from Always Included Shaders.

graphics_get_shader_stripping

Inspect shader stripping configuration in GraphicsSettings.

graphics_set_shader_stripping

Modify shader stripping configuration in GraphicsSettings.


Exact Signatures

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

管理Unity编辑器原生撤销/重做历史。支持查看当前状态、逐步撤销或重做操作,用于审查改动或导航历史记录。适用于用户请求查看撤销历史、执行回退或检查操作记录的场景。
查看或浏览撤销历史 逐步撤销操作 逐步重做操作 审查最近发生的改动
SkillsForUnity/unity-skills~/skills/history/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-history -g -y
SKILL.md
Frontmatter
{
    "name": "unity-history",
    "description": "Manage undo\/redo history over the Unity Editor native undo stack — inspect, step through, and control recorded operations. Use when reviewing or navigating the undo history, stepping undo\/redo, or auditing what changed, even if the user just says \"撤销历史\" or \"回退操作\". 管理 Unity 编辑器原生撤销栈上的撤销\/重做历史(查看、逐步遍历、控制已记录的操作);当用户要查看或浏览撤销历史、逐步撤销\/重做、或审查改动时使用。"
}

History Skills

Manage Unity Editor undo/redo history.

Operating Mode

本模块全部 3 个 skill (history_undo / history_redo / history_get_current) 均标 SkillMode.SemiAuto,Approval / Auto / Bypass 三档下都可直接执行。不含 NeverInSemi 高危 skill

DO NOT (common hallucinations):

  • history_list / history_get do not exist → use history_get_current for current undo group
  • history_clear does not exist → Unity undo history cannot be cleared via API
  • history_save does not exist → undo history is managed by Unity automatically

Routing:

  • For simple undo/redo → history_undo / history_redo (this module) or editor_undo / editor_redo
  • For persistent task-level undo → use workflow module
  • For conversation-level undo → use workflow module's workflow_session_undo

Skills

history_undo

Undo the last operation. Parameters:

  • steps (int, optional, default 1): Number of operations to undo.

history_redo

Redo the last undone operation. Parameters:

  • steps (int, optional, default 1): Number of operations to redo.

history_get_current

Get current undo history state. Parameters: None.

Exact Signatures

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

配置Unity项目中纹理、音频和模型的导入设置,支持批量调整压缩、Sprite模式及分平台覆盖。包含查询与设置技能,需配合asset模块进行文件导入或重新导入以生效变更。
用户要求调整资源导入设置 需要设置贴图压缩格式或Sprite模式 应用分平台导入覆盖规则 用户提及'导入设置'或'贴图压缩'
SkillsForUnity/unity-skills~/skills/importer/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-importer -g -y
SKILL.md
Frontmatter
{
    "name": "unity-importer",
    "description": "Configure asset import settings — texture\/audio\/model importers, sprite settings, and per-platform overrides. Use when adjusting how assets import, setting texture compression or sprite modes, or applying per-platform import overrides, even if the user just says \"导入设置\" or \"贴图压缩\". 配置资源导入设置(texture\/audio\/model 导入器、sprite 设置、分平台覆盖);当用户要调整资源如何导入、设置贴图压缩或 sprite 模式、或应用分平台导入覆盖时使用。"
}

Unity Importer Skills

Use this module to change import settings for textures, audio, and models that already exist in the project.

Batch-first: Prefer the batch setters when configuring 2+ assets of the same category.

Guardrails

Operating Mode (v1.9 three-tier):

  • Approval (default): query/getter skills (texture_get_settings, texture_get_info, texture_find_assets, texture_find_by_size, texture_get_platform_settings, texture_get_import_settings, audio_get_settings, audio_get_clip_info, audio_find_clips, audio_find_sources_in_scene, audio_get_source_info, audio_get_import_settings, model_get_settings, model_find_assets, model_get_mesh_info, model_get_materials_info, model_get_animations_info, model_get_rig_info, model_get_import_settings, asset_get_labels) run directly. Setters / reimport are FullAuto — on MODE_RESTRICTED, run the grant protocol.
  • Auto / Bypass: SemiAuto and FullAuto run directly.
  • This module contains no Delete / PlayMode / Reload / RiskLevel="high" skills — nothing auto-classifies as forbidden. Importer mutations are reachable via grant in Approval mode.
  • Setting changes do not always apply in memory immediately; call asset_reimport / asset_reimport_batch when Unity needs to fully refresh the asset.

DO NOT (common hallucinations):

  • importer_import does not exist -> use asset_import in the asset module to bring files into the project
  • importer_set_format does not exist -> use the specific texture/audio/model setters
  • importer_get_settings does not exist -> use the category-specific getters
  • Settings changes do not always apply instantly in memory. Reimport may still be required

Routing:

  • File import or refresh -> asset
  • Texture settings -> texture_*
  • Audio settings -> audio_*
  • Model settings -> model_*
  • Alternative importer bridge skills -> texture_set_import_settings, audio_set_import_settings, model_set_import_settings
  • Force importer refresh -> asset_reimport or asset_reimport_batch

Skills

Texture Route

Import settings:

Skill Use Key parameters
texture_get_settings Read texture importer settings assetPath
texture_set_settings Set texture importer settings assetPath, textureType?, maxSize?, filterMode?, compression?, mipmapEnabled?, sRGB?, readable?, wrapMode?
texture_set_settings_batch Batch texture settings items
texture_get_import_settings Read minimal importer settings (type/maxSize/compression/filter/srgb/readable/mipmap) assetPath
texture_set_import_settings Alternative texture import bridge similar texture fields

Query and runtime info:

Skill Use Key parameters
texture_find_assets Search Texture2D assets by AssetDatabase filter filter?, limit? (default 50)
texture_get_info Inspect dimensions, format, and runtime memory size assetPath
texture_find_by_size Find textures in a dimension range (pixels) minSize? (0), maxSize? (99999), limit? (50)

Typed / platform overrides:

Skill Use Key parameters
texture_set_type Switch texture type assetPath, textureType (Default/NormalMap/Sprite/EditorGUI/Cursor/Cookie/Lightmap/SingleChannel)
texture_set_platform_settings Override per-platform settings assetPath, platform (Standalone/iPhone/Android/WebGL), maxSize?, format?, compressionQuality?, overridden?
texture_get_platform_settings Read per-platform override assetPath, platform
texture_set_sprite_settings Sprite-specific knobs (PPU, mode) assetPath, pixelsPerUnit?, spriteMode? (Single/Multiple/Polygon)
sprite_set_import_settings Sprite importer bridge (PPU, packingTag, pivot) assetPath, spriteMode?, pixelsPerUnit?, packingTag?, pivotX?, pivotY?

Common texture decisions:

  • UI sprites -> textureType="Sprite", usually mipmapEnabled=false
  • Pixel art -> filterMode="Point"
  • Runtime CPU reads -> readable=true only when necessary
  • Platform-tuned builds -> prefer texture_set_platform_settings over global texture_set_settings

Audio Route

Import settings:

Skill Use Key parameters
audio_get_settings Read audio importer settings assetPath
audio_set_settings Set audio importer settings assetPath, forceToMono?, loadInBackground?, loadType?, compressionFormat?, quality?
audio_set_settings_batch Batch audio settings items
audio_get_import_settings Read minimal importer defaults (loadType/format/quality/forceToMono/loadInBackground) assetPath
audio_set_import_settings Alternative audio import bridge similar audio fields

Clip query and info:

Skill Use Key parameters
audio_find_clips Search AudioClip assets by filter filter?, limit? (default 50)
audio_get_clip_info Inspect length/channels/frequency/samples of a clip assetPath

Scene runtime (AudioSource / AudioMixer):

Skill Use Key parameters
audio_add_source Add an AudioSource to a GameObject target (name/instanceId/path), clipPath?, playOnAwake? (false), loop? (false), volume? (1)
audio_get_source_info Read the AudioSource configuration target
audio_set_source_properties Update AudioSource fields target, clipPath?, volume?, pitch?, loop?, playOnAwake?, mute?, spatialBlend?, priority?
audio_find_sources_in_scene List all AudioSources in the active scene limit? (default 50)
audio_create_mixer Create a new AudioMixer asset mixerName? (default NewAudioMixer), folder? (default Assets)

Common audio decisions:

  • Long BGM -> loadType="Streaming"
  • Short SFX -> loadType="DecompressOnLoad"
  • Memory-sensitive SFX libraries -> consider forceToMono=true
  • Scene-side AudioSource tuning -> prefer audio_set_source_properties over manual component edits

Model Route

Import settings:

Skill Use Key parameters
model_get_settings Read model importer settings assetPath
model_set_settings Set model importer settings assetPath, globalScale?, meshCompression?, isReadable?, generateSecondaryUV?, animationType?, importAnimation?, importCameras?, importLights?, materialImportMode?
model_set_settings_batch Batch model settings items
model_get_import_settings Read minimal importer defaults (scale/compression/animationType/importAnimation/materialImportMode) assetPath
model_set_import_settings Alternative model import bridge similar model fields

Query and info:

Skill Use Key parameters
model_find_assets Search model assets by filter filter?, limit? (default 50)
model_get_mesh_info Mesh vertex / triangle / submesh stats target (name/instanceId/path) or assetPath
model_get_materials_info Inspect sub-asset materials embedded in the model assetPath
model_get_animations_info List animation clips and framerates on the model assetPath
model_get_rig_info Read animationType, avatar, skeleton binding info assetPath

Animation and rig:

Skill Use Key parameters
model_set_animation_clips Configure animation clip splits assetPath, clips (JSON array of {name, firstFrame, lastFrame, loop})
model_set_rig Switch rig/skeleton mode assetPath, animationType (None/Legacy/Generic/Humanoid), avatarSetup?

Common model decisions:

  • Characters -> animationType="Humanoid" when retargeting is required
  • Static props -> disable cameras/lights/animation imports when unused
  • Baked-lighting meshes -> enable secondary UVs when appropriate
  • After model_set_rig or model_set_animation_clips -> call asset_reimport to refresh clips and avatar

Reimport Rule

After importer changes, use reimport when you need Unity to fully refresh the asset:

Skill Use
asset_reimport Reimport one asset
asset_reimport_batch Reimport assets matching a search scope

Minimal Example

import unity_skills

unity_skills.call_skill("texture_set_settings_batch", items=[
    {"assetPath": "Assets/UI/icon_play.png", "textureType": "Sprite", "mipmapEnabled": False},
    {"assetPath": "Assets/UI/icon_pause.png", "textureType": "Sprite", "mipmapEnabled": False}
])

unity_skills.call_skill("audio_set_settings",
    assetPath="Assets/Audio/bgm.mp3",
    loadType="Streaming",
    compressionFormat="Vorbis",
    quality=0.7
)

unity_skills.call_skill("asset_reimport", assetPath="Assets/Audio/bgm.mp3")

Exact Signatures

Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file. Load IMPORT_REFERENCE.md for extended asset search/query helpers, platform overrides, rig/animation details, and importer-side best practices.

提供Unity Inspector编辑器体验优化建议,涵盖序列化字段管理、属性装饰、校验及自定义显示。适用于设计组件呈现、组织字段或改善作者编辑体验的场景。
Inspector怎么设计 字段怎么显示 如何优化Inspector布局 添加Tooltip或Header
SkillsForUnity/unity-skills~/skills/inspector/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-inspector -g -y
SKILL.md
Frontmatter
{
    "name": "unity-inspector",
    "description": "Advises on Unity Inspector authoring UX — SerializeField usage, Tooltip\/Header organization, validation, and custom Inspector display. Use when designing how a component appears in the Inspector, organizing serialized fields, adding tooltips\/headers, or improving authoring UX, even if the user just says \"Inspector怎么设计\" or \"字段怎么显示\". 为 Unity Inspector 编写体验提供建议(SerializeField 用法、Tooltip\/Header 组织、校验、自定义 Inspector 显示);当用户要设计组件在 Inspector 的呈现、组织序列化字段、添加提示\/分组或改善编辑体验时使用。"
}

Unity Inspector Design

Use this skill when scripts need to be easier to author, configure, and review in the Inspector.

Guardrails

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

  • Prefer [SerializeField] private over unnecessary public fields.
  • Do not over-decorate with attributes when simple naming suffices.

Default Rules

  • Use [Header], [Tooltip], [Space], [Range], [Min], [TextArea] when they clarify authoring intent.
  • Use [RequireComponent] for mandatory sibling dependencies.
  • Use [CreateAssetMenu] for config/data assets that designers should create directly.
  • Use OnValidate only for lightweight editor-time validation and normalization.
  • Use SerializeReference only when polymorphic serialized data is genuinely needed.

Inspector Quality Checklist

  • Are defaults safe?
  • Are required references obvious?
  • Are fields grouped by responsibility?
  • Are tuning values constrained?
  • Are debug-only fields separated from authoring fields?
  • Will another person understand this script from the Inspector alone?

Output Format

  • Field exposure strategy
  • Recommended attributes
  • Validation rules
  • Authoring UX improvements
  • Over-design to avoid
用于在Unity中创建、配置和批量管理灯光(Directional/Point/Spot/Area)及光照探针。支持添加灯光、调整属性、开关状态及查询烘焙设置,提供批处理优化操作。
用户要求添加或配置Unity灯光 需要调校场景照明效果 请求批量启用或禁用多个灯光 询问或修改光照贴图烘焙设置
SkillsForUnity/unity-skills~/skills/light/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-light -g -y
SKILL.md
Frontmatter
{
    "name": "unity-light",
    "description": "Create and configure Unity lights — Directional\/Point\/Spot\/Area lights and batch-toggling scene lights. Use when adding or tuning lights, setting up scene lighting, or batch-enabling\/disabling lights, even if the user just says \"加个灯\" or \"打光\". 创建与配置 Unity 灯光(Directional\/Point\/Spot\/Area 灯光、批量开关场景灯光);当用户要添加或调校灯光、布置场景照明、或批量启用\/禁用灯光时使用。"
}

Unity Light Skills

BATCH-FIRST: Use *_batch skills when operating on 2+ lights.

Operating Mode

  • Approval (default): mutating skills (light_create, light_set_properties, light_set_properties_batch, light_set_enabled, light_set_enabled_batch, light_add_probe_group, light_add_reflection_probe) need user grant; grant triggers a single server-side execution that returns the result.
  • Auto / Bypass: those skills execute directly.
  • Query skills (light_get_info, light_find_all, light_get_lightmap_settings) are SkillMode.SemiAuto — they run in all three modes without grant.
  • This module contains no Delete / PlayMode / Reload / high-risk skills (no NeverInSemi); to remove a Light, call gameobject_delete from the gameobject module.

Guardrails

DO NOT (common hallucinations):

  • light_add does not exist → use light_create (creates a new light GameObject)
  • light_set_color / light_set_intensity do not exist → use light_set_properties (sets color, intensity, range, shadows together)
  • light_delete does not exist → use gameobject_delete on the light's GameObject
  • light_set_shadow does not exist → use light_set_properties with shadows parameter ("none"/"hard"/"soft")

Routing:

  • For lightmap baking settings → light_get_lightmap_settings (this module)
  • For reflection probes → light_add_reflection_probe (this module)
  • For light probe groups → light_add_probe_group (this module)

Object Targeting: All single-object skills accept name (string) and instanceId (int, preferred). Provide at least one. path (hierarchy path) is also accepted where noted.

Skills Overview

Single Object Batch Version Use Batch When
light_set_properties light_set_properties_batch Configuring 2+ lights
light_set_enabled light_set_enabled_batch Toggling 2+ lights

No batch needed:

  • light_create - Create a light
  • light_get_info - Get light information
  • light_find_all - Find all lights (returns list)
  • light_add_probe_group - Add a Light Probe Group with optional grid layout
  • light_add_reflection_probe - Create a Reflection Probe at a position
  • light_get_lightmap_settings - Inspect Lightmap baking settings

Light Types

Type Description Use Case
Directional Parallel rays, no position Sun, moon
Point Omnidirectional from a point Torches, bulbs
Spot Cone-shaped beam Flashlights, spotlights
Area Rectangle/disc (baked only) Windows, soft lights

Skills

light_create

Create a new light.

Parameter Type Required Default Description
name string No "New Light" Light name
lightType string No "Point" Directional/Point/Spot/Area
x, y, z float No 0,3,0 Position
r, g, b float No 1,1,1 Color (0-1)
intensity float No 1 Light intensity
range float No 10 Range (Point/Spot)
spotAngle float No 30 Cone angle (Spot only)
shadows string No "soft" none/hard/soft

Returns: {success, name, instanceId, lightType, position, color, intensity, shadows}

light_set_properties

Configure light properties.

Parameter Type Required Description
name string No* Light object name
instanceId int No* Instance ID (preferred)
r, g, b float No Color (0-1)
intensity float No Light intensity
range float No Range (Point/Spot)
spotAngle float No Cone angle (Spot only)
shadows string No none/hard/soft

Returns: {success, name, lightType, color, intensity, range, spotAngle, shadows}

light_set_properties_batch

Configure multiple lights. Each item accepts: name/instanceId/path (identifier) + r, g, b, intensity, range, shadows (all optional).

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

Returns: {success, totalItems, successCount, failCount, results: [{success, name}]}

unity_skills.call_skill("light_set_properties_batch", items=[
    {"name": "Light1", "intensity": 2.0, "r": 1, "g": 0.9, "b": 0.8},
    {"instanceId": 12345, "intensity": 1.5, "shadows": "soft"},
    {"name": "Light3", "intensity": 2.0}
])

light_set_enabled

Enable or disable a light.

Parameter Type Required Description
name string No* Light object name
instanceId int No* Instance ID
enabled bool Yes Enable state

light_set_enabled_batch

Enable or disable multiple lights.

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

Returns: {success, totalItems, successCount, failCount, results: [{success, name, enabled}]}

unity_skills.call_skill("light_set_enabled_batch", items=[
    {"name": "Torch1", "enabled": False},
    {"name": "Torch2", "enabled": False},
    {"name": "Torch3", "enabled": False}
])

light_get_info

Get detailed light information.

Parameter Type Required Description
name string No* Light object name
instanceId int No* Instance ID

Returns: {name, instanceId, path, lightType, color, intensity, range, spotAngle, shadows, enabled, cullingMask, bounceIntensity}

light_find_all

Find all lights in scene.

Parameter Type Required Default Description
lightType string No null Filter by type
limit int No 50 Max results

Returns: {count, lights: [{name, instanceId, path, lightType, intensity, enabled}]}

light_add_probe_group

Add a Light Probe Group to a GameObject. Optional grid layout: gridX/gridY/gridZ (count per axis), spacingX/spacingY/spacingZ (meters between probes).

Parameter Type Required Default Description
name string No null GameObject name
instanceId int No 0 Instance ID
path string No null Hierarchy path
gridX int No 0 Probe count on X axis
gridY int No 0 Probe count on Y axis
gridZ int No 0 Probe count on Z axis
spacingX float No 2 Meters between probes on X
spacingY float No 1.5 Meters between probes on Y
spacingZ float No 2 Meters between probes on Z

Returns: { success, gameObject, probeCount, existed, hasGrid }

light_add_reflection_probe

Create a Reflection Probe at a position.

Parameter Type Required Default Description
probeName string No "ReflectionProbe" Probe name
x, y, z float No 0,1,0 Position
sizeX, sizeY, sizeZ float No 10,10,10 Probe box size
resolution int No 256 Cubemap resolution

Returns: { success, name, instanceId, resolution, size }

light_get_lightmap_settings

Get Lightmap baking settings.

No parameters.

Returns: { success, bakedGI, realtimeGI, lightmapSize, lightmapPadding, isRunning, lightmapCount }


Example: Efficient Lighting Setup

import unity_skills

# BAD: 4 API calls
unity_skills.call_skill("light_set_properties", name="Light1", intensity=2.0)
unity_skills.call_skill("light_set_properties", name="Light2", intensity=2.0)
unity_skills.call_skill("light_set_properties", name="Light3", intensity=2.0)
unity_skills.call_skill("light_set_properties", name="Light4", intensity=2.0)

# GOOD: 1 API call
unity_skills.call_skill("light_set_properties_batch", items=[
    {"name": "Light1", "intensity": 2.0},
    {"name": "Light2", "intensity": 2.0},
    {"name": "Light3", "intensity": 2.0},
    {"name": "Light4", "intensity": 2.0}
])

Minimal Example

unity_skills.call_skill("light_create",
    name="Sun", lightType="Directional",
    r=1, g=0.95, b=0.85, intensity=1.2, shadows="soft"
)

Best Practices

  1. Use Directional light for main scene illumination
  2. Point lights for localized sources (lamps, fires)
  3. Spot lights for focused beams (flashlights, stage)
  4. Limit real-time shadows for performance
  5. Area lights require baking (not real-time)
  6. Use intensity > 1 for HDR/bloom effects

Exact Signatures

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

用于编辑Unity材质和Shader属性,支持Built-in/URP/HDRP管线。提供颜色、贴图、浮点数等参数设置及批量操作功能。需避免常见幻觉错误,注意数值范围和API命名差异。
调整物体外观 修改材质参数 切换Shader 批量应用材质设置
SkillsForUnity/unity-skills~/skills/material/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-material -g -y
SKILL.md
Frontmatter
{
    "name": "unity-material",
    "description": "Edit Unity material and shader properties across Built-in\/URP\/HDRP — colors, textures, floats, keywords, render queue, batch-apply. Use when changing how a surface looks, tweaking material parameters, or swapping shaders. 编辑材质与 Shader 属性(Built-in\/URP\/HDRP:颜色、贴图、浮点值、关键字、渲染队列、批量应用);当用户要调整物体外观、改材质参数或切换 Shader 时使用。"
}

Unity Material Skills

BATCH-FIRST: Use *_batch skills when operating on 2+ objects/materials.

Operating Mode

  • Approval (default): all mutating skills (material_create, material_create_batch, material_assign, material_assign_batch, material_duplicate, material_set_color / _emission / _texture / _float / _int / _vector / _keyword / _render_queue / _shader / _texture_offset / _texture_scale / _gi_flags, and the *_batch variants) need user grant; grant triggers a single server-side execution that returns the result.
  • Auto / Bypass: those skills execute directly.
  • Query skills (material_get_properties, material_get_keywords) are SkillMode.SemiAuto — they run in all three modes without grant.
  • This module contains no Delete / PlayMode / Reload / high-risk skills (no NeverInSemi); to delete a material asset, call the asset module.

Guardrails

DO NOT (common hallucinations):

  • material_set_metallic / material_set_smoothness do not exist → use material_set_float with propertyName="_Metallic" or "_Glossiness" (Standard) / "_Smoothness" (URP)
  • material_set_color r/g/b/a range is 0–1, not 0–255
  • material_set_property does not exist → use the specific setter: material_set_float, material_set_int, material_set_vector, material_set_color
  • material_get_color does not exist → use material_get_properties (returns all properties including colors)

Routing:

  • For shader changes → material_set_shader (this module)
  • For texture tiling → material_set_texture_scale / material_set_texture_offset
  • Pipeline-specific property names differ: check Render Pipeline Compatibility table in this doc

Object Targeting: Most single-object skills accept name (GameObject name) or path. Behaviour of path:

  • In material_set_* / material_get_* (color/emission/texture/float/int/vector/keyword/shader/render_queue/gi_flags/properties), path may be either a GameObject hierarchy path or a material asset path like Assets/Materials/X.mat — the skill auto-detects (paths starting with Assets/ or ending with .mat are treated as material assets).
  • In material_assign, path is a GameObject hierarchy path only; the material to assign goes in the separate materialPath parameter.

Skills Overview

Single Object Batch Version Use Batch When
material_create material_create_batch Creating 2+ materials
material_assign material_assign_batch Assigning to 2+ objects
material_set_color material_set_colors_batch Setting colors on 2+ objects
material_set_emission material_set_emission_batch Setting emission on 2+ objects

No batch needed:

  • material_set_texture - Set texture
  • material_set_texture_offset/scale - Texture tiling
  • material_set_float/int/vector - Set properties
  • material_set_keyword - Enable/disable shader keywords
  • material_set_render_queue - Set render queue
  • material_set_shader - Change shader
  • material_get_properties/keywords - Query properties
  • material_duplicate - Duplicate material

Skills

material_create

Create a new material (auto-detects render pipeline).

Parameter Type Required Default Description
name string Yes - Material name
shaderName string No auto-detect Shader (auto-detects URP/HDRP/Standard)
savePath string No null Save path (folder or full path)

material_create_batch

Create multiple materials.

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

Returns: {success, totalItems, successCount, failCount, results: [{success, name, path}]}

unity_skills.call_skill("material_create_batch", items=[
    {"name": "Red", "savePath": "Assets/Materials"},
    {"name": "Blue", "savePath": "Assets/Materials"},
    {"name": "Green", "savePath": "Assets/Materials"}
])

material_assign

Assign material to object's renderer.

Parameter Type Required Description
name string No* GameObject name
instanceId int No* Instance ID
path string No* GameObject hierarchy path
materialPath string Yes Material asset to assign (e.g. Assets/Materials/X.mat)

material_assign_batch

Assign materials to multiple objects.

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

Returns: {success, totalItems, successCount, failCount, results: [{success, name, materialPath}]}

unity_skills.call_skill("material_assign_batch", items=[
    {"name": "Cube1", "materialPath": "Assets/Materials/Red.mat"},
    {"name": "Cube2", "materialPath": "Assets/Materials/Blue.mat"}
])

material_set_color

Set material color with optional HDR intensity.

Parameter Type Required Default Description
name string No* GameObject name
path string No* Material asset path
r, g, b float No 1 Color (0-1)
a float No 1 Alpha
propertyName string No auto-detect Color property
intensity float No 1.0 HDR intensity (>1 for bloom)

material_set_colors_batch

Set colors on multiple objects. Each item accepts: identifier (name/instanceId/path) + r, g, b, a, optional per-item propertyName.

Parameter Type Required Default Description
items json string Yes - JSON array of `{name
propertyName string No auto-detect Default color property applied to all items unless overridden

Returns: {success, totalItems, successCount, failCount, results: [{success, name}]}

unity_skills.call_skill("material_set_colors_batch", items=[
    {"name": "Cube1", "r": 1, "g": 0, "b": 0},
    {"name": "Cube2", "r": 0, "g": 1, "b": 0},
    {"name": "Cube3", "r": 0, "g": 0, "b": 1}
])

material_set_emission

Set emission color with auto-enable keyword.

Parameter Type Required Default Description
name string No* GameObject name
path string No* Material asset path
r, g, b float No 1 Emission color (0-1)
intensity float No 1.0 HDR intensity (>1 for bloom)
enableEmission bool No true Auto-enable _EMISSION keyword

material_set_emission_batch

Set emission on multiple objects.

Parameter Type Required Default Description
items json string Yes - JSON array of per-item objects (see example below)

Returns: {success, totalItems, successCount, failCount, results: [{success, name}]}

unity_skills.call_skill("material_set_emission_batch", items=[
    {"name": "Neon1", "r": 1, "g": 0, "b": 1, "intensity": 5.0},
    {"name": "Neon2", "r": 0, "g": 1, "b": 1, "intensity": 5.0}
])

material_set_texture

Set material texture.

Parameter Type Required Default Description
name string No* GameObject name
path string No* Material asset path
texturePath string Yes - Texture asset path
propertyName string No auto-detect Texture property

material_set_float

Set a float property on a material.

Parameter Type Required Description
name string No* GameObject name
path string No* Material asset path
propertyName string Yes Property name
value float Yes Value

material_set_int

Set an integer property on a material.

Parameter Type Required Description
name string No* GameObject name
path string No* Material asset path
propertyName string Yes Property name
value int Yes Value

material_set_keyword

Enable/disable shader keywords.

Parameter Type Required Default Description
name string No* GameObject name
path string No* Material asset path
keyword string Yes - Keyword name
enable bool No true Enable or disable

Common Keywords: _EMISSION, _NORMALMAP, _METALLICGLOSSMAP, _ALPHATEST_ON, _ALPHABLEND_ON

material_get_properties

Get all material properties.

Parameter Type Required Description
name string No* GameObject name
path string No* Material asset path

Returns: {success, target, shader, renderQueue, keywords, giFlags, properties: {colors, floats, vectors, textures, integers}}

material_get_keywords

Get all enabled shader keywords on a material.

Parameter Type Required Description
name string No* GameObject name
path string No* Material asset path

material_duplicate

Duplicate a material asset.

Parameter Type Required Description
sourcePath string Yes Source material path
newName string Yes Name for the duplicated material
savePath string No Optional folder/path override for the duplicated material

material_set_shader

Change the shader of a material.

Parameter Type Required Description
name string No* GameObject name
path string No* Material asset path
shaderName string Yes Shader name

material_set_vector

Set a Vector4 property on a material.

Parameter Type Required Description
name string No* GameObject name
path string No* Material asset path
propertyName string Yes Property name
x, y, z, w float Yes Vector components

material_set_texture_offset

Set texture offset (tiling position).

Parameter Type Required Description
name string No* GameObject name
path string No* Material asset path
propertyName string No Texture property name
x, y float Yes Offset values

material_set_texture_scale

Set texture scale (tiling).

Parameter Type Required Description
name string No* GameObject name
path string No* Material asset path
propertyName string No Texture property name
x, y float Yes Scale values

material_set_render_queue

Set material render queue.

Parameter Type Required Description
name string No* GameObject name
path string No* Material asset path
renderQueue int Yes Render queue value

material_set_gi_flags

Set material global illumination flags.

Parameter Type Required Description
name string No* GameObject name
path string No* GameObject hierarchy path or material asset path
flags string Yes GI flags: None / RealtimeEmissive / BakedEmissive / EmissiveIsBlack / AnyEmissive (default RealtimeEmissive if omitted in code; required here)

Example: Efficient Material Setup

import unity_skills

# BAD: 6 API calls
unity_skills.call_skill("material_create", name="Mat1", savePath="Assets/Materials")
unity_skills.call_skill("material_create", name="Mat2", savePath="Assets/Materials")
unity_skills.call_skill("material_set_color", path="Assets/Materials/Mat1.mat", r=1, g=0, b=0)
unity_skills.call_skill("material_set_color", path="Assets/Materials/Mat2.mat", r=0, g=0, b=1)
unity_skills.call_skill("material_assign", name="Cube1", materialPath="Assets/Materials/Mat1.mat")
unity_skills.call_skill("material_assign", name="Cube2", materialPath="Assets/Materials/Mat2.mat")

# GOOD: 3 API calls
unity_skills.call_skill("material_create_batch", items=[
    {"name": "Mat1", "savePath": "Assets/Materials"},
    {"name": "Mat2", "savePath": "Assets/Materials"}
])
unity_skills.call_skill("material_set_colors_batch", items=[
    {"path": "Assets/Materials/Mat1.mat", "r": 1, "g": 0, "b": 0},
    {"path": "Assets/Materials/Mat2.mat", "r": 0, "g": 0, "b": 1}
])
unity_skills.call_skill("material_assign_batch", items=[
    {"name": "Cube1", "materialPath": "Assets/Materials/Mat1.mat"},
    {"name": "Cube2", "materialPath": "Assets/Materials/Mat2.mat"}
])

Render Pipeline Compatibility

Skills auto-detect and adapt to your render pipeline:

Pipeline Default Shader Color Property Texture Property
Built-in Standard _Color _MainTex
URP Universal Render Pipeline/Lit _BaseColor _BaseMap
HDRP HDRP/Lit _BaseColor _BaseColorMap

Best Practices

  1. Save materials as assets for reuse
  2. Use material instances (by name) for runtime changes
  3. Use material assets (by path) for persistent changes
  4. Check shader property names in Unity Inspector
  5. URP/HDRP have different property names than Standard

Exact Signatures

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

用于烘焙、查询及配置Unity NavMesh导航网格。支持路径计算、Agent与障碍物管理、参数调整及数据清理。涵盖从场景搭建到寻路测试的全流程操作,需区分读写权限并警惕同步阻塞风险。
用户需要烘焙或重烘焙NavMesh 用户要求查询两点间寻路路径 用户提到导航网格或寻路设置 用户需添加/配置NavMeshAgent或Obstacle
SkillsForUnity/unity-skills~/skills/navmesh/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-navmesh -g -y
SKILL.md
Frontmatter
{
    "name": "unity-navmesh",
    "description": "Bake and query Unity NavMesh — bake\/rebake navigation meshes, query paths, and configure bake settings. Use when setting up navigation, baking a NavMesh, testing agent paths, or tuning bake parameters, even if the user just says \"导航网格\" or \"寻路\". 烘焙与查询 Unity NavMesh(烘焙\/重烘焙导航网格、查询路径、配置烘焙设置);当用户要搭建导航、烘焙 NavMesh、测试 agent 路径或调整烘焙参数时使用。"
}

NavMesh Skills

Bake / clear NavMesh data, calculate paths, sample positions, and configure NavMeshAgent / NavMeshObstacle components.

Operating Mode

  • Approval:查询类 skill(navmesh_calculate_path / navmesh_sample_position / navmesh_get_settings,源码标 SkillMode.SemiAuto)直接执行;变更类(navmesh_bake / navmesh_add_agent / navmesh_set_agent / navmesh_add_obstacle / navmesh_set_obstacle / navmesh_set_area_cost,标 SkillMode.FullAuto)需用户 grant,grant 后服务端一步执行返结果。
  • Auto / Bypass:所有未被禁列表拦截的 skill 直接执行。
  • 本模块含 Delete 类 skillnavmesh_clear 标记为 SkillOperation.Delete,会被 IsForbiddenInSemi 静态拦截 —— 仅 Bypass 模式或将其加入 Allowlist 才能调用。
  • navmesh_bake 同步阻塞主线程;大场景可能很慢,调用前提醒用户。

DO NOT (common hallucinations):

  • navmesh_create does not exist → use navmesh_bake to generate NavMesh
  • navmesh_add_agent_component / navmesh_set_agent_speed do not exist → use navmesh_add_agent + navmesh_set_agent (convenience wrappers), or component_add/component_set_property for full control
  • NavMesh must be re-baked after scene geometry changes

Routing:

  • For NavMeshAgent/NavMeshObstacle components → use component module
  • For path calculation → navmesh_calculate_path (this module)

Skills

navmesh_bake

Bake the NavMesh (Synchronous). Warning: Can be slow. Parameters: None.

navmesh_clear

Clear the NavMesh data. Parameters: None.

navmesh_calculate_path

Calculate a path between two points. Parameters:

  • startX, startY, startZ (float): Start position.
  • endX, endY, endZ (float): End position.
  • areaMask (int, optional): NavMesh area mask.

Returns: { status, valid, distance, cornerCount, corners }

  • status: NavMeshPathStatus string (PathComplete / PathPartial / PathInvalid)
  • valid: true only when status == "PathComplete"
  • distance: total path length (0 for invalid paths)
  • cornerCount: number of corner points in corners
  • corners: array of {x, y, z} waypoints (empty when no path)

navmesh_add_agent

Add NavMeshAgent component to an object.

Parameter Type Required Default Description
name string No null GameObject name
instanceId int No 0 GameObject instance ID
path string No null GameObject hierarchy path

Returns: { success, gameObject }

navmesh_set_agent

Set NavMeshAgent properties (speed, acceleration, radius, height, stoppingDistance).

Parameter Type Required Default Description
name string No null GameObject name
instanceId int No 0 GameObject instance ID
path string No null GameObject hierarchy path
speed float No null Agent movement speed
acceleration float No null Agent acceleration
angularSpeed float No null Agent angular speed
radius float No null Agent radius
height float No null Agent height
stoppingDistance float No null Distance to stop before target

Returns: { success, gameObject, speed, radius }

navmesh_add_obstacle

Add NavMeshObstacle component to an object.

Parameter Type Required Default Description
name string No null GameObject name
instanceId int No 0 GameObject instance ID
path string No null GameObject hierarchy path
carve bool No true Enable carving

Returns: { success, gameObject, carving }

navmesh_set_obstacle

Set NavMeshObstacle properties (shape, size, carving).

Parameter Type Required Default Description
name string No null GameObject name
instanceId int No 0 GameObject instance ID
path string No null GameObject hierarchy path
shape string No null Obstacle shape (e.g. Box, Capsule)
sizeX float No null Obstacle size X
sizeY float No null Obstacle size Y
sizeZ float No null Obstacle size Z
carving bool No null Enable carving

Returns: { success, gameObject, shape, carving }

navmesh_sample_position

Find nearest point on NavMesh.

Parameter Type Required Default Description
x float Yes - Source position X
y float Yes - Source position Y
z float Yes - Source position Z
maxDistance float No 10 Maximum search distance

Returns: { success, found, point: { x, y, z }, distance }

navmesh_set_area_cost

Set area traversal cost.

Parameter Type Required Default Description
areaIndex int Yes - NavMesh area index
cost float Yes - Traversal cost value

Returns: { success, areaIndex, cost }

navmesh_get_settings

Get NavMesh build settings.

Parameters: None.

Returns: { success, agentRadius, agentHeight, agentSlope, agentClimb }


Exact Signatures

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

为 Unity Netcode for GameObjects 2.x 提供源码级设计规则,涵盖生命周期、所有权、RPC、网络变量及场景管理等。用于编写、审查多人联机代码或排查同步问题时加载,确保权威性与合规性。
编写或审查多人联机代码 设计服务器/分布式权威架构 配置 RPC 或 NetworkVariables 排查 Netcode 同步问题 用户提及'联机'或'多人同步'
SkillsForUnity/unity-skills~/skills/netcode-design/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-netcode-design -g -y
SKILL.md
Frontmatter
{
    "name": "unity-netcode-design",
    "description": "Source-anchored design rules for Netcode for GameObjects 2.x — lifecycle, ownership, RPCs, NetworkVariables, spawning, scene management, transport, and pitfalls. Use when writing or reviewing multiplayer code, designing server\/distributed authority, wiring RPCs or NetworkVariables, or debugging netcode, even if the user just says \"联机\" or \"多人同步\". 为 Netcode for GameObjects 2.x 提供源码锚定的设计规则(生命周期、所有权、RPC、NetworkVariable、生成、场景管理、传输、陷阱);当用户要编写或审查多人联机代码、设计服务器\/分布式权威、连接 RPC 或网络变量、或排查 netcode 问题时使用。"
}

Netcode for GameObjects - Design Rules

Advisory module. Every rule is distilled from com.unity.netcode.gameobjects 2.x source. Each rule cites a concrete file/line so the reasoning is auditable.

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

When to Load This Module

Load before writing or reviewing any of:

  • NetworkBehaviour scripts (OnNetworkSpawn / OnNetworkDespawn / RPCs / NetworkVariables)
  • NetworkManager startup / shutdown / scene switching
  • NetworkObject Spawn / Despawn / ChangeOwnership / TrySetParent
  • UnityTransport configuration (direct connect / Relay)
  • Any code that branches on IsHost / IsServer / IsClient / IsOwner

Critical Rule Summary (memorize even if you skip the sub-docs)

# Rule Source anchor
1 Spawn() / Despawn() must be called on Server/Host only; client-side calls fail. Runtime/Core/NetworkObject.cs:1884, 1921
2 OnNetworkSpawn() runs before Unity Start() and after Awake/OnEnable. Runtime/Core/NetworkBehaviour.cs:704 + InvokeBehaviourNetworkSpawn callers
3 Legacy [ServerRpc] method names must end with ServerRpc; [ClientRpc] must end with ClientRpc (ILPP enforced at compile time). Editor/CodeGen/ ILPP validators
4 New [Rpc(SendTo.X)] has no naming constraint; SendTo has 11 values. Runtime/Messaging/RpcTargets/RpcTarget.cs:9-80
5 PlayerPrefab must exist in NetworkPrefabsList or NetworkConfig.Prefabs or 2.x runtime rejects it. Runtime/Configuration/NetworkConfig.cs:40 + NetworkPrefabsList.cs:14
6 Nested NetworkObjects are forbidden (NetworkObject inside another NetworkObject prefab). Re-parent at runtime via TrySetParent. Runtime/Core/NetworkObject.cs:2135-2215
7 NetworkVariable<T> requires T to be unmanaged or implement INetworkSerializable. string, List<>, class are rejected. Runtime/NetworkVariable/NetworkVariable.cs:12 + ILPP
8 NetworkList<T> requires T: unmanaged, IEquatable<T>. It is NOT NetworkVariable<List<T>>. Runtime/NetworkVariable/Collections/NetworkList.cs:14
9 NetworkSceneManager.LoadScene/UnloadScene is Server-only. Runtime/SceneManagement/NetworkSceneManager.cs:1496, 1252
10 UnityTransport.SetRelayServerData and SetConnectionData are mutually exclusive; use one or the other. Runtime/Transports/UTP/UnityTransport.cs:776-897

Sub-doc Routing

Sub-doc When to read
LIFECYCLE.md Lifecycle, callback ordering, Awake/OnNetworkSpawn/Start differences
OWNERSHIP.md IsOwner/IsServer/IsHost permission matrix, ChangeOwnership, Distributed Authority
RPC.md Choosing RPC attributes, SendTo semantics, RpcInvokePermission, deprecated paths
VARIABLES.md NetworkVariable/NetworkList init and serialization constraints
SPAWNING.md Prefab registration → Spawn → Despawn, GlobalObjectIdHash, SpawnAsPlayerObject
SCENE.md NetworkSceneManager, EnableSceneManagement, in-scene object sync
TRANSPORT.md UnityTransport direct / Relay / DebugSimulator configuration
PITFALLS.md 30 concrete hallucination pitfalls

Routing to Other Modules

  • Generating NetworkBehaviour scripts → use the functional netcode module's netcode_add_network_behaviour_script
  • Bulk attaching NetworkObject/NetworkTransform in the scene → netcode module Components skills
  • Architecture-level decisions (Server-authoritative vs Distributed Authority) → also load architecture

Version Scope

This document targets com.unity.netcode.gameobjects 2.x (validated against 2.11.0, Unity 6000.0+). Some APIs (SendTo.Authority, RpcInvokePermission, the universal [Rpc] attribute) do not exist in 1.x.

用于Unity NGO 2.x多人联机开发,涵盖NetworkManager配置、预制体注册、生成逻辑及主机/服务器/客户端生命周期管理。需先加载设计文档,严格区分读写权限与运行模式,防止幻觉调用不存在的API。
搭建多人联机 注册网络预制体 连接生成逻辑 启动 host/server/client 联机 多人游戏
SkillsForUnity/unity-skills~/skills/netcode/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-netcode -g -y
SKILL.md
Frontmatter
{
    "name": "unity-netcode",
    "description": "Set up Netcode for GameObjects (NGO 2.x) multiplayer — configure NetworkManager, NetworkObjects\/prefabs, spawning, and host\/server\/client lifecycle. Use when scaffolding multiplayer, registering network prefabs, wiring spawn logic, or starting host\/server\/client, even if the user just says \"联机\" or \"多人游戏\". 搭建 Netcode for GameObjects(NGO 2.x)多人联机(配置 NetworkManager、NetworkObject\/预制体、生成、host\/server\/client 生命周期);当用户要搭建多人联机、注册网络预制体、连接生成逻辑或启动 host\/server\/client 时使用。"
}

Unity Netcode for GameObjects Skills

Automation for Netcode for GameObjects (NGO) multiplayer setup and operations. Every skill is source-verified against NGO 2.x; when the package is absent, each skill returns a NoNetcode() error with install instructions.

Requires: com.unity.netcode.gameobjects (2.x), Unity 6000.0+. Strongly recommended: before calling any netcode_* skill, load netcode-design. NGO lifecycle and permission rules are strict; skills alone cannot prevent incorrect business code.

Guardrails

Operating Mode (v1.9 three-tier):

  • Approval (default): query/list/info skills (netcode_check_setup, netcode_get_manager_info, netcode_get_transport_info, netcode_list_network_objects, netcode_get_network_object_info, netcode_list_network_prefabs, netcode_list_network_behaviours, netcode_get_spawn_manager_info, netcode_get_scene_manager_info, netcode_get_status) run directly. Mutators (create/configure/attach/add) are FullAuto — on MODE_RESTRICTED, run the grant protocol.

  • Auto / Bypass: SemiAuto and FullAuto run directly.

  • Auto-forbidden in this module:

    • SkillOperation.Deletenetcode_remove_manager, netcode_remove_network_object, netcode_remove_from_prefabs_list
    • MayTriggerReload = truenetcode_add_network_behaviour_script (writes a new .cs, forces script compile + Domain Reload)
    • MayEnterPlayMode = truenetcode_start_host, netcode_start_server, netcode_start_client, netcode_shutdown

    These are reachable only under Bypass mode or via a user-managed Allowlist entry; the grant flow returns MODE_FORBIDDEN. Runtime control + Behaviour-script generation are the practical reason this module is gated.

  • When com.unity.netcode.gameobjects is missing, every skill returns a NoNetcode() error with install instructions.

DO NOT (common hallucinations):

  • netcode_spawn_object / netcode_spawn_player — do not exist. Spawn must happen in runtime code (NetworkBehaviour) via .Spawn() or NetworkManager.SpawnManager.InstantiateAndSpawn. Skills do not proxy Spawn because Spawn requires a running NetworkManager.
  • netcode_register_scene — does not exist. Scene registration goes through Build Settings + EnableSceneManagement. This module only exposes netcode_configure_scene_management for reading/writing the config.
  • netcode_set_tick_rate / netcode_set_protocol as standalone skills — do not exist. Use netcode_configure_manager for all NetworkConfig edits.
  • Do not assume netcode_start_host works in Edit Mode. All Runtime control skills require PlayMode.
  • Do not assume netcode_add_to_prefabs_list automatically attaches a NetworkObject component. Call netcode_add_network_object first.

Routing:

  • Plain GameObject hierarchy creation → gameobject
  • Attach NetworkObject / NetworkTransform / other networking components → this module
  • Generic player-prefab components (Rigidbody / Collider / Animator) → component
  • Runtime scene switching (LoadScene) → call NetworkManager.SceneManager.LoadScene from the generated NetworkBehaviour; this module does not execute it
  • Code-level design decisions (RPC direction, NetworkVariable permission) → netcode-design advisory

Object Targeting

netcode_add_* / netcode_configure_* skills use the usual target parameters:

  • name — scene object name
  • instanceId — Unity InstanceID (exact)
  • path — hierarchy path Parent/Child

Prefer instanceId when there is a chance of duplicate names.

Skills

Setup & Validation

Skill Purpose Key Parameters
netcode_check_setup Verify package, NetworkManager, Transport, PlayerPrefab, and PrefabsList consistency verbose?
netcode_create_manager Create NetworkManager + UnityTransport name?
netcode_configure_manager Bulk-edit NetworkConfig (TickRate, ConnectionApproval, EnableSceneManagement, NetworkTopology, ...) name?, 15+ optional fields
netcode_get_manager_info Read NetworkConfig + runtime state name?
netcode_remove_manager Delete the NetworkManager (must already be Shutdown) name?

Transport

Skill Purpose Key Parameters
netcode_set_transport_address Direct connection: set Address / Port / ServerListenAddress address, port, serverListenAddress?
netcode_set_relay_server_data Relay mode (mutually exclusive with direct connection) address, port, allocationIdBase64, keyBase64, connectionDataBase64, hostConnectionDataBase64?, isSecure?
netcode_set_debug_simulator Simulate latency / jitter / packet loss (development only) packetDelay, packetJitter, dropRate
netcode_get_transport_info Read current transport info name?

NetworkObject

Skill Purpose Key Parameters
netcode_add_network_object Attach NetworkObject to a GameObject name/instanceId/path + NetworkObject fields
netcode_configure_network_object Modify fields on an existing NetworkObject same as above
netcode_remove_network_object Remove a NetworkObject (must not be currently spawned) same as above
netcode_list_network_objects List all NetworkObjects in scene (including runtime state) includeInactive?
netcode_get_network_object_info Query a single NetworkObject in detail same as above

NetworkPrefabsList

Skill Purpose Key Parameters
netcode_create_prefabs_list Create a NetworkPrefabsList asset path, assignToManager?
netcode_add_to_prefabs_list Add a prefab (optional override: None/Prefab/Hash) listPath, prefabPath, overrideMode?, ...
netcode_remove_from_prefabs_list Remove a prefab entry listPath, prefabPath
netcode_list_network_prefabs List every entry with its hash listPath
netcode_set_player_prefab Set NetworkConfig.PlayerPrefab prefabPath, name?

Components

Skill Purpose Key Parameters
netcode_add_network_transform Attach NetworkTransform with axis sync toggles target + 15 optional fields
netcode_configure_network_transform Edit fields / thresholds on an existing NT includes PositionThreshold etc.
netcode_add_network_rigidbody Attach NetworkRigidbody / NetworkRigidbody2D useRigidbody2D?, useRigidBodyForMotion?
netcode_add_network_animator Attach NetworkAnimator (Animator required) target
netcode_add_network_behaviour_script Generate a NetworkBehaviour script template (OnNetworkSpawn/Despawn + optional RPC/NetworkVariable/Ownership) className, path, includeRpc?, includeNetworkVariable?, includeOwnershipCallbacks?
netcode_list_network_behaviours List NetworkBehaviour subclass instances in the scene includeInactive?

Scene & Spawning Query

Skill Purpose
netcode_configure_scene_management Set EnableSceneManagement / LoadSceneTimeOut / ClientSynchronizationMode
netcode_get_spawn_manager_info Runtime: list SpawnedObjects
netcode_get_scene_manager_info Runtime: read scene load state

Runtime Control (PlayMode required)

Skill Purpose
netcode_start_host Start Host
netcode_start_server Start Server
netcode_start_client Start Client
netcode_shutdown Shut down (optional discardMessageQueue)
netcode_get_status Read IsHost / IsServer / IsClient, LocalClientId, ConnectedClients, NetworkTime

Quick Start

import unity_skills as u

# 1. Inspect current state
u.call_skill("netcode_check_setup")

# 2. Create NetworkManager + UnityTransport
u.call_skill("netcode_create_manager", name="NetworkManager")

# 3. Configure the NetworkConfig
u.call_skill("netcode_configure_manager",
    tickRate=30,
    connectionApproval=False,
    enableSceneManagement=True,
    networkTopology="ClientServer")

# 4. Transport
u.call_skill("netcode_set_transport_address",
    address="127.0.0.1", port=7777, serverListenAddress="0.0.0.0")

# 5. Player prefab setup
#    NOTE: add_network_object on a prefab path depends on GameObjectFinder support.
#    Safer route: instantiate the prefab in the scene first, then attach.
u.call_skill("netcode_add_network_object", path="Assets/Prefabs/Player.prefab")
u.call_skill("netcode_create_prefabs_list", path="Assets/NetworkPrefabs.asset")
u.call_skill("netcode_add_to_prefabs_list",
    listPath="Assets/NetworkPrefabs.asset",
    prefabPath="Assets/Prefabs/Player.prefab")
u.call_skill("netcode_set_player_prefab", prefabPath="Assets/Prefabs/Player.prefab")

# 6. Generate a NetworkBehaviour template
u.call_skill("netcode_add_network_behaviour_script",
    className="PlayerController",
    path="Assets/Scripts/PlayerController.cs",
    includeRpc=True, includeNetworkVariable=True)

# 7. Drive the session in PlayMode
u.call_skill("editor_play")   # enter PlayMode
u.call_skill("netcode_start_host")
u.call_skill("netcode_get_status")
u.call_skill("netcode_shutdown")
u.call_skill("editor_stop")

Critical Rules (must read)

  1. Spawn/Despawn are not exposed as skills. They must be called from NetworkBehaviour runtime code (Server authority). Skills handle prefab registration and NetworkManager lifecycle only.
  2. PlayerPrefab must be in a NetworkPrefabsList (enforced at runtime on 2.x). Register it with netcode_add_to_prefabs_list.
  3. Runtime control skills (start_*/shutdown) require PlayMode. Calls from Edit Mode return an error.
  4. Address vs ServerListenAddress have different meaning. On a client, Address is the target server IP. On a server, ServerListenAddress is the bind address (usually 0.0.0.0).
  5. useRigidbody2D switches between NetworkRigidbody and NetworkRigidbody2D. Unrelated physics settings (e.g. Physics2D.AutoSyncTransforms) live elsewhere.

Version Scope

Targets NGO 2.x (validated against 2.11.0). Legacy 1.x (old prefabs list layout, different RPC model) is out of scope for this module.

Exact Signatures

For exact parameter names, defaults, and return fields, query GET /skills/schema or unity_skills.get_skill_schema(). This document is a routing and best-practice guide, not the authoritative signature source.

用于Unity项目资源优化,支持批量压缩纹理、网格和音频,分析场景面数与材质用量。涵盖读写型技能,需审批或自动执行,旨在缩减包体体积并提升性能。
用户要求缩减包体大小 需要批量压缩纹理、网格或音频资源 用户提及“优化资源”或“包体太大” 需要分析场景多边形数量或材质使用量
SkillsForUnity/unity-skills~/skills/optimization/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-optimization -g -y
SKILL.md
Frontmatter
{
    "name": "unity-optimization",
    "description": "Optimize project assets and scenes — batch texture\/mesh\/audio compression and analyze poly\/material counts. Use when reducing build size, batch-compressing assets, or analyzing scene poly and material usage for optimization, even if the user just says \"优化资源\" or \"包体太大\". 优化工程资源与场景(批量压缩 texture\/mesh\/audio、分析面数\/材质数);当用户要缩减包体、批量压缩资源、或分析场景面数与材质用量以优化时使用。"
}

Optimization Skills

Optimize project assets (Textures, Models).

Operating Mode

  • Approval: 只读分析类 skill(optimize_analyze_scene / optimize_find_large_assets / optimize_get_static_flags / optimize_find_duplicate_materials / optimize_analyze_overdraw,标 SkillMode.SemiAuto)直接执行;写型 skill(optimize_textures / optimize_mesh_compression / optimize_audio_compression / optimize_set_static_flags / optimize_set_lod_group,默认 SkillMode.FullAuto)需用户 grant,grant 后一步执行返结果。
  • Auto / Bypass: 直接执行。
  • 本模块不含 Delete / PlayMode / Reload / RiskLevel=high 类 skill —— 写型 skill 改的是 Importer / 组件设置,会重新导入资源,但不会触发 Domain Reload,也不会被 IsForbiddenInSemi 拦截。批量操作前务必检查筛选范围(filter / assetType),改完无 dry-run 回滚。

DO NOT (common hallucinations):

  • optimize_scene / optimization_run do not exist → use specific skills: optimize_analyze_scene, optimize_find_large_assets, optimize_find_duplicate_materials, etc.
  • optimize_compress / optimize_compress_textures / optimize_compress_meshes / optimize_compress_audio do not exist → use optimize_textures (textures), optimize_mesh_compression (meshes), optimize_audio_compression (audio)
  • optimize_set_lod / optimize_setup_lod do not exist → use optimize_set_lod_group
  • Optimization skills are analysis + action tools — always review results before applying batch changes

Routing:

  • For profiler metrics → use profiler module
  • For static batching flags → optimize_set_static_flags (this module)
  • For performance review guidance → load performance advisory module

Skills

optimize_textures

Optimize texture settings (maxSize, compression). Returns list of modified textures.

Parameter Type Required Default Description
maxTextureSize int No 2048 Max texture size
enableCrunch bool No true Enable crunch compression
compressionQuality int No 50 Compression quality 0-100
filter string No "" Asset filter

Returns: { success, count, message, modified }

optimize_mesh_compression

Set mesh compression for 3D models.

Parameter Type Required Default Description
compressionLevel string No "Medium" Compression level: Off/Low/Medium/High
filter string No "" Asset filter

Returns: { success, count, compression, modified }

optimize_analyze_scene

Analyze scene for performance bottlenecks (high-poly meshes, excessive materials).

Parameter Type Required Default Description
polyThreshold int No 10000 Triangle count threshold for high-poly warning
materialThreshold int No 5 Material slot count threshold for excessive materials warning

Returns: { success, totalRenderers, totalTriangles, totalMaterialSlots, issueCount, issues }

optimize_find_large_assets

Find assets exceeding a size threshold (in KB).

Parameter Type Required Default Description
thresholdKB int No 1024 Size threshold in KB
assetType string No "" Asset type filter (e.g. Texture2D, AudioClip)
limit int No 50 Maximum number of results

Returns: { success, threshold, count, assets }

optimize_set_static_flags

Set static flags on GameObjects. flags: Everything/Nothing/BatchingStatic/OccludeeStatic/OccluderStatic/NavigationStatic/ReflectionProbeStatic

Parameter Type Required Default Description
name string No null GameObject name
instanceId int No 0 GameObject instance ID
path string No null GameObject hierarchy path
flags string No "Everything" Static flags to set
includeChildren bool No false Apply to all children recursively

Returns: { success, gameObject, flags, affectedCount }

optimize_get_static_flags

Get static flags of a GameObject.

Parameter Type Required Default Description
name string No null GameObject name
instanceId int No 0 GameObject instance ID
path string No null GameObject hierarchy path

Returns: { success, gameObject, flags, isStatic }

optimize_audio_compression

Batch set audio compression. compressionFormat: PCM/Vorbis/ADPCM. loadType: DecompressOnLoad/CompressedInMemory/Streaming

Parameter Type Required Default Description
compressionFormat string No "Vorbis" Audio compression format: PCM/Vorbis/ADPCM
loadType string No "CompressedInMemory" Audio load type: DecompressOnLoad/CompressedInMemory/Streaming
quality float No 0.5 Compression quality 0.0-1.0
filter string No "" Asset filter

Returns: { success, count, compressionFormat, loadType, modified }

optimize_find_duplicate_materials

Find materials with identical shader and properties.

Parameter Type Required Default Description
limit int No 50 Maximum number of duplicate groups to return

Returns: { success, duplicateGroups, groups }

optimize_analyze_overdraw

Analyze transparent objects that may cause overdraw.

Parameter Type Required Default Description
limit int No 50 Maximum number of results

Returns: { success, transparentObjectCount, objects }

optimize_set_lod_group

Add or configure LOD Group. lodDistances: comma-separated screen-relative heights (e.g. '0.6,0.3,0.1')

Parameter Type Required Default Description
name string No null GameObject name
instanceId int No 0 GameObject instance ID
path string No null GameObject hierarchy path
lodDistances string No "0.6,0.3,0.1" Comma-separated screen-relative transition heights

Returns: { success, gameObject, lodLevels, distances }


Exact Signatures

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

管理Unity UPM包,支持安装、移除、刷新、搜索及检查版本。涵盖Cinemachine等快捷配置,处理异步导入与重载,提供查询与操作技能,需遵循特定权限与安全限制。
添加或移除UPM包 检查已装包版本 搜索注册表 脚本化包操作 快速设置Cinemachine
SkillsForUnity/unity-skills~/skills/package/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-package -g -y
SKILL.md
Frontmatter
{
    "name": "unity-package",
    "description": "Manage Unity Package Manager (UPM) — install, remove, refresh, search, inspect, and list packages. Use when adding or removing UPM packages, checking installed versions, searching the registry, or scripting package operations, even if the user just says \"装个包\" or \"UPM\". 管理 Unity Package Manager(UPM:安装、移除、刷新、搜索、查看、列出包);当用户要添加或移除 UPM 包、检查已装版本、搜索 registry、或脚本化包操作时使用。"
}

Package Skills

Manage installed Unity packages and package-related helper flows such as Cinemachine and Splines setup.

Guardrails

Operating Mode (v1.9 three-tier):

  • Approval (default): query skills (package_list, package_check, package_search, package_get_dependencies, package_get_versions, package_get_cinemachine_status) run directly. Mutators (package_install, package_remove, package_install_cinemachine, package_install_splines, package_refresh) are FullAuto — on MODE_RESTRICTED, run the grant protocol.
  • Auto / Bypass: SemiAuto and FullAuto run directly.
  • Auto-forbidden in this module: package_install and package_remove (MayTriggerReload = true, RiskLevel = "high"; package_remove also carries SkillOperation.Delete). They are reachable only under Bypass mode or via a user-managed Allowlist entry; the grant flow returns MODE_FORBIDDEN.
  • Install/remove/refresh jobs return immediately with a jobId; the actual package import + Domain Reload happens asynchronously and may make the REST server transiently unavailable. Poll with job_status / job_wait.

DO NOT (common hallucinations):

  • package_add / package_update do not exist -> use package_install
  • package_get_info does not exist -> use package_list, package_check, package_get_dependencies, or package_get_versions
  • package_search searches the installed package cache only; it does not query the Unity Registry
  • package_list, package_search, package_get_dependencies, and package_get_versions can return "Package list not ready" until package_refresh completes
  • Package install/remove/refresh jobs can trigger package import and Domain Reload; expect transient server unavailability and use returned job IDs

Routing:

  • For Cinemachine quick setup -> use package_install_cinemachine
  • For Splines quick setup -> use package_install_splines
  • For project manifest inspection -> use project_get_packages
  • For define symbol changes after package installation -> use debug_set_defines

Skills

package_list

List all installed packages currently cached by UnitySkills. Parameters: None.

Returns: { success, count, packages }

package_check

Check whether a package is installed.

Parameter Type Required Default Description
packageId string Yes - Package ID such as com.unity.cinemachine

Returns: { packageId, installed, version }

package_install

Install a package. Returns an async job when the request is accepted.

Parameter Type Required Default Description
packageId string Yes - Package ID to install
version string No null Optional explicit version

Returns: { success, status, jobId, message, serverAvailability }

package_remove

Remove an installed package. Returns an async job when the request is accepted.

Parameter Type Required Default Description
packageId string Yes - Installed package ID to remove

Returns: { success, status, jobId, message, serverAvailability }

package_refresh

Refresh the installed package cache used by query skills. Parameters: None.

Returns: { success, status, jobId, message }

package_install_cinemachine

Install Cinemachine using the supported package/version strategy.

Parameter Type Required Default Description
version int No 3 2 for CM2, 3 for CM3

Notes:

  • CM3 auto-installs the Splines dependency.
  • If the requested line is already installed, this skill can return immediate success instead of a job.

Returns: { success, status?, jobId?, message, serverAvailability? }

package_install_splines

Install or upgrade Unity Splines using the recommended version for the current Unity editor line. Parameters: None.

Returns: { success, status?, jobId?, message, serverAvailability? }

package_get_cinemachine_status

Get current Cinemachine and Splines installation status. Parameters: None.

Returns: { cinemachine, splines }

package_search

Search the installed package cache by package name or display name.

Parameter Type Required Default Description
query string Yes - Search keyword

Returns: { success, query, count, packages }

package_get_dependencies

Get dependency information for one installed package.

Parameter Type Required Default Description
packageId string Yes - Installed package ID

Returns: { success, packageId, version, dependencyCount, dependencies }

package_get_versions

Get available versions for one installed package.

Parameter Type Required Default Description
packageId string Yes - Installed package ID

Returns: { success, packageId, currentVersion, compatibleVersion, latestVersion, allVersions }

Exact Signatures

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

为Unity设计模式选择提供建议,涵盖ScriptableObject、事件系统、状态机等。指导用户判断何种模式适合特定问题或用于构建解耦系统,并在不同方案间进行权衡决策。
询问使用何种设计模式 判断是否该用状态机 在事件/状态机/对象池方案间抉择 构建解耦系统
SkillsForUnity/unity-skills~/skills/patterns/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-patterns -g -y
SKILL.md
Frontmatter
{
    "name": "unity-patterns",
    "description": "Advises on choosing Unity design patterns — ScriptableObject, event systems, state machines, object pooling, observer, and more. Use when deciding which pattern fits a problem, structuring decoupled systems, or choosing between event\/state-machine\/pool approaches, even if the user just asks \"用什么模式\" or \"该用状态机吗\". 为选择 Unity 设计模式提供建议(ScriptableObject、事件系统、状态机、对象池、观察者等);当用户要判断哪种模式适合某问题、构建解耦系统、或在事件\/状态机\/对象池方案间抉择时使用。"
}

Unity Pattern Selector

Use this skill to decide whether a pattern is justified. Do not recommend every pattern at once.

Guardrails

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

  • Recommend at most 1-3 patterns, and explain why simpler options are not enough.

Pattern Guide

  • ScriptableObject

    • Use for authored config, shared static data, event channels, and reusable data assets.
    • Avoid as the default home for per-run mutable gameplay state.
  • C# events / delegates

    • Use for one-to-many notifications with clear ownership and unsubscribe points.
    • Avoid for imperative flows that need ordering, return values, or complex debugging.
  • Global event bus / observer hub

    • Use sparingly and only when many systems truly need broad decoupled notifications.
    • Avoid as the default answer to coupling. It often hides ownership and makes debugging harder.
  • Interfaces

    • Use when multiple implementations or clearer dependency boundaries are needed.
    • Avoid adding interfaces around every class without a real seam.
  • State machine

    • Use for actors with mutually exclusive states and explicit transitions.
    • Avoid when a few booleans or a small command flow is enough.
  • Object pool

    • Use for frequent spawn/despawn of bullets, VFX, enemies, UI items.
    • Avoid for rare objects or when lifetime is simple.
  • Service layer

    • Use for a small number of cross-scene systems with explicit bootstrap and interfaces.
    • Avoid turning everything into hidden singletons or service locators.
  • Generics / custom attributes

    • Use when they remove repeated boilerplate with clear type safety or editor metadata value.
    • Avoid when they make gameplay code harder to read than duplicated simple code.

Decision Lab: Same Goal, Multiple Implementations

The Pattern Guide above answers "which pattern?". For most non-trivial design decisions, the better exercise is: pick the 2-3 plausible implementations, put them side by side, and compare on switch cost, query cost, code complexity, and failure modes. Below is a worked example; use it as the shape for other decisions rather than as the answer.

Worked example: "Pause AI on 100 enemies for a cutscene"

Implementation Switch cost (enter/exit cutscene) Per-frame cost while paused Code complexity Failure modes
Field flag: each EnemyAI.Update starts with if (_paused) return;; manager sets the flag O(N) writes, no allocations N branch tests + dispatch overhead per frame Lowest — one bool, one guard clause Silent bugs when a dev adds a new Update and forgets the guard
enabled = false: manager disables the MonoBehaviour on every enemy O(N) writes, no allocations Zero — Unity skips disabled Behaviours in its message list Low, but state spread across components OnDisable / OnEnable side effects (coroutines stop, listeners unsubscribe) may fire unexpectedly
Subset list: manager keeps _active / _frozen lists; no per-enemy Update — manager ticks only _active O(N) list move on switch Proportional to _active count only — perfect early-cull Highest — one source of truth for ownership, requires managed ticking Adding a new Update on enemies reintroduces per-frame cost; the list is easy to desync if other code respawns enemies directly

How to use

  • Pick the smallest scale where the trade-off matters. At N=5 all three are indistinguishable; at N=5000 only the subset list stays flat.
  • State what gets worse under each option, not only what improves. A table with only upsides is a sign you haven't thought about it yet.
  • The ECS lesson is that the same three shapes (value change, structural change, enableable) show up everywhere — the labels transfer even when the framework does not. Source: Dots101/Entities101/Assets/HelloCube/13. StateChange/SetStateSystem.cs:42-80 — one system dispatches to three implementations behind config.Mode, each with measurably different cost in the profiler.

When to skip this exercise

If one option is obviously bounded (N ≤ 10, state changes once per session, or the code runs once at startup), a single paragraph "we picked X because it's simplest" is enough. Decision Lab is for choices that will outlive the current task.

Output Format

  • Recommended pattern(s)
  • Why they fit this case
  • Why not the simpler alternative
  • Minimal implementation boundary
  • Known tradeoffs
提供Unity场景、项目及脚本的只读分析能力,用于AI编码前收集上下文。涵盖结构分析、技术栈探测、健康检查及热点定位等,辅助理解陌生项目或审查结构,不执行修改操作。
用户要求分析场景结构 用户希望了解项目技术栈 进行代码编辑前的上下文收集 对陌生场景或项目进行审计
SkillsForUnity/unity-skills~/skills/perception/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-perception -g -y
SKILL.md
Frontmatter
{
    "name": "unity-perception",
    "description": "Read-only scene, project, and script analysis for AI coding context — analyze scene structure, detect the project stack, run health checks, and find hotspots. Use when gathering context before editing, understanding an unfamiliar scene or project, or auditing structure without making changes, even if the user just says \"分析一下场景\" or \"看看项目结构\". 只读的场景\/项目\/脚本分析,为 AI 编码提供上下文(分析场景结构、探测项目技术栈、健康检查、定位热点);当用户要在编辑前收集上下文、理解陌生场景或项目、或在不改动的前提下审查结构时使用。"
}

Unity Perception Skills

Use this module for read-only scene and project analysis.

Operating Mode

  • Approval / Auto / Bypass: 本模块所有 skill(scene_analyze / scene_summarize / scene_health_check / scene_component_stats / scene_find_hotspots / scene_tag_layer_stats / scene_performance_hints / scene_diff / hierarchy_describe / scene_context / scene_dependency_analyze / scene_spatial_query / scene_materials / scene_contract_validate / project_stack_detect / script_analyze / script_dependency_graph / scene_export_report)都标 Mode = SkillMode.SemiAuto,三档模式下直接执行无需 grant。其中前 17 个同时标 ReadOnly = true
  • 特别说明scene_export_report 写 markdown 文件到磁盘(Operation = Analyze | Execute,未标 ReadOnly),但仍标了 SkillMode.SemiAuto,Approval 模式可直接执行。
  • 本模块不含 Delete / PlayMode / Reload / RiskLevel=high 类 skill —— 没有 IsForbiddenInSemi 拦截。

DO NOT (common hallucinations):

  • perception_analyze, perception_scan, and perception_describe do not exist
  • scene_context is not editor_get_context: it exports hierarchy/components/references, while editor context focuses on current editor state
  • scene_analyze, scene_health_check, scene_contract_validate, scene_component_stats, scene_find_hotspots, and project_stack_detect belong to this module even if the prefix looks like scene_* or project_*

Routing:

  • Current selection/play-mode/editor state -> editor_get_context
  • Object search by name/path -> scene_find_objects or gameobject_find
  • Script dependency closure -> script_dependency_graph

Skills

Scene Health and Summary

Skill Use Key parameters
scene_analyze Combined scene + project analysis topComponentsLimit?, issueLimit?, deepHierarchyThreshold?, largeChildCountThreshold?
scene_health_check Read-only health report issueLimit?, deepHierarchyThreshold?, largeChildCountThreshold?
scene_summarize Structured scene summary includeComponentStats?, topComponentsLimit?
scene_component_stats Component and facility stats topComponentsLimit?
scene_find_hotspots Deep hierarchy / large group / empty node hotspots thresholds + maxResults?
scene_tag_layer_stats Tag/layer usage none
scene_performance_hints Prioritized optimization hints none

Scene Snapshots and Exports

Skill Use Key parameters
scene_diff Capture or compare lightweight snapshots snapshotJson?
hierarchy_describe Return text hierarchy tree maxDepth?, includeInactive?, maxItemsPerLevel?
scene_context Export hierarchy, components, references maxDepth?, maxObjects?, rootPath?, includeValues?, includeReferences?, includeCodeDeps?
scene_export_report Save markdown scene report savePath?, maxDepth?, maxObjects?
scene_dependency_analyze Analyze impact / dependency graph in-scene targetPath?, savePath?

Project and Script Analysis

Skill Use Key parameters
project_stack_detect Detect pipeline, input, UI, packages, tests, folders none
script_analyze Analyze one MonoBehaviour / ScriptableObject / user class by class name scriptName, includePrivate?
script_dependency_graph N-hop dependency closure for one script class name scriptName, maxHops?, includeDetails?

Spatial and Material Queries

Skill Use Key parameters
scene_spatial_query Find objects near a point or object x/y/z?, radius?, nearObject?, componentFilter?, maxResults?
scene_materials Summarize scene materials and shaders includeProperties?
scene_contract_validate Validate default roots/tags/layers/UI EventSystem conventions requiredRootsJson?, requiredTagsJson?, requiredLayersJson?, requireEventSystemForUi?

High-Frequency Skill Differences

scene_summarize vs scene_analyze vs scene_health_check

Skill Best for Typical output focus
scene_summarize Fast overview object counts, hierarchy depth, top components
scene_analyze Broad diagnosis summary + findings + warnings + recommendations + next-skill hints
scene_health_check Hygiene / red flags missing scripts, duplicate names, deep hierarchy, empty nodes, hotspot-style findings

scene_context vs hierarchy_describe

Skill Best for Output style
hierarchy_describe Human-readable tree text tree, lightweight
scene_context AI coding context structured hierarchy + components + references + optional code dependencies

scene_dependency_analyze vs script_dependency_graph

Skill Scope Use when
scene_dependency_analyze Scene object references ask "who depends on this object if I delete or disable it"
script_dependency_graph Script class dependency closure ask "which scripts do I have to touch to change this feature"

Key Return Shapes

scene_summarize

Returns sceneName, stats, and optional topComponents.

scene_analyze

Returns summary, stats, findings, warnings, recommendations, and suggestedNextSkills.

scene_health_check

Returns summary, findings, hotspots, and suggestedNextSkills.

scene_context

Returns a structured export with objects, references, and optional codeDependencies. Use it when another AI step needs full scene context, not just a human summary.

High-frequency options:

  • rootPath to export only one subtree
  • includeValues=true when serialized field values matter
  • includeCodeDeps=true when AI needs a rough scene-to-code dependency picture

scene_export_report

Writes a markdown artifact to disk and returns savedTo, object/script/reference counts, and success state. Prefer this when the user wants a durable report file.

Defaults:

  • savePath = "Assets/Docs/SceneReport.md"
  • maxDepth = 10
  • maxObjects = 500

When to Use Which Skill

Need Best first skill
Quick scene overview scene_summarize
Full diagnosis scene_analyze
Suspicious hierarchy or clutter scene_find_hotspots
Safe-to-delete / impact question scene_dependency_analyze
AI coding context export scene_context
Script reading order script_dependency_graph
Render/input/UI stack detection project_stack_detect

Minimal Example

import unity_skills

summary = unity_skills.call_skill("scene_summarize", includeComponentStats=True)
health = unity_skills.call_skill("scene_health_check", issueLimit=50)
context = unity_skills.call_skill("scene_context", maxDepth=6, maxObjects=120)
report = unity_skills.call_skill("scene_export_report", savePath="Assets/Docs/SceneReport.md")

Exact Signatures

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

诊断Unity性能问题,审查Update循环、内存分配、GC压力及对象池使用。识别隐藏成本如序列化开销、随机数相关性冗余日志等,提供优化建议以解决卡顿和掉帧。
用户询问游戏卡顿或掉帧原因 需要审查Unity代码性能红线 计划实施对象池或减少内存分配 分析GC压力或热路径优化
SkillsForUnity/unity-skills~/skills/performance/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-performance -g -y
SKILL.md
Frontmatter
{
    "name": "unity-performance",
    "description": "Advises on Unity performance red flags — Update\/allocation\/pooling\/physics hot paths, frame drops, and GC pressure. Use when reviewing performance, diagnosing frame drops or stutter, reducing allocations, or planning pooling\/optimization, even if the user just says \"太卡了\" or \"怎么优化\". 为 Unity 性能红线提供建议(Update\/分配\/对象池\/物理热路径、掉帧、GC 压力);当用户要做性能审查、诊断掉帧或卡顿、减少内存分配、或规划对象池\/优化时使用。"
}

Unity Performance Red Flags

Use this skill for a high-signal review of likely Unity performance issues. Focus on red flags, not speculative micro-optimizations.

Check For

  • Too many unrelated Update / LateUpdate / FixedUpdate loops
  • Repeated Find, GetComponent, Camera.main, or tag lookups in hot paths
  • Frequent Instantiate / Destroy suitable for pooling
  • Avoidable per-frame allocations:
    • LINQ
    • string formatting
    • closures
    • boxing
  • Reflection in runtime hot paths
  • Expensive editor-only helpers leaking into runtime code
  • Physics, animation, or UI updates happening at the wrong cadence

Hidden Costs: Possibility ≠ Actuality

Three counter-intuitive traps where what seems "free" is actually expensive. Each cost is paid for possibility of work, not for work actually performed — which is why profilers rarely catch them directly.

Write permission costs, even without writing

A component whose Update can mutate transform.position pays the cost whether the branch runs or not: dirty-flag and serialization systems treat write permission as a reason to poll every frame. Similarly, a [SerializeField] field that is never modified at runtime still sits on the serialization path. The fix is to remove the permission, not tighten the branch — split the rarely-needed writer into its own component and AddComponent only when needed. Source: NetcodeSamples/HelloNetcode/2_Intermediate/07_Optimization/Optimization.md — "a system with the possibility of writing to a component, regardless of whether it writes to it or not, will always have to be serialized".

Sequential seeds produce correlated random streams

Seeding N RNG instances with baseSeed + i gives N similar streams — patrol paths line up, spawn jitter clumps, loot rolls cluster. Hash the index before seeding:

// Wrong — N correlated streams
for (int i = 0; i < N; i++) rngs[i] = new System.Random(baseSeed + i);

// Correct — hash decorrelates adjacent seeds
for (int i = 0; i < N; i++)
    rngs[i] = new System.Random((int)((uint)baseSeed * 2654435761u ^ (uint)i));

Unity.Mathematics.Random.CreateFromIndex(i) applies this internally and is preferred when the math package is available. Source: Dots101/Entities101/Assets/HelloCube/3. Prefabs/SpawnSystem.cs:37-39 and its comment.

Logging fires in release builds by default

Debug.Log is not stripped in Player builds; only methods marked [Conditional("UNITY_EDITOR")] (such as Debug.DrawLine) have their arguments elided at the call site. That means a log line with interpolation or helper calls runs every frame in shipped games:

// Wrong — GetPlayerInfo() and string interpolation execute in release
Debug.Log($"Player {GetPlayerInfo()} at {Time.time}");

// Better — guard the whole expression
if (Debug.isDebugBuild) Debug.Log($"Player {GetPlayerInfo()} at {Time.time}");

The same principle as the "possibility write" rule above — the runtime pays for the possibility of work, not only for the work.

Output Format

  • Confirmed red flags
  • Likely red flags
  • Changes worth doing now
  • Changes not worth doing now
  • Expected gain category: clarity / frame time / GC / scalability

Guardrails

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

  • Do not recommend large refactors without a meaningful hotspot.
  • Do not replace simple code with unreadable “optimized” code unless the hot path is real.
提供Unity编辑器期的物理查询与配置功能,支持射线检测、重叠检查、重力设置及材质管理。适用于单帧物理查询和全局参数调整,不包含组件添加或模拟运行。
射线检测 物理设置 碰撞体查询 重力调整
SkillsForUnity/unity-skills~/skills/physics/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-physics -g -y
SKILL.md
Frontmatter
{
    "name": "unity-physics",
    "description": "Run Unity physics queries and configure physics at editor time — raycasts, overlap checks, gravity, and physics settings. Use when casting rays, testing overlaps, querying colliders, or adjusting gravity\/physics settings, even if the user just says \"射线检测\" or \"物理设置\". 执行 Unity 物理查询并在编辑器期配置物理(raycast、overlap 检测、重力、物理设置);当用户要发射射线、检测重叠、查询碰撞体、或调整重力\/物理设置时使用。"
}

Physics Skills

Editor-time physics queries (raycast / overlap), gravity, PhysicMaterial assets, and layer collision matrix.

Operating Mode

  • Approval:查询类 skill(physics_raycast / physics_check_overlap / physics_get_gravity / physics_get_layer_collision 等,源码标 SkillMode.SemiAuto)直接执行;变更类(physics_set_gravity / physics_create_material / physics_set_material / physics_set_layer_collision,标 SkillMode.FullAuto)需用户 grant,grant 后服务端一步执行返结果。
  • Auto / Bypass:所有 skill 直接执行;Auto 走 AI 自我评估,Bypass 全放行。
  • 本模块不含 Delete / PlayMode / Reload / 高危 skill,无 Bypass-only 拦截项。
  • 注意:所有 skill 都在编辑器线程同步运行。真实物理模拟(积分、碰撞响应)仅在 Play mode 下推进;本模块只做单帧 query + 资产/全局设置写入,不会启动模拟。

DO NOT (common hallucinations):

  • physics_add_rigidbody / physics_add_collider do not exist → use component_add with componentType "Rigidbody"/"BoxCollider"/etc.
  • physics_simulate does not exist → physics simulation runs during Play mode; this module does not step the simulation
  • Raycast results use world-space coordinates

Routing:

  • For adding physics components → use component module
  • For physics material → use physics_create_material (this module)
  • For layer collision matrix → physics_set_layer_collision (this module)

Skills

physics_raycast

Cast a ray and get hit info. Parameters:

  • originX, originY, originZ (float): Origin point.
  • dirX, dirY, dirZ (float): Direction vector.
  • maxDistance (float, optional): Max distance (default 1000).
  • layerMask (int, optional): Layer mask (default -1).

Returns: { hit: true, collider: "Cube", distance: 5.2, ... }

physics_check_overlap

Check for colliders in a sphere. Parameters:

  • x, y, z (float): Center point.
  • radius (float): Sphere radius.
  • layerMask (int, optional): Layer mask.

physics_get_gravity

Get global gravity setting. Parameters: None.

physics_set_gravity

Set global gravity setting. Parameters:

  • x, y, z (float): Gravity vector (e.g. 0, -9.81, 0).

physics_raycast_all

Cast a ray and return ALL hits (penetrating).

Parameter Type Required Default Description
originX float Yes - Ray origin X
originY float Yes - Ray origin Y
originZ float Yes - Ray origin Z
dirX float Yes - Direction X
dirY float Yes - Direction Y
dirZ float Yes - Direction Z
maxDistance float No 1000 Max ray distance
layerMask int No -1 Layer mask filter

Returns: { count, hits: [{ objectName, instanceId, path, point, normal, distance }] }

physics_spherecast

Cast a sphere along a direction and get hit info.

Parameter Type Required Default Description
originX float Yes - Origin X
originY float Yes - Origin Y
originZ float Yes - Origin Z
dirX float Yes - Direction X
dirY float Yes - Direction Y
dirZ float Yes - Direction Z
radius float Yes - Sphere radius
maxDistance float No 1000 Max cast distance
layerMask int No -1 Layer mask filter

Returns: { hit, objectName, instanceId, point, distance }

physics_boxcast

Cast a box along a direction and get hit info.

Parameter Type Required Default Description
originX float Yes - Origin X
originY float Yes - Origin Y
originZ float Yes - Origin Z
dirX float Yes - Direction X
dirY float Yes - Direction Y
dirZ float Yes - Direction Z
halfExtentX float No 0.5 Box half extent X
halfExtentY float No 0.5 Box half extent Y
halfExtentZ float No 0.5 Box half extent Z
maxDistance float No 1000 Max cast distance
layerMask int No -1 Layer mask filter

Returns: { hit, objectName, instanceId, point, distance }

physics_overlap_box

Check for colliders overlapping a box volume.

Parameter Type Required Default Description
x float Yes - Box center X
y float Yes - Box center Y
z float Yes - Box center Z
halfExtentX float No 0.5 Box half extent X
halfExtentY float No 0.5 Box half extent Y
halfExtentZ float No 0.5 Box half extent Z
layerMask int No -1 Layer mask filter

Returns: { count, colliders: [{ objectName, path, isTrigger }] }

physics_create_material

Create a PhysicMaterial asset.

Parameter Type Required Default Description
name string No "New PhysicMaterial" Material name
savePath string No "Assets" Save directory path
dynamicFriction float No 0.6 Dynamic friction value
staticFriction float No 0.6 Static friction value
bounciness float No 0 Bounciness value

Returns: { success, path }

physics_set_material

Set PhysicMaterial on a collider (supports name/instanceId/path).

Parameter Type Required Default Description
materialPath string Yes - Asset path of the PhysicMaterial
name string No null GameObject name
instanceId int No 0 GameObject instance ID
path string No null GameObject hierarchy path

Returns: { success, gameObject, material }

physics_get_layer_collision

Get whether two layers collide.

Parameter Type Required Default Description
layer1 int Yes - First layer index
layer2 int Yes - Second layer index

Returns: { layer1, layer2, collisionEnabled }

physics_set_layer_collision

Set whether two layers collide.

Parameter Type Required Default Description
layer1 int Yes - First layer index
layer2 int Yes - Second layer index
enableCollision bool No true Whether to enable collision

Returns: { success, layer1, layer2, collisionEnabled }


Minimal Example

import unity_skills

# Raycast from position downward, check for hits
result = unity_skills.call_skill("physics_raycast",
    originX=0, originY=5, originZ=0,
    dirX=0, dirY=-1, dirZ=0,
    maxDistance=10
)
if result.get("hit"):
    print(f"Hit: {result['hitObjectName']} at distance {result['distance']}")

Exact Signatures

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

用于在 URP/HDRP VolumeProfile 上配置现代 SRP 后处理,支持添加与调校泛光、色调映射、景深等效果。适用于搭建后处理、向 VolumeProfile 添加效果或调整场景视觉风格。
配置现代 SRP 后处理 向 VolumeProfile 添加效果 调整 URP/HDRP 场景观感 用户提到“后处理”或“加个泛光”
SkillsForUnity/unity-skills~/skills/postprocess/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-postprocess -g -y
SKILL.md
Frontmatter
{
    "name": "unity-postprocess",
    "description": "Configure modern SRP post-processing on URP\/HDRP VolumeProfiles — add and tune effects like bloom, tonemapping, and color grading. Use when setting up post-processing, adding effects to a VolumeProfile, or tuning the look of a URP\/HDRP scene, even if the user just says \"后处理\" or \"加个泛光\". 在 URP\/HDRP VolumeProfile 上配置现代 SRP 后处理(添加与调校泛光、色调映射、调色等效果);当用户要搭建后处理、向 VolumeProfile 添加效果、或调整 URP\/HDRP 场景观感时使用。"
}

PostProcess Skills

Modern URP / HDRP post-processing skills built on top of the SRP Volume framework. For Volume container / profile CRUD (volume_profile_create, volume_create, etc.), use the volume module.

Operating Mode

  • Query skills (postprocess_list_effects, postprocess_get_effect) are SkillMode.SemiAuto — they run in all three modes without grant.
  • Mutating skills (postprocess_add_effect, postprocess_set_parameter, postprocess_set_bloom, postprocess_set_depth_of_field, postprocess_set_tonemapping, postprocess_set_vignette, postprocess_set_color_adjustments) are SkillMode.FullAuto — under Approval they need user grant (grant triggers one server-side execute returning the result); under Auto / Bypass they execute directly.
  • postprocess_remove_effect carries SkillOperation.Delete and is auto-forbidden in Approval / Auto modes (NeverInSemi). Only Bypass or the user-managed Allowlist can run it.

SRP Package Stub

This module is compiled against com.unity.render-pipelines.core (SRP_CORE). When neither URP nor HDRP is installed (no SRP Core), every skill returns a stub { error: "Scriptable Render Pipeline Core package … is not installed." } (RenderPipelineSkillsCommon.NoSRP()). The stub is a diagnostic payload, not a permission denial — it does not require grant and is not treated as NeverInSemi.

Guardrails

DO NOT:

  • Use this module for PPv2 / com.unity.postprocessing
  • Use this module for general Volume container/profile management; use volume

Runtime-first rules:

  • Always call postprocess_list_effects before assuming an effect exists on the active pipeline
  • Use postprocess_get_effect or volume_get_component to inspect real parameter names before setting generic parameters
  • Prefer the dedicated high-frequency skills (postprocess_set_bloom, postprocess_set_depth_of_field, etc.) over guessing generic parameter names
  • Treat URP and HDRP parameter surfaces as similar-but-not-identical; do not reuse names blindly across pipelines

Skills

postprocess_list_effects

List modern SRP post-processing effects supported by the active pipeline.

postprocess_add_effect

Add a post-processing effect override to a VolumeProfile.

postprocess_remove_effect

Remove a post-processing effect override from a VolumeProfile.

postprocess_get_effect

Inspect a post-processing effect override.

postprocess_set_parameter

Set one parameter on a post-processing effect override.

postprocess_set_bloom

Configure Bloom.

postprocess_set_depth_of_field

Configure Depth Of Field.

postprocess_set_tonemapping

Configure Tonemapping.

postprocess_set_vignette

Configure Vignette.

postprocess_set_color_adjustments

Configure Color Adjustments.


Exact Signatures

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

管理Unity预制体,支持创建、实例化(含批量)、应用覆盖、解包、查找实例、编辑资产及创建变体。提供读写分离模式与常见错误规避指南。
处理预制体相关操作 实例化或应用预制体改动 在场景中查找实例 创建预制体变体 用户说'做成预制体'或'prefab'
SkillsForUnity/unity-skills~/skills/prefab/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-prefab -g -y
SKILL.md
Frontmatter
{
    "name": "unity-prefab",
    "description": "Manage Prefabs — create, instantiate, apply overrides, unpack, find instances, edit prefab assets, and create variants. Use when working with prefabs, instantiating or applying prefab changes, finding instances in scenes, or creating prefab variants, even if the user just says \"做成预制体\" or \"prefab\". 管理 Prefab(创建、实例化、应用覆盖、解包、查找实例、编辑预制体资产、创建变体);当用户要处理预制体、实例化或应用预制体改动、在场景中查找实例、或创建预制体变体时使用。"
}

Unity Prefab Skills

BATCH-FIRST: Use prefab_instantiate_batch when spawning 2+ prefab instances.

Operating Mode

Approval 模式下本模块为 Mixed —— 只读 skill prefab_get_overrides / prefab_find_instances(标 ReadOnly = true, Mode = SkillMode.SemiAuto)可直接执行;其余 9 个写类 skill (prefab_create / prefab_instantiate / prefab_instantiate_batch / prefab_apply / prefab_unpack / prefab_revert_overrides / prefab_apply_overrides / prefab_create_variant / prefab_set_property) 为 SkillMode.FullAuto,需用户 grant 单次执行返结果。Auto / Bypass 直接执行。本模块不含 NeverInSemi 高危 skill(无 Delete / PlayMode / Reload)。

DO NOT (common hallucinations):

  • prefab_create_from_object does not exist → use prefab_create (takes scene object name/instanceId and savePath)
  • prefab_spawn does not exist → use prefab_instantiate
  • prefab_edit / prefab_modify do not exist → use prefab_set_property (edit prefab asset directly) or instantiate, modify, then prefab_apply
  • prefab_save does not exist → use prefab_apply (applies instance changes to source prefab)

Routing:

  • To modify components on a prefab instance in scene → use component module skills, then prefab_apply
  • To set a property directly on the prefab asset → prefab_set_property (this module)
  • To find all instances of a prefab → prefab_find_instances (this module)

Skills Overview

Single Object Batch Version Use Batch When
prefab_instantiate prefab_instantiate_batch Spawning 2+ instances

No batch needed:

  • prefab_create - Create prefab from scene object
  • prefab_apply - Apply instance changes to prefab
  • prefab_unpack - Unpack prefab instance
  • prefab_get_overrides - Get instance overrides
  • prefab_revert_overrides - Revert to prefab values
  • prefab_apply_overrides - Apply overrides to prefab
  • prefab_create_variant - Create a prefab variant
  • prefab_find_instances - Find all instances of a prefab in scene
  • prefab_set_property - Set a property on a component inside a Prefab asset (supports basic types, vectors, colors, and asset references)

Skills

prefab_create

Create a prefab from a scene GameObject.

Parameter Type Required Description
name string No* Source object name
instanceId int No* Instance ID (preferred)
path string No* Object path
savePath string Yes Prefab save path

*At least one source identifier required.

Returns: {success, prefabPath, sourceObject}

prefab_instantiate

Instantiate a prefab into the scene.

Parameter Type Required Default Description
prefabPath string Yes - Prefab asset path
name string No prefab name Instance name
x, y, z float No 0 Local position (relative to parent if set)
parentEntityId string No null Parent entity ID (Unity 6000.4+, preferred)
parentName string No null Parent object name
parentInstanceId int No 0 Parent instance ID
parentPath string No null Parent hierarchy path

Returns: {success, name, entityId, instanceId, path, prefabPath, position}

prefab_instantiate_batch

Instantiate multiple prefabs in one call.

Parameter Type Required Description
items array Yes Array of instantiation configs

Item properties: prefabPath, name, x, y, z, rotX, rotY, rotZ, scaleX, scaleY, scaleZ, parentEntityId, parentName, parentInstanceId, parentPath

Returns: {success, totalItems, successCount, failCount, results: [{success, name, instanceId, prefabPath, position}]}

unity_skills.call_skill("prefab_instantiate_batch", items=[
    {"prefabPath": "Assets/Prefabs/Enemy.prefab", "x": 0, "z": 0, "name": "Enemy_01"},
    {"prefabPath": "Assets/Prefabs/Enemy.prefab", "x": 2, "z": 0, "name": "Enemy_02"},
    {"prefabPath": "Assets/Prefabs/Enemy.prefab", "x": 4, "z": 0, "name": "Enemy_03"}
])

prefab_apply

Apply instance changes back to the prefab asset.

Parameter Type Required Description
name string No* Prefab instance name
instanceId int No* Instance ID (preferred)
path string No* Object path

*At least one identifier required.

Returns: {success, gameObject, prefabPath}

prefab_unpack

Unpack a prefab instance (break prefab connection).

Parameter Type Required Default Description
name string No* - Prefab instance name
instanceId int No* - Instance ID (preferred)
path string No* - Object path
completely bool No false Unpack all nested prefabs

*At least one identifier required.

Returns: {success, gameObject, mode}

prefab_get_overrides

Get list of property overrides on a prefab instance.

Parameter Type Required Description
name string No* Prefab instance name
instanceId int No* Instance ID

Returns: {success, overrides: [{type, path, property}]}

prefab_revert_overrides

Revert all overrides on a prefab instance back to prefab values.

Parameter Type Required Description
name string No* Prefab instance name
instanceId int No* Instance ID

prefab_apply_overrides

Apply all overrides from instance to source prefab asset.

Parameter Type Required Description
name string No* Prefab instance name
instanceId int No* Instance ID

prefab_create_variant

Create a prefab variant from an existing prefab.

Parameter Type Required Default Description
sourcePrefabPath string Yes - Path to the source prefab asset
variantPath string Yes - Save path for the new variant

Returns: { success, sourcePath, variantPath, name }

prefab_find_instances

Find all instances of a prefab in the current scene.

Parameter Type Required Default Description
prefabPath string Yes - Prefab asset path to search for
limit int No 50 Maximum number of instances to return

Returns: { success, prefabPath, count, instances: [{ name, path, instanceId }] }

prefab_set_property

Set a property on a component inside a Prefab asset file (without instantiating it). Supports basic types, vectors, colors, enums, and asset references.

Parameter Type Required Default Description
prefabPath string Yes - Path to the prefab asset
componentType string Yes - Component type name
propertyName string Yes - Serialized property name
value string Cond. null Value for basic types (int/float/bool/string/enum/vector/color)
assetReferencePath string Cond. null Asset path for Object reference fields (Material, Texture, AudioClip, ScriptableObject, etc.)
gameObjectName string No null Child object name inside prefab (defaults to root)

Provide either value (basic types) or assetReferencePath (asset references).

Returns: { success, prefabPath, gameObject, component, property, valueSet }

# Set a float property on prefab root
unity_skills.call_skill("prefab_set_property",
    prefabPath="Assets/Prefabs/Enemy.prefab",
    componentType="EnemyStats",
    propertyName="maxHealth",
    value="100"
)

# Assign an asset reference to a prefab component
unity_skills.call_skill("prefab_set_property",
    prefabPath="Assets/Prefabs/Enemy.prefab",
    componentType="AudioSource",
    propertyName="m_audioClip",
    assetReferencePath="Assets/Audio/hit.wav"
)

# Edit a child object inside a prefab
unity_skills.call_skill("prefab_set_property",
    prefabPath="Assets/Prefabs/Player.prefab",
    componentType="MeshRenderer",
    propertyName="m_Materials.Array.data[0]",
    assetReferencePath="Assets/Materials/PlayerSkin.mat",
    gameObjectName="Body"
)

Example: Efficient Enemy Spawning

import unity_skills

# BAD: 10 API calls for 10 enemies
for i in range(10):
    unity_skills.call_skill("prefab_instantiate",
        prefabPath="Assets/Prefabs/Enemy.prefab",
        name=f"Enemy_{i}",
        x=i * 2
    )

# GOOD: 1 API call for 10 enemies
unity_skills.call_skill("prefab_instantiate_batch", items=[
    {"prefabPath": "Assets/Prefabs/Enemy.prefab", "name": f"Enemy_{i}", "x": i * 2}
    for i in range(10)
])

Best Practices

  1. Organize prefabs in dedicated folders
  2. Use prefabs for repeated objects
  3. Apply changes to update all instances
  4. Unpack only when unique modifications needed
  5. Use batch instantiation for level generation

Exact Signatures

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

用于Unity ProBuilder的可编辑网格建模,支持关卡灰盒搭建、几何体创建与编辑。提供形状生成、面/顶点操作及批量处理功能,适用于快速原型设计与场景布局。
关卡灰盒搭建 ProBuilder几何体创建 编辑器内快速搭形 用户提及'灰盒'或'白模'
SkillsForUnity/unity-skills~/skills/probuilder/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-probuilder -g -y
SKILL.md
Frontmatter
{
    "name": "unity-probuilder",
    "description": "Model editable meshes with ProBuilder for blockout — create and edit ProBuilder meshes, faces, and vertices for level greyboxing. Use when blocking out levels, building or editing ProBuilder geometry, or prototyping shapes in-editor, even if the user just says \"灰盒\" or \"白模\". 用 ProBuilder 进行可编辑网格建模做 blockout(创建与编辑 ProBuilder 网格、面、顶点,用于关卡灰盒);当用户要搭建关卡灰盒、创建或编辑 ProBuilder 几何体、或在编辑器内快速搭形时使用。"
}

Unity ProBuilder Skills

Use this module for editable ProBuilder meshes, not regular primitive GameObjects. It is best for blockout, level geometry, and procedural mesh refinement.

Requires: com.unity.probuilder package. Batch-first: For scene blockout or level generation, prefer probuilder_create_batch when creating 2+ shapes.

Guardrails

Operating Mode (v1.9 three-tier):

  • Approval (default): query skills (e.g. probuilder_get_info, probuilder_get_vertices) run directly. Create/modify skills are FullAuto — call once, get MODE_RESTRICTED, run the grant protocol; a successful /permission/grant executes the skill server-side and returns the result in the same response.
  • Auto / Bypass: SemiAuto and FullAuto run directly.
  • Auto-forbidden in this module: probuilder_combine_meshes (SkillOperation.Modify | Delete, the Delete bit triggers NeverInSemi). It is callable only under Bypass mode or after the user adds it to the Allowlist; the grant flow returns MODE_FORBIDDEN. Note probuilder_delete_faces is Operation = SkillOperation.Modify only and remains grantable under Approval/Auto.
  • When com.unity.probuilder is missing, every skill returns a package-missing diagnostic instead of executing.

DO NOT (common hallucinations):

  • probuilder_create_mesh does not exist -> use probuilder_create_shape
  • probuilder_edit_face does not exist -> use the specific face skills such as probuilder_extrude_faces, probuilder_delete_faces, probuilder_merge_faces
  • probuilder_set_material and probuilder_set_face_material are different -> whole object vs selected faces
  • Regular meshes do not become ProBuilder meshes automatically
  • Mesh rebuild calls (ToMesh() + Refresh()) are already handled by the skills. Do not invent a manual rebuild step

Routing:

  • For ordinary primitive objects without editable topology -> use gameobject_create
  • For material asset creation or shader work -> use material
  • For large blockout generation -> combine this module with material and light, but keep geometry creation here

Object Targeting

Most edit/query skills accept one of:

  • name
  • instanceId
  • path

Prefer instanceId when multiple scene objects share the same name.

Skills

Create and Batch

Skill Use Key parameters
probuilder_create_shape Create a parametric ProBuilder shape shape, name?, x/y/z?, sizeX/Y/Z?, rotX/Y/Z?
probuilder_create_batch Create multiple shapes in one call items, defaultParent?

Supported shape values: Cube, Sphere, Cylinder, Cone, Torus, Prism, Arch, Pipe, Stairs, Door, Plane.

Face and Edge Editing

Skill Use Key parameters
probuilder_extrude_faces Extrude selected faces target, faceIndexes?, distance?, method?
probuilder_delete_faces Delete faces by index target, faceIndexes
probuilder_merge_faces Merge faces into one target, faceIndexes?
probuilder_flip_normals Reverse face direction target, faceIndexes?
probuilder_detach_faces Split faces from shared vertices target, faceIndexes?, deleteSourceFaces?
probuilder_bevel_edges Chamfer edges target, edgeIndexes?, amount?
probuilder_extrude_edges Extrude edges outward target, edgeIndexes, distance?, extrudeAsGroup?
probuilder_bridge_edges Bridge two edges with new face target, edgeA, edgeB, allowNonManifold?

Mesh, Vertex, UV, Material

Skill Use Key parameters
probuilder_subdivide Add detail by subdivision target, faceIndexes?
probuilder_conform_normals Make normals point consistently outward target, faceIndexes?
probuilder_move_vertices Offset vertices by delta target, vertexIndexes, deltaX/Y/Z?
probuilder_set_vertices Set absolute vertex positions target, vertices
probuilder_get_vertices Query vertex positions target, vertexIndexes?, verbose?
probuilder_weld_vertices Merge close vertices target, vertexIndexes, radius?
probuilder_project_uv Box-project UVs target, faceIndexes?, channel?
probuilder_set_face_material Assign material to faces target, faceIndexes?, materialPath?, submeshIndex?
probuilder_set_material Assign whole-object material or quick color target, materialPath?, r/g/b/a?
probuilder_combine_meshes Merge multiple meshes names

Query and Pivot

Skill Use Key parameters
probuilder_get_info Get face/vertex/material stats target
probuilder_center_pivot Center or reposition pivot target, worldX/Y/Z?

Blockout Workflow

  1. Create major volumes with probuilder_create_batch.
  2. Verify traversal and gameplay scale before adding detail.
  3. Refine surfaces with face/edge operations.
  4. Use vertex edits for ramps, slopes, and irregular silhouettes.
  5. Apply quick colors or real materials after layout stabilizes.

Minimal Example

import unity_skills

unity_skills.call_skill("probuilder_create_batch", items=[
    {"shape": "Cube", "name": "Ground", "sizeX": 20, "sizeY": 0.5, "sizeZ": 12, "y": -0.25},
    {"shape": "Cube", "name": "Platform_A", "sizeX": 3, "sizeY": 0.3, "sizeZ": 3, "x": 4, "y": 1.5},
    {"shape": "Cube", "name": "Ramp", "sizeX": 3, "sizeY": 1, "sizeZ": 5, "x": 8, "y": 0.5}
])

unity_skills.call_skill("probuilder_move_vertices",
    name="Ramp",
    vertexIndexes="4,5",
    deltaY=-0.8
)

unity_skills.call_skill("probuilder_set_material",
    name="Platform_A",
    r=0.2, g=0.6, b=1.0
)

Important Notes

  1. ProBuilder objects keep editable topology through ProBuilderMesh.
  2. Use probuilder_get_info before face edits and probuilder_get_vertices before vertex edits.
  3. MeshCollider on physics-driven props must be convex.
  4. Quick color assignment is fine for prototype passes; use material assets for production.
  5. Package missing errors are expected if ProBuilder is not installed.

Exact Signatures

Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file. Load MODELING_REFERENCE.md for scene design heuristics, furniture decomposition, detailed examples, and extended modeling tips.

用于采集Unity运行时只读性能快照,包括帧率、内存及各类资源占用统计。支持查看FPS、批次、DrawCall及纹理/网格/材质等内存详情,不修改任何数据,适用于性能监控与问题排查。
用户要求查看Unity运行时性能数据 用户请求抓取Profiler快照或检查帧率/内存统计 用户提及'性能数据'或'看看帧率'
SkillsForUnity/unity-skills~/skills/profiler/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-profiler -g -y
SKILL.md
Frontmatter
{
    "name": "unity-profiler",
    "description": "Capture read-only Unity runtime performance snapshots — sample frame timing, memory, and runtime stats without mutating anything. Use when checking runtime performance, taking a profiler snapshot, or inspecting memory\/frame stats, even if the user just says \"性能数据\" or \"看看帧率\". 采集只读的 Unity 运行时性能快照(采样帧耗时、内存、运行时统计,不做任何改动);当用户要查看运行时性能、抓取 profiler 快照、或检查内存\/帧率统计时使用。"
}

Profiler Skills

Get performance statistics.

Operating Mode

  • Approval / Auto / Bypass: 所有 skill 直接执行。本模块全部ReadOnly = true, Mode = SkillMode.SemiAuto,三档模式下都不需要 grant。
  • 本模块不含 Delete / PlayMode / Reload / RiskLevel=high 类 skill —— 没有 IsForbiddenInSemi 拦截。
  • 注:本组 skill 仅做"瞬时快照"读取,不是 Profiler 录制控制;持续采样请用 Unity Profiler 窗口。

DO NOT (common hallucinations):

  • profiler_start / profiler_stop do not exist → profiler skills are read-only snapshots, not recording controls
  • profiler_record does not exist → use Unity Profiler window for recording
  • profiler_analyze / profiler_get_fps do not exist → use profiler_get_stats (FPS, batches, draw calls) or profiler_get_memory (heap sizes)

Routing:

  • For scene performance hints → use perception module's scene_performance_hints
  • For memory info → debug_get_memory_info (debug module) or profiler_get_memory (this module)
  • For optimization suggestions → use optimization module

Skills

profiler_get_stats

Get performance statistics (FPS, Memory, Batches). Parameters: None.

Returns:

{
  "fps": 60.0,
  "triangles": 1500,
  "batches": 12,
  "memory": { "totalAllocatedMB": 256.5, ... }
}

profiler_get_memory

Get memory usage overview (total allocated, reserved, mono heap). Parameters: None.

Returns: { success, totalAllocatedMB, totalReservedMB, unusedReservedMB, monoHeapMB, monoUsedMB }

profiler_get_runtime_memory

Get top N objects by runtime memory usage in the scene.

Parameter Type Required Default Description
limit int No 20 Maximum number of objects to return

Returns: { success, totalTrackedMB, showing, objects: [{ name, type, sizeKB }] }

profiler_get_texture_memory

Get memory usage of all loaded textures.

Parameter Type Required Default Description
limit int No 50 Maximum number of textures to return

Returns: { success, totalCount, totalMB, topTextures: [{ name, type, sizeKB, width, height }] }

profiler_get_mesh_memory

Get memory usage of all loaded meshes.

Parameter Type Required Default Description
limit int No 50 Maximum number of meshes to return

Returns: { success, totalCount, totalMB, topMeshes: [{ name, sizeKB, vertices, triangles }] }

profiler_get_material_memory

Get memory usage of all loaded materials.

Parameter Type Required Default Description
limit int No 50 Maximum number of materials to return

Returns: { success, totalCount, totalMB, topMaterials: [{ name, shader, sizeKB }] }

profiler_get_audio_memory

Get memory usage of all loaded AudioClips.

Parameter Type Required Default Description
limit int No 50 Maximum number of clips to return

Returns: { success, totalCount, totalMB, topClips: [{ name, sizeKB, length, channels, frequency }] }

profiler_get_object_count

Count all loaded objects grouped by type.

Parameter Type Required Default Description
topN int No 20 Number of top types to return

Returns: { success, totalObjects, topTypes: [{ type, count }] }

profiler_get_rendering_stats

Get rendering statistics (batches, triangles, vertices, etc.). Parameters: None.

Returns: { success, frameTime, renderTime, triangles, vertices, batches, setPassCalls, drawCalls, dynamicBatchedDrawCalls, staticBatchedDrawCalls, instancedBatchedDrawCalls, shadowCasters }

profiler_get_asset_bundle_stats

Get information about all loaded AssetBundles. Parameters: None.

Returns: { success, count, bundles: [{ name, isStreamedSceneAssetBundle }] }

Exact Signatures

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

在建议架构变更前,先侦察现有Unity项目。检查版本、包、asmdef结构、目录及编码风格。适用于初次接触陌生项目、审计配置或用户询问项目概况时,确保改动兼容且尊重既有约定。
初次接触陌生Unity项目 提议结构性改动前 审计现有项目配置 用户说'看看这个项目' 用户问'项目用了什么'
SkillsForUnity/unity-skills~/skills/project-scout/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-project-scout -g -y
SKILL.md
Frontmatter
{
    "name": "unity-project-scout",
    "description": "Advises on reconnoitering an existing Unity project — check Unity version, packages, asmdef layout, folders, and coding patterns before proposing changes. Use when first approaching an unfamiliar project, before proposing structural changes, or auditing the existing setup, even if the user just says \"看看这个项目\" or \"项目用了什么\". 为侦查现有 Unity 项目提供建议(在提改动前先查 Unity 版本、包、asmdef 结构、目录、编码风格);当用户要初次接触陌生项目、在提结构性改动前、或盘点现有配置时使用。"
}

Unity Project Scout

Use this before recommending architecture changes in an existing project.

Inspect First

Collect only the information needed to avoid clashing with the current project:

  • Unity version and render pipeline
  • Installed packages and notable dependencies
  • asmdef layout, if any
  • Folder structure under Assets/
  • Whether the project already uses:
    • ScriptableObject config
    • service/singleton patterns
    • event-driven flows
    • custom inspectors/property drawers
    • tests
  • Existing naming and code organization style

Suggested Tools / Inputs

  • Unity project info and project settings
  • Script/file search for patterns
  • Local inspection of Packages/manifest.json, Assets/, and *.asmdef

Output Format

  • Technical baseline
  • Existing architectural signals
  • Existing conventions worth preserving
  • Existing risks or inconsistencies
  • Constraints for future suggestions
  • Unknowns that still need confirmation

Guardrails

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

  • Do not propose a clean-slate architecture if the project already has a consistent pattern.
  • Do not recommend new dependencies until the current stack is clear.
读取Unity项目元数据(版本、渲染管线)、列出Shader与UPM包,获取构建设置、层级标签及玩家设置。支持半自动只读查询及标签创建,用于项目配置检查与信息检索。
查看 Unity 版本 判断渲染管线 列出已装 shader/包 项目信息 什么版本
SkillsForUnity/unity-skills~/skills/project/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-project -g -y
SKILL.md
Frontmatter
{
    "name": "unity-project",
    "description": "Read Unity project information — project metadata such as Unity version and render pipeline, plus lists of shaders and UPM packages. Use when checking the Unity version, detecting the render pipeline, or listing installed shaders\/packages, even if the user just says \"项目信息\" or \"什么版本\". 读取 Unity 项目信息(项目元数据如 Unity 版本与渲染管线,以及 shader 与 UPM 包列表);当用户要查看 Unity 版本、判断渲染管线、或列出已装 shader\/包时使用。"
}

Project Skills

Project information and configuration.

Operating Mode

本模块除 project_add_tagOperation = Create,未设 Mode 字段,默认 FullAuto,Approval 模式下需 grant)外,其余 8 个 skill(project_get_info / project_get_render_pipeline / project_list_shaders / project_get_build_settings / project_get_packages / project_get_layers / project_get_tags / project_get_player_settings)均标 SkillMode.SemiAuto 且为只读 Query,Approval / Auto / Bypass 三档下都可直接执行。不含 NeverInSemi 高危 skill

Player Settings、Build Settings、Layer 通过本模块只读获取;如需编辑,请使用 editor_execute_menu 打开 Edit/Project Settings...File/Build Settings...(菜单本身在 editor 模块为 SemiAuto,可直接执行)。

DO NOT (common hallucinations):

  • project_save does not exist → use scene_save (scene module) or editor_execute_menu menuPath="File/Save"
  • project_settings does not exist → use specific skills: project_get_render_pipeline, project_get_build_settings, etc.
  • project_set_resolution / project_set_player_settings do not exist → Player Settings are read-only via project_get_player_settings; to edit, open Project Settings via editor_execute_menu with Edit/Project Settings...
  • project_create does not exist → projects are created via Unity Hub, not REST API

Routing:

  • For graphics / quality / SRP configuration → use the graphics module
  • For Layer/Tag management → project_add_tag (this module); Layers are read-only via project_get_layers (edit via editor_execute_menuEdit/Project Settings...)
  • For build settings → project_get_build_settings (read-only; use editor_execute_menuFile/Build Settings... to edit)

Skills

project_get_info

Get project information including render pipeline, Unity version, and settings. Parameters: None.

project_get_render_pipeline

Get current render pipeline type and recommended shaders. Parameters: None.

project_list_shaders

List all available shaders in the project. Parameters:

  • filter (string, optional): Filter by name.
  • limit (int, optional): Max results (default 50).

project_get_build_settings

Get build settings (platform, scenes).

Parameters: None.

Returns: { success, activeBuildTarget, buildTargetGroup, sceneCount, scenes }

project_get_packages

List installed UPM packages.

Parameters: None.

Returns: { success, manifest }

project_get_layers

Get all Layer definitions.

Parameters: None.

Returns: { success, count, layers }

project_get_tags

Get all Tag definitions.

Parameters: None.

Returns: { success, count, tags }

project_add_tag

Add a custom Tag.

Parameter Type Required Default Description
tagName string Yes - The tag name to add

Returns: { success, tag }

project_get_player_settings

Get Player Settings.

Parameters: None.

Returns: { success, productName, companyName, bundleVersion, defaultScreenWidth, defaultScreenHeight, fullscreen, apiCompatibility, scriptingBackend }


Exact Signatures

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

Unity API连通性测试与基础演示Skill。提供创建几何体、删除对象、查询场景等最小化接口,用于验证REST服务可达性及冒烟测试。仅限测试使用,生产环境请选用gameobject模块。
测试连接 通不通 验证REST服务响应 冒烟测试连通性 试发第一个调用
SkillsForUnity/unity-skills~/skills/sample/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-sample -g -y
SKILL.md
Frontmatter
{
    "name": "unity-sample",
    "description": "Sample and demo skills for API connectivity testing — minimal echo\/ping-style calls to verify the REST server is reachable. Use when testing whether the UnitySkills REST server responds, smoke-testing connectivity, or trying a first call, even if the user just says \"测试连接\" or \"通不通\". 用于 API 连通性测试的示例\/演示 skill(最小的 echo\/ping 式调用,验证 REST 服务可达);当用户要测试 UnitySkills REST 服务是否响应、冒烟测试连通性、或试发第一个调用时使用。"
}

Sample Skills

Basic examples for testing the API.

Guardrails

Operating Mode (v1.9 three-tier):

  • Approval (default): query skills (get_scene_info, find_objects_by_name) run directly. Creators/mutators (create_cube, create_sphere, set_object_position, set_object_rotation, set_object_scale) are FullAuto — on MODE_RESTRICTED, run the grant protocol.
  • Auto / Bypass: SemiAuto and FullAuto run directly.
  • Auto-forbidden in this module: delete_object (SkillOperation.Delete). It is reachable only under Bypass or via a user-managed Allowlist entry; the grant flow returns MODE_FORBIDDEN.

DO NOT (common hallucinations):

  • Sample skills are basic test/demo skills — do not use them for production work
  • sample_create is a simplified version of gameobject_create — prefer the full gameobject module
  • sample_hello / sample_ping are connectivity test skills only

Routing:

  • For actual GameObject operations → use gameobject module
  • For server health check → use Python helper's unity_skills.health()

Skills

create_cube

Create a cube primitive. Parameters: x, y, z, name

create_sphere

Create a sphere primitive. Parameters: x, y, z, name

delete_object

Delete object by name. Parameters: objectName

find_objects_by_name

Find objects containing string. Parameters: nameContains (name is also accepted as a compatibility alias)

set_object_position

Set object position. Parameters: objectName, x, y, z

set_object_rotation

Set object rotation. Parameters: objectName, x, y, z

set_object_scale

Set object scale. Parameters: objectName, x, y, z

get_scene_info

Get current scene information. Parameters: None.


Exact Signatures

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

为Unity场景装配提供契约建议,明确必备对象、组件依赖、启动逻辑及引用连线。适用于界定场景内容、规划启动流程或记录依赖关系,替代隐式运行时查找,确保显式配置与早期验证。
用户询问场景里要有什么 用户询问引用怎么连 需要定义场景必备对象和组件依赖 规划Bootstrap或启动逻辑 文档化场景依赖关系
SkillsForUnity/unity-skills~/skills/scene-contracts/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-scene-contracts -g -y
SKILL.md
Frontmatter
{
    "name": "unity-scene-contracts",
    "description": "Advises on Unity scene composition contracts — required scene objects, component dependencies, bootstrap logic, and reference wiring. Use when defining what a scene must contain, planning bootstrap\/wiring, or documenting scene dependencies, even if the user just says \"场景里要有什么\" or \"引用怎么连\". 为 Unity 场景装配契约提供建议(场景必备对象、组件依赖、bootstrap 逻辑、引用连线);当用户要界定场景必须包含什么、规划启动\/装配、或记录场景依赖时使用。"
}

Unity Scene Contracts

Use this skill when scene setup needs to be explicit instead of relying on hidden runtime lookups.

Define

  • Required root objects
  • Required components on each root
  • Which references are assigned in Inspector
  • Which objects act as bootstrap/installers
  • Which objects are runtime-spawned
  • Which assumptions should be validated early

Output Format

  • Scene object contract
  • Bootstrap sequence
  • Inspector wiring rules
  • Validation rules
  • Hidden dependency risks

Guardrails

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

  • Prefer explicit scene wiring over chains of runtime Find.
  • Keep bootstrap objects small and focused.
管理Unity场景,支持创建、加载(叠加/单例)、保存、卸载、切换及查询。涵盖信息获取、层级树、截图和对象搜索。注意区分高危操作与半自动模式,避免使用不存在的命令。
打开或保存场景 叠加加载场景 切换活动场景 查询场景内容或层级
SkillsForUnity/unity-skills~/skills/scene/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-scene -g -y
SKILL.md
Frontmatter
{
    "name": "unity-scene",
    "description": "Manage Unity scenes — create, load (single\/additive), save, unload, switch the active scene, and get scene info\/hierarchy. Use when opening or saving scenes, loading additively, switching the active scene, or querying scene contents, even if the user just says \"打开场景\" or \"切场景\". 管理 Unity 场景(创建、加载、叠加加载、保存、卸载、切换活动场景、获取场景信息与层级);当用户要打开或保存场景、叠加加载、切换活动场景、或查询场景内容时使用。"
}

Unity Scene Skills

Control Unity scenes - the containers that hold all your GameObjects.

Operating Mode

  • Approval:本模块 Mixed —— scene_get_info / scene_get_hierarchy / scene_get_loaded / scene_find_objectsSkillMode.SemiAuto,可直接执行;scene_screenshot / scene_unload / scene_set_active 未设 Mode 字段(默认 FullAuto),Approval 模式下需 grant。
  • Auto / Bypass:FullAuto 直接执行。
  • 含 NeverInSemi 高危 skillscene_create / scene_load / scene_save(标 RiskLevel="high",因为切换/覆盖整个场景文件影响范围极大)。这些在 Approval/Auto 下返 MODE_FORBIDDEN,仅 Bypass 或 Allowlist 命中可调。

DO NOT (common hallucinations):

  • scene_delete / scene_rename do not exist → delete scene files via asset_delete, rename via asset_move
  • scene_list does not exist → use scene_get_loaded (loaded scenes) or asset_find with t:Scene (all scene assets)
  • scene_find_objects is a simple name/tag/component filter; for regex/layer/path search use gameobject_find (SkillMode.FullAuto)

Routing:

  • For detailed hierarchy tree → use perception module's hierarchy_describe
  • For scene statistics → use perception module's scene_summarize
  • For screenshot → scene_screenshot (this module) captures the Game View final composited image (all cameras + UI; in Play mode this is the live runtime frame); camera_screenshot (camera module, SkillMode.FullAuto) renders a single Game Camera off-screen

Skills Overview

Skill Description
scene_create Create a new scene
scene_load Load a scene
scene_save Save current scene
scene_get_info Get scene information
scene_get_hierarchy Get hierarchy tree
scene_screenshot Capture screenshot
scene_get_loaded Get all loaded scenes
scene_unload Unload an additive scene
scene_set_active Set active scene
scene_find_objects Search objects by name/tag/component

Skills

scene_create

Create a new scene.

Parameter Type Required Description
scenePath string Yes Path for new scene (e.g., "Assets/Scenes/MyScene.unity")

scene_load

Load a scene.

Parameter Type Required Default Description
scenePath string Yes - Scene asset path
additive bool No false Load additively (keep current scene)

scene_save

Save the current scene.

Parameter Type Required Description
scenePath string No Save path (null = save current)

scene_get_info

Get current scene information.

No parameters.

Returns: {success, name, path, isDirty, rootObjectCount, rootObjects: [name]}

scene_get_hierarchy

Get full scene hierarchy tree.

Parameter Type Required Default Description
maxDepth int No 10 Maximum hierarchy depth

Returns: {success, hierarchy: [{name, instanceId, children: [...]}]}

scene_screenshot

Capture a screenshot of the Game View — the final composited frame of all cameras + UI. In Play mode this is the live runtime image, not the Scene/editor view. For a single Game Camera's render use camera_screenshot instead.

Parameter Type Required Default Description
filename string No "screenshot.png" Bare filename only (no path separators); saved under Assets/Screenshots/
width int No 1920 Image width
height int No 1080 Image height

Returns: {success, path, width, height, isPlaying, note}. isPlaying indicates whether the frame is a live runtime image (Play mode) or a static Edit-mode frame.

Async: ScreenCapture.CaptureScreenshot writes the PNG ~1 frame later. If reading path immediately fails, wait ~200ms and retry.

scene_get_loaded

Get list of all currently loaded scenes.

No parameters.

Returns: {success, scenes: [{name, path, isActive, isDirty}]}

scene_unload

Unload a loaded scene (additive).

Parameter Type Required Description
sceneName string Yes Scene name to unload

scene_set_active

Set the active scene (for multi-scene editing).

Parameter Type Required Description
sceneName string Yes Scene name to set active

scene_find_objects

Search GameObjects by name pattern, tag, or component type. For advanced search (regex, layer, path) use gameobject_find.

Parameter Type Required Default Description
namePattern string No - Name substring to match (case-insensitive)
tag string No - Filter by tag
componentType string No - Filter by component type name
limit int No 50 Max results to return

Returns: {success, count, objects: [{name, path, instanceId, active, tag}]}


Example Usage

import unity_skills

# Create a new scene
unity_skills.call_skill("scene_create", scenePath="Assets/Scenes/Level1.unity")

# Load an existing scene
unity_skills.call_skill("scene_load", scenePath="Assets/Scenes/MainMenu.unity")

# Load scene additively (multi-scene)
unity_skills.call_skill("scene_load", scenePath="Assets/Scenes/UI.unity", additive=True)

# Get current scene info
info = unity_skills.call_skill("scene_get_info")
print(f"Scene: {info['name']}, Objects: {info['rootObjectCount']}")

# Get full hierarchy (useful for understanding scene structure)
hierarchy = unity_skills.call_skill("scene_get_hierarchy", maxDepth=5)

# Save scene
unity_skills.call_skill("scene_save")

# Take screenshot
unity_skills.call_skill("scene_screenshot", filename="preview.png", width=1920, height=1080)

Best Practices

  1. Always save before loading a new scene
  2. Use additive loading for UI overlays
  3. Keep scene hierarchy organized with empty parent objects
  4. Use scene_get_info to verify scene state
  5. Screenshots are saved under Assets/Screenshots/ (filename is a bare name; any path separators are stripped)

Exact Signatures

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

为Unity脚本提供职责划分建议,指导类应作为MonoBehaviour、ScriptableObject、纯C#服务或Installer。帮助用户在创建脚本前明确角色、拆分职责,避免过度依赖MonoBehaviour,优化架构设计。
用户询问某个类是否该用MonoBehaviour 需要确定类的职责或拆分职责 在MonoBehaviour与纯C#间抉择 准备创建一批游戏逻辑脚本
SkillsForUnity/unity-skills~/skills/script-roles/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-script-roles -g -y
SKILL.md
Frontmatter
{
    "name": "unity-script-roles",
    "description": "Advises on assigning Unity script roles — whether a class should be a MonoBehaviour, ScriptableObject, plain C# service, or installer. Use when deciding a class's role, splitting responsibilities across types, or choosing between MonoBehaviour and plain C#, even if the user just asks \"这个该用MonoBehaviour吗\" or \"职责怎么分\". 为 Unity 脚本职责划分提供建议(某个类应作 MonoBehaviour、ScriptableObject、纯 C# 服务还是 installer);当用户要确定类的职责、在类型间拆分职责、或在 MonoBehaviour 与纯 C# 间抉择时使用。"
}

Unity Script Roles

Use this skill before creating a batch of gameplay scripts.

Goal

Turn a rough script list into explicit roles so AI does not generate everything as MonoBehaviour.

Output Format

  • Script name
  • Recommended role
  • Main responsibility
  • Main dependencies
  • Why this role fits better than the alternatives

Common Roles

  • MonoBehaviour bridge
  • ScriptableObject config/data
  • pure C# domain/service
  • presenter / controller
  • state / state machine node
  • installer / bootstrap helper

Guardrails

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

  • Do not make every class a MonoBehaviour.
  • Do not force ScriptableObject onto runtime state that should stay in memory-only objects.
用于Unity C#脚本的增删改查、搜索、重命名及编译反馈分析。支持创建、读取、替换、追加等操作,涵盖单文件与批量处理,提供架构设计建议及编译错误检查,适用于代码编写、重构及维护场景。
用户要求编写或编辑C#代码 需要跨脚本搜索或重构文件布局 用户请求检查编译错误或分析脚本API 提到'写个脚本'或'改代码'
SkillsForUnity/unity-skills~/skills/script/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-script -g -y
SKILL.md
Frontmatter
{
    "name": "unity-script",
    "description": "Create, read, and analyze C# scripts — create, read, replace, append, search, rename, move, and delete scripts, plus compile feedback. Use when authoring or editing C# code, searching across scripts, refactoring file layout, or checking compile errors, even if the user just says \"写个脚本\" or \"改代码\". 对 C# 脚本进行增删改查与分析(创建、读取、替换、追加、搜索、重命名、移动、删除脚本,以及编译反馈);当用户要编写或编辑 C# 代码、跨脚本搜索、重构文件布局、或检查编译错误时使用。"
}

Unity Script Skills

BATCH-FIRST: Use script_create_batch when creating 2+ scripts. DESIGN-FIRST: Before creating gameplay scripts, actively consider coupling, performance, and maintainability. In an existing project, load ../project-scout/SKILL.md first. If the user is asking for architecture or refactoring advice, load ../architecture/SKILL.md and then ../patterns/SKILL.md, ../async/SKILL.md, ../inspector/SKILL.md, ../performance/SKILL.md, ../script-roles/SKILL.md, ../scene-contracts/SKILL.md, ../testability/SKILL.md, or ../scriptdesign/SKILL.md as needed.

Operating Mode

  • Approval: 只读类 skill(script_read / script_list / script_find_in_file / script_get_info / script_get_compile_feedback,标 SkillMode.SemiAuto)直接执行;写型 skill(script_create / script_create_batch / script_replace / script_append / script_rename / script_move / script_delete,默认 SkillMode.FullAuto)需用户 grant,grant 后服务端一步执行返结果。
  • Auto / Bypass: 直接执行。
  • 本模块含 Delete / Reload 类高危 skillscript_create / script_create_batch / script_replace / script_append / script_delete 会触发 Domain Reload(且多标 RiskLevel=high),script_delete 同时是 Delete 操作 —— 这些 skill 在 Approval / Auto 下被 IsForbiddenInSemi 自动拦截,仅 Bypass 或 Allowlist 命中可执行

DO NOT (common hallucinations):

  • script_edit / script_update do not exist → use script_replace for find-and-replace
  • script_write does not exist → use script_create (new file) or script_replace (modify existing)
  • scriptName parameter must NOT include .cs extension
  • Templates only accept: MonoBehaviour, ScriptableObject, Editor, EditorWindow

Routing:

  • To modify existing script content → script_replace (find/replace) or script_append (add lines)
  • To read script → script_read
  • To check compile errors → script_get_compile_feedback
  • To analyze script API → use perception module's script_analyze

Skills Overview

Single Object Batch Version Use Batch When
script_create script_create_batch Creating 2+ scripts

No batch needed:

  • script_read - Read script content
  • script_delete - Delete script
  • script_find_in_file - Search in scripts
  • script_append - Append content to script
  • script_get_compile_feedback - Check compile errors for one script after Unity finishes compiling
  • create_script() in scripts/unity_skills.py now waits for Unity to come back once and refreshes compile feedback automatically after script creation.

Skills

script_create

Create a C# script from template.

Parameter Type Required Default Description
scriptName string Yes - Script class name
folder string No "Assets/Scripts" Save folder
template string No "MonoBehaviour" Template type
namespaceName string No null Optional namespace

Templates: MonoBehaviour, ScriptableObject, Editor, EditorWindow

Returns: {success, status, path, jobId, className, namespaceName, designReminder, serverAvailability?}

Poll the returned jobId (or call script_get_compile_feedback) to obtain compile diagnostics — they are not embedded in the synchronous response. serverAvailability carries the transient-unavailable hint when Unity is about to reload the script domain.

script_create_batch

Create multiple scripts in one call.

Returns: {success, totalItems, successCount, failCount, results: [{success, path, className}], compilation?}

Before batch creation, decide whether each script should be:

  • a thin MonoBehaviour bridge
  • a ScriptableObject configuration asset
  • or a plain C# domain/service class generated from a custom template
unity_skills.call_skill("script_create_batch", items=[
    {"scriptName": "PlayerController", "folder": "Assets/Scripts/Player", "template": "MonoBehaviour"},
    {"scriptName": "EnemyAI", "folder": "Assets/Scripts/Enemy", "template": "MonoBehaviour"},
    {"scriptName": "GameSettings", "folder": "Assets/Scripts/Data", "template": "ScriptableObject"}
])

script_read

Read script content.

Parameter Type Required Description
scriptPath string Yes Script asset path

Returns: {path, lines, content}

script_delete

Delete a script.

Parameter Type Required Description
scriptPath string Yes Script to delete

Returns: {success, status, deleted, jobId, serverAvailability?}

script_find_in_file

Search for patterns in scripts.

Parameter Type Required Default Description
pattern string Yes - Search pattern
folder string No "Assets" Search folder
isRegex bool No false Use regex
limit int No 50 Max results

Returns: {pattern, matchCount, matches: [{file, line, content}]}

script_append

Append content to a script.

Parameter Type Required Default Description
scriptPath string Yes - Script path
content string Yes - Content to append
atLine int No end Line number to insert at

script_get_compile_feedback

Get compile diagnostics related to one script.

Parameter Type Required Default Description
scriptPath string Yes - Script path
limit int No 20 Max diagnostics

Example: Efficient Script Setup

import unity_skills

# BAD: 3 API calls + 3 Domain Reloads
unity_skills.call_skill("script_create", scriptName="PlayerController", folder="Assets/Scripts/Player")
# Wait for Domain Reload...
unity_skills.call_skill("script_create", scriptName="EnemyAI", folder="Assets/Scripts/Enemy")
# Wait for Domain Reload...
unity_skills.call_skill("script_create", scriptName="GameManager", folder="Assets/Scripts/Core")
# Wait for Domain Reload...

# GOOD: 1 API call + 1 Domain Reload
unity_skills.call_skill("script_create_batch", items=[
    {"scriptName": "PlayerController", "folder": "Assets/Scripts/Player"},
    {"scriptName": "EnemyAI", "folder": "Assets/Scripts/Enemy"},
    {"scriptName": "GameManager", "folder": "Assets/Scripts/Core"}
])
# Wait for Domain Reload once...

Important: Domain Reload And Compile Feedback

After creating or editing scripts, Unity triggers a Domain Reload (recompilation). Use the returned compilation field first. If isCompiling=true, wait for Unity to finish and then call script_get_compile_feedback.

import time

result = unity_skills.call_skill("script_create", scriptName="MyScript")
time.sleep(5)  # Wait for Unity to recompile if result["compilation"]["isCompiling"] is true
feedback = unity_skills.call_skill("script_get_compile_feedback", scriptPath=result["path"])
unity_skills.call_skill("component_add", name="Player", componentType="MyScript")

Best Practices

  1. Use meaningful script names matching class name
  2. Organize scripts in logical folders
  3. Before creating gameplay code, decide the class role first: MonoBehaviour, ScriptableObject, or plain C# helper/service
  4. Actively reduce coupling: prefer explicit dependencies, small responsibilities, and event-driven notifications over hidden globals
  5. Actively consider performance: avoid unnecessary Update, repeated Find, reflection in hot paths, and avoidable allocations
  6. Actively consider maintainability: clear naming, explicit ownership, Inspector-friendly fields, and simple module boundaries
  7. Avoid giant boilerplate/template dumps. Start from the smallest structure that solves the current need
  8. Do not default to UniTask or a global event bus unless the project context justifies them
  9. Avoid cryptic abbreviations in class, field, and method names unless they are already a project convention
  10. Use templates for correct base class
  11. Wait for compilation after creating scripts
  12. After script edits, call script_get_compile_feedback and fix reported errors
  13. Use regex search for complex patterns
  14. Use batch creation to minimize Domain Reloads

Additional Skills

script_replace

Find and replace content in a script file.

Parameter Type Required Default Description
scriptPath string Yes - Script asset path
find string Yes - Text or pattern to find
replace string Yes - Replacement text
isRegex bool No false Use regex matching
checkCompile bool No true Check compilation after replace
diagnosticLimit int No 20 Max compile diagnostics

Returns: { success, status, path, jobId, replacements, serverAvailability? }

script_list

List C# script files in the project.

Parameter Type Required Default Description
folder string No "Assets" Folder to search in
filter string No null Filter string for path matching
limit int No 100 Max results

Returns: { count, scripts: [{ path, name }] }

script_get_info

Get script info (class name, base class, methods).

Parameter Type Required Default Description
scriptPath string Yes - Script asset path

Returns: { path, className, baseClass, namespaceName, isMonoBehaviour, publicMethods, publicFields }

script_rename

Rename a script file.

Parameter Type Required Default Description
scriptPath string Yes - Script asset path
newName string Yes - New script name (without extension)
checkCompile bool No true Check compilation after rename
diagnosticLimit int No 20 Max compile diagnostics

Returns: { success, status, path, jobId, oldPath, newName, serverAvailability? }

script_move

Move a script to a new folder.

Parameter Type Required Default Description
scriptPath string Yes - Script asset path
newFolder string Yes - Destination folder. Must already exist.
checkCompile bool No true Check compilation after move
diagnosticLimit int No 20 Max compile diagnostics

Returns: { success, status, path, jobId, oldPath, newPath, serverAvailability? }


Exact Signatures

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

管理Unity ScriptableObject资产,支持创建、读取、修改、删除、复制、查找及列出SO资产。涵盖数据资产的脚本化管理与配置表操作,区分读写权限模式。
创建或编辑ScriptableObject数据资产 查找SO实例 脚本化管理SO 用户提到'配置表' 用户提到'SO资产'
SkillsForUnity/unity-skills~/skills/scriptableobject/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-scriptableobject -g -y
SKILL.md
Frontmatter
{
    "name": "unity-scriptableobject",
    "description": "Manage ScriptableObject assets — create, read, modify, delete, duplicate, find, and list SO assets. Use when creating or editing ScriptableObject data assets, finding SO instances, or scripting SO management, even if the user just says \"配置表\" or \"SO资产\". 管理 ScriptableObject 资产(创建、读取、修改、删除、复制、查找、列出 SO 资产);当用户要创建或编辑 ScriptableObject 数据资产、查找 SO 实例、或脚本化管理 SO 时使用。"
}

ScriptableObject Skills

Create and manage ScriptableObject assets.

Operating Mode

  • Approval:本模块 Mixed —— scriptableobject_get / scriptableobject_list_types / scriptableobject_find / scriptableobject_export_jsonSkillMode.SemiAuto,可直接执行;写类 skill (scriptableobject_create / scriptableobject_set / scriptableobject_set_batch / scriptableobject_duplicate / scriptableobject_import_json) 标 SkillMode.FullAuto,需 grant 单次执行返结果。
  • Auto / Bypass:FullAuto 直接执行。
  • 含 NeverInSemi 高危 skillscriptableobject_delete(Operation.Delete)。该 skill 在 Approval/Auto 下返 MODE_FORBIDDEN,仅 Bypass 或 Allowlist 命中可调。

DO NOT (common hallucinations):

  • scriptableobject_create_type does not exist → create SO scripts via script_create with template "ScriptableObject"
  • scriptableobject_get_properties / scriptableobject_read do not exist → use scriptableobject_get
  • scriptableobject_set_property / scriptableobject_set_field do not exist → use scriptableobject_set (single field) or scriptableobject_set_batch (multiple fields)
  • scriptableobject_save does not exist → changes are auto-saved to the asset

Routing:

  • For ScriptableObject script creation → use script module with template "ScriptableObject"
  • For JSON import/export → scriptableobject_import_json / scriptableobject_export_json (this module)

Skills

scriptableobject_create

Create a new ScriptableObject asset. Parameters:

  • typeName (string): ScriptableObject type name.
  • savePath (string): Asset save path.

scriptableobject_get

Get properties of a ScriptableObject. Parameters:

  • assetPath (string): Asset path.

scriptableobject_set

Set a field/property on a ScriptableObject. Parameters:

  • assetPath (string): Asset path.
  • fieldName (string): Field or property name.
  • value (string): Value to set.

scriptableobject_list_types

List available ScriptableObject types in the project. Parameters:

  • filter (string, optional): Filter by name.

scriptableobject_duplicate

Duplicate a ScriptableObject asset. Parameters:

  • assetPath (string): Source asset path to duplicate.

scriptableobject_set_batch

Set multiple fields on a ScriptableObject at once. fields: JSON object {fieldName: value, ...}

Parameter Type Required Default Description
assetPath string Yes - Asset path of the ScriptableObject
fields string Yes - JSON object with field-value pairs, e.g. {"fieldName": "value", ...}

Returns: { success, fieldsSet }

scriptableobject_delete

Delete a ScriptableObject asset.

Parameter Type Required Default Description
assetPath string Yes - Asset path of the ScriptableObject to delete

Returns: { success, deleted }

scriptableobject_find

Find ScriptableObject assets by type name.

Parameter Type Required Default Description
typeName string Yes - ScriptableObject type name to search for
searchPath string No "Assets" Folder path to search within
limit int No 50 Maximum number of results to return

Returns: { success, count, assets }

scriptableobject_export_json

Export a ScriptableObject to JSON.

Parameter Type Required Default Description
assetPath string Yes - Asset path of the ScriptableObject to export
savePath string No null File path to save the JSON output; if omitted, JSON is returned inline

Returns: { success, path } or { success, json }

scriptableobject_import_json

Import JSON data into a ScriptableObject.

Parameter Type Required Default Description
assetPath string Yes - Asset path of the target ScriptableObject
json string No null JSON string to import
jsonFilePath string No null Path to a JSON file to read and import

Returns: { success, assetPath }


Exact Signatures

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

为Unity游戏脚本提供代码审查、解耦、可维护性提升及重构建议。适用于代码质量检查、处理高耦合脚本或规划重构,帮助用户优化脚本设计、职责划分、数据生命周期管理及性能表现。
代码审查 降低耦合 提升可维护性 重构 看看我代码 代码有点乱
SkillsForUnity/unity-skills~/skills/scriptdesign/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-scriptdesign -g -y
SKILL.md
Frontmatter
{
    "name": "unity-scriptdesign",
    "description": "Advises on Unity gameplay script quality — code review, reducing coupling, improving maintainability, and refactoring. Use when reviewing code quality, untangling tightly-coupled scripts, or planning a refactor for maintainability, even if the user just says \"看看我代码\" or \"代码有点乱\". 为 Unity 游戏脚本质量提供建议(代码审查、降低耦合、提升可维护性、重构);当用户要审查代码质量、理顺高耦合脚本、或为可维护性规划重构时使用。"
}

Unity Script Design Review

Use this skill before creating gameplay scripts, or after scripts are generated and need a design pass.

Review Checklist

  • Responsibility: does the script have one clear job?
  • Role: should it really be a MonoBehaviour, ScriptableObject, or plain C# class?
  • Coupling: are dependencies explicit instead of hidden globals or deep scene lookups?
  • Communication: should this be a direct reference, interface call, or event?
  • Performance: is there unnecessary Update, repeated Find, avoidable allocation, or reflection in hot paths?
  • Lifecycle: are subscriptions, timers, and async work cleaned up clearly?
  • Inspector UX: are serialized fields private, grouped, and explained?
  • Testability: can the core logic move into a plain C# class?
  • Naming: do class and field names explain intent without cryptic abbreviations?

Data Lifecycle Boundary

The Review Checklist above asks "where does this class live". Ask the same question for every field. Every piece of state has one of three lifecycles, and putting a field on the wrong one is the most common cause of "why did this break when the designer tweaked a value" and "why are my unit tests flaky".

Lifecycle When the value is decided Where it belongs Typical idiom
Authoring-time By a designer in the Editor, before Play ScriptableObject asset, or [SerializeField] private on a prefab Immutable at runtime; read via _config.Speed
Composition-time Once per scene/instance, at Awake/Start private field, assigned from GetComponent / GetComponentInChildren / ctor arg Cached reference, no per-frame lookup
Runtime-mutable Every frame or on gameplay events private backing field + public read-only property + event Exposed via public float Health { get; private set; } + OnHealthChanged

Typical assignments

  • Weapon damage / fire rate / clip size → Authoring-time (ScriptableObject so balance can be hot-swapped).
  • Enemy AI's current target TransformComposition-time if set once at spawn, Runtime-mutable if re-targeted each frame.
  • Player current HP → Runtime-mutable with event. Never public float hp;.
  • Reference to Rigidbody/Animator on the same GameObject → Composition-time, cached in Awake.
  • Level music track → Authoring-time via ScriptableObject level descriptor.
  • "Is in combat" flag → Runtime-mutable, but usually derived from other state — review whether it should be a field at all.

Why the separation matters

Mixing the three lifecycles is what turns a clean class into a god object. A MonoBehaviour whose public float speed is edited by both the Inspector and a power-up script has two owners and no invariant; a bug in either path corrupts the other. The ECS baking pipeline makes this distinction a hard architectural boundary (Authoring → Baker → System), and the discipline transfers directly: if you would not mix an Authoring component with runtime write-back in ECS, do not mix them in a MonoBehaviour either. Source: EntitiesSamples/Docs/baking.md:5-16.

Guardrails

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

  • Prefer descriptive names over local shorthand.
  • Do not “optimize” readability away for imagined productivity gains.
  • Do not recommend complex patterns if a smaller refactor fixes the real problem.

Output Format

  • Keep: what is already good
  • Simplify: what should stay straightforward
  • Refactor: the highest-value structural change
  • Performance notes: only real hotspots, not theoretical micro-optimizations
  • Maintainability notes: naming, ownership, coupling, editor usability
管理Unity HLSL/ShaderLab着色器文件,支持创建、读取、列出、查找、删除及检查属性关键字。专用于手写着色器操作,与ShaderGraph模块区分。
用户请求创建或编辑手写shader 需要列出或查找.unity shader文件 检查shader文件的属性定义、关键字或编译错误
SkillsForUnity/unity-skills~/skills/shader/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-shader -g -y
SKILL.md
Frontmatter
{
    "name": "unity-shader",
    "description": "Manage HLSL\/ShaderLab .shader files — create, read, list, find, delete, and inspect shader properties\/keywords. Use when creating or editing handwritten shaders, listing or finding .shader files, or inspecting their properties and keywords, even if the user just says \"写个shader\" or \"着色器文件\". 管理 HLSL\/ShaderLab .shader 文件(创建、读取、列出、查找、删除、检查 shader 属性\/关键字);当用户要创建或编辑手写 shader、列出或查找 .shader 文件、或检查其属性与关键字时使用。"
}

Unity Shader Skills

Work with .shader HLSL/ShaderLab files (create from templates, read source, list, find, get keywords/properties/variants, check errors, delete, toggle global keywords). For node-based ShaderGraph use the shadergraph module.

Operating Mode

  • Query skills (shader_read, shader_list, shader_find, shader_get_properties, shader_check_errors, shader_get_keywords, shader_get_variant_count) are SkillMode.SemiAuto — they run in all three modes without grant.
  • Mutating skills (shader_create, shader_create_urp, shader_set_global_keyword) are SkillMode.FullAuto — under Approval they need user grant (grant triggers one server-side execute returning the result); under Auto / Bypass they execute directly.
  • shader_delete carries SkillOperation.Delete and is auto-forbidden in Approval / Auto modes (NeverInSemi). Only Bypass or the user-managed Allowlist can run it.

Guardrails

DO NOT (common hallucinations):

  • shader_set_property does not exist → use material_set_float/material_set_color/etc. on the material, not the shader
  • shader_apply / shader_assign do not exist → use material_set_shader to change a material's shader
  • shader_get_properties returns shader property definitions (name/type/range), not current values → for material instance values use material_get_properties
  • Shader names are case-sensitive and path-like: "Standard", "Universal Render Pipeline/Lit", not "standard" or "URP Lit"

Routing:

  • For material property changes → use material module
  • For shader keyword control → material_set_keyword (material module)
  • For global shader keywords → shader_set_global_keyword (this module)

Skills Overview

Skill Description
shader_create Create shader file
shader_read Read shader source
shader_list List all shaders
shader_find Find shader by name
shader_delete Delete shader file
shader_get_properties Get shader properties
shader_check_errors Check shader for compilation errors
shader_get_keywords Get shader keyword list
shader_get_variant_count Get shader variant count for performance analysis
shader_create_urp Create a URP shader from template
shader_set_global_keyword Enable or disable a global shader keyword

Skills

shader_create

Create a shader file. The template parameter is raw shader source code that gets written verbatim into the .shader file — it is not a preset name. If you pass template="Standard" the literal string Standard will be written to disk and the shader will fail to compile.

Parameter Type Required Default Description
shaderName string Yes - Shader name written into the Shader "..." declaration (e.g., "Custom/MyShader")
savePath string Yes - Save path (e.g., "Assets/Shaders/My.shader")
template string No null Full ShaderLab/HLSL source string. When omitted, a built-in Unlit template (_MainTex + _Color, single CGPROGRAM pass) is used. There are no other built-in presets.

For a URP Unlit / Lit preset, use shader_create_urp (type: "Unlit" | "Lit") instead — it actually selects a template by name.

shader_read

Read shader source code.

Parameter Type Required Description
shaderPath string Yes Shader asset path

Returns: {path, lines, content}

shader_list

List all shaders in project.

Parameter Type Required Default Description
filter string No null Name filter
limit int No 100 Max results

Returns: {count, shaders: [{path, name, propertyCount}]}

shader_find

Find a shader by name.

Parameter Type Required Description
searchName string Yes Shader name to find

Returns: {found, name, path}

shader_delete

Delete a shader file.

Parameter Type Required Description
shaderPath string Yes Shader asset path

shader_get_properties

Get all properties defined in a shader.

Parameter Type Required Description
shaderNameOrPath string Yes Shader name or shader asset path

Returns: {success, properties: [{name, type, description}]}

shader_check_errors

Check shader for compilation errors.

Parameter Type Required Default Description
shaderNameOrPath string Yes - Shader name or asset path (e.g., "Custom/MyShader" or "Assets/Shaders/My.shader")

Returns: { shaderName, hasErrors, messageCount }

shader_get_keywords

Get shader keyword list.

Parameter Type Required Default Description
shaderNameOrPath string Yes - Shader name or asset path (e.g., "Custom/MyShader" or "Assets/Shaders/My.shader")

Returns: { shaderName, keywordCount, keywords: [{ name, type }] }

shader_get_variant_count

Get shader variant count for performance analysis.

Parameter Type Required Default Description
shaderNameOrPath string Yes - Shader name or asset path (e.g., "Custom/MyShader" or "Assets/Shaders/My.shader")

Returns: { shaderName, subshaderCount, totalPasses }

shader_create_urp

Create a URP shader from template (type: Unlit or Lit).

Parameter Type Required Default Description
shaderName string Yes - Shader name (e.g., "Custom/MyURPShader")
savePath string Yes - Save path (e.g., "Assets/Shaders/MyURP.shader")
type string No "Unlit" Template type: "Unlit" or "Lit"

Returns: { success, shaderName, path, type }

shader_set_global_keyword

Enable or disable a global shader keyword.

Parameter Type Required Default Description
keyword string Yes - Global shader keyword name
enabled bool Yes - true to enable, false to disable

Returns: { success, keyword, enabled }


Example Usage

import unity_skills

# Create an unlit shader
unity_skills.call_skill("shader_create",
    shaderName="Custom/MyUnlit",
    savePath="Assets/Shaders/MyUnlit.shader",
    template="Unlit"
)

# Create a surface shader
unity_skills.call_skill("shader_create",
    shaderName="Custom/MyPBR",
    savePath="Assets/Shaders/MyPBR.shader",
    template="Standard"
)

# Read shader source
source = unity_skills.call_skill("shader_read",
    shaderPath="Assets/Shaders/MyUnlit.shader"
)
print(source['content'])

# List all custom shaders
shaders = unity_skills.call_skill("shader_list", filter="Custom")
for shader in shaders['shaders']:
    print(f"{shader['name']}: {shader['path']}")

Best Practices

  1. Use consistent shader naming (Category/Name)
  2. Organize shaders in dedicated folder
  3. Start with templates, modify as needed
  4. Test shaders in different lighting conditions
  5. Consider mobile compatibility for builds

Exact Signatures

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

用于Unity Shader Graph的创建、结构检查及节点受控编辑。支持半自动查询与全自动修改,需先获取结构信息再操作。严格限制反射调用版本,禁止直接删除操作,适用于着色器图资产管理工作流。
创建Shader Graph 检查Shader Graph结构 编辑黑板或节点 用户提及shader graph或着色器图
SkillsForUnity/unity-skills~/skills/shadergraph/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-shadergraph -g -y
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.

Unity Skills模块索引,用于浏览功能与建议型模块目录,确认各模块的操作模式要求(如审批/自动/绕过),并帮助用户根据任务需求选择正确的Unity处理模块。
查找某事由哪个Unity模块处理 浏览模块目录 确认模块的模式要求 询问有哪些Unity技能
SkillsForUnity/unity-skills~/skills/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-skills-index -g -y
SKILL.md
Frontmatter
{
    "name": "unity-skills-index",
    "description": "Index of all Unity Skills modules — functional (REST) modules and advisory (design) modules. Browse available modules, check operating-mode requirements (Approval\/Auto\/Bypass), and pick the right module for a task. Use when looking for which Unity module handles something, browsing the module catalog, or checking a module's mode requirements, even if the user just says \"有哪些 Unity 技能\" or \"Unity 模块列表\". Unity Skills 所有模块的索引(功能型 REST 模块与建议型设计模块);当用户要查找某事由哪个 Unity 模块处理、浏览模块目录、或确认模块的模式要求时使用。"
}

Unity Skills - Module Index

Module docs. Start with ../SKILL.md for mode switching and schema-first rules.

Multi-instance: For version-specific projects, call unity_skills.set_unity_version(...) first. Schema-first: Use GET /skills/schema or unity_skills.get_skill_schema() for exact signatures. Load module docs for workflow guidance and guardrails.

Modules

Mode legend (v1.9.0+, caller-facing — describes what the caller can do, not the C# attribute):

  • SA — module skills mostly run directly in all three modes (Approval / Auto / Bypass) without a grant.
  • FA — module skills mostly require user grant under Approval (single-shot one-step execution); under Auto / Bypass they run directly with audit only.
  • Mixed — module is split between SA and FA; check per-skill mode returned by GET /skills before calling.
  • Suffix * — module contains auto-forbidden skills (Delete / Play Mode / Domain Reload / high-risk). These return MODE_FORBIDDEN under Approval and Auto; only Bypass runs them, or the user can permanently allow them via the Allowlist. Never attempt grant for them.

Labels are guidance only; the per-skill mode field on GET /skills is authoritative.

Module Mode Description Batch Support
gameobject FA* Object create/move/parent Yes
component Mixed* Component add/remove/configure Yes
material FA Material property edits Yes
light FA Light create/configure Yes
prefab FA Prefab create/apply/spawn Yes
asset SA* Asset refresh/find/info Yes
batch SA Batch and async jobs Built-in
ui FA UGUI Canvas/UI creation Yes
uitoolkit Mixed* UXML/USS/UIDocument No
script SA* Script create/read/update Yes
scene SA* Scene load/save/query No
editor SA* Play/select/undo/redo No
animator FA Animator controllers No
shader Mixed* Shader create/list No
shadergraph Mixed* Shader Graph create/inspect/blackboard edit/constrained node editing No
graphics Mixed GraphicsSettings / QualitySettings / SRP assets No
volume Mixed* Volume / VolumeProfile / VolumeComponent No
postprocess FA* Modern URP/HDRP post-processing No
urp Mixed* URP asset / renderer / renderer features No
decal Mixed* URP Decal Projector workflow Yes
console SA Log capture/filter No
validation SA* Broken reference checks No
importer Mixed Texture/audio/model import Yes
cinemachine FA* VCam operations No
probuilder FA* ProBuilder mesh edits No
xr FA XRI setup No
terrain FA Terrain create/paint No
physics Mixed Raycast/overlap/gravity No
navmesh Mixed* NavMesh bake/query No
timeline FA* Timeline tracks/clips No
workflow SA* Task snapshots/undo No
cleaner SA* Unused/duplicate assets No
smart FA* Query/layout/auto-bind No
perception SA Scene/project analysis No
camera FA Scene View camera No
event Mixed* UnityEvent wiring No
package Mixed* UPM install/query No
project SA Project info/settings No
profiler SA Perf statistics No
optimization Mixed Asset optimization No
sample Mixed* Demo/test skills No
debug SA Compile/system diagnostics No
test Mixed Unity Test Runner No
bookmark SA Scene View bookmarks No
history SA Undo/redo history No
scriptableobject Mixed* ScriptableObject assets No
netcode Mixed* Netcode for GameObjects setup, prefabs, lifecycle, host/server/client Yes
yooasset Mixed* YooAsset hot-update: build bundles, Collector CRUD, BuildReport asset/dependency analysis, PlayMode runtime validation, Reporter/Debugger/AssetArtScanner tools Yes
dotween Mixed* DOTween Pro DOTweenAnimation editor-time configuration (add/batch/stagger/tune) Yes

Advisory Design Modules

These modules provide design guidance only.

Module Description
project-scout Inspect existing project
architecture Plan system boundaries
adr Record tradeoffs
performance Review hot paths
asmdef Plan asmdef deps
blueprints Small-game blueprints
script-roles Assign class roles
scene-contracts Define scene wiring
testability Extract testable logic
patterns Choose patterns
async Choose async model
inspector Design authoring UX
scriptdesign Review script structure
netcode-design Netcode source-anchored rules (lifecycle/ownership/RPC/variables/spawn/scene/transport/pitfalls)
yooasset-design YooAsset v2.3.18 source-anchored rules (init/default-package shortcuts/playmode/handles/loading/update/filesystem/build/pitfalls)
addressables-design Addressables dual-version (1.22.3 Unity 2022 / 2.9.1 Unity 6) source-anchored rules (init/handles/loading/scene/update/download/assetref/pitfalls) with migration table
unitask-design UniTask 2.5.10 source-anchored rules (basics/playerloop/cancellation/composition/conversion/asyncenumerable/triggers/pitfalls)
dotween-design DOTween 1.3.015 source-anchored rules (basics/tween/sequence/shortcuts/ease/lifetime/integration/pitfalls)
shadergraph-design ShaderGraph dual-version source-anchored rules (versions/node subset/recipes/pitfalls/review)
yaml-editing Safe hand-edit rules for serialized YAML (.unity/.prefab/.asset/.meta/ProjectSettings) when REST cannot reach — reference/fileID repair, .meta/GUID safety, ProjectSettings patch, merge conflict

Batch-First Rule

When a task touches 2+ objects in Auto / Bypass mode (or after a successful grant under Approval), prefer *_batch skills over repeated single-item calls.

Skill Naming Convention

Skills follow <module>_<action> or <module>_<action>_batch. Use schema to verify the exact prefix list. Special: scene_analyze, hierarchy_describe, project_stack_detectperception; job_*batch. If a skill name does not match a valid prefix or a schema result, do not invent it.

Unity场景智能操作工具,支持类SQL属性查询、空间邻近查询、自动布局排列及引用自动绑定。涵盖只读查询与需授权的全自动变换操作,适用于按条件筛选物体、整理排列或连线引用等复杂场景任务。
按组件属性或空间位置查询场景对象 自动排列或分布选中物体 自动绑定脚本引用字段 用户要求找出特定条件的物体
SkillsForUnity/unity-skills~/skills/smart/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-smart -g -y
SKILL.md
Frontmatter
{
    "name": "unity-smart",
    "description": "AI-powered scene operations — SQL-like and spatial object queries plus automatic layout and auto-binding. Use when querying scene objects by condition or proximity, auto-arranging objects, or auto-wiring references, even if the user just says \"找出所有…的物体\" or \"自动排列\". AI 驱动的场景操作(类 SQL 与空间对象查询、自动布局、自动绑定);当用户要按条件或邻近关系查询场景对象、自动排布对象、或自动连线引用时使用。"
}

Unity Smart Skills

Operating Mode

  • Approval:本模块 Mixed —— 只读查询 skill smart_scene_query / smart_scene_query_spatial(标 ReadOnly = true, Mode = SkillMode.SemiAuto)可直接执行;其余布局/绑定/变换类 skill (smart_scene_layout / smart_reference_bind / smart_align_to_ground / smart_distribute / smart_snap_to_grid / smart_randomize_transform / smart_select_by_component) 为 SkillMode.FullAuto,需用户 grant 单次执行返结果。
  • Auto / Bypass:直接执行。
  • 含 NeverInSemi 高危 skillsmart_replace_objects(Operation.Modify|Delete,会替换并删除原对象)。该 skill 在 Approval/Auto 下返 MODE_FORBIDDEN,仅 Bypass 或 Allowlist 命中可调。

DO NOT (common hallucinations):

  • smart_create / smart_build do not exist → smart skills are query/layout tools, not creation tools
  • smart_search / smart_query do not exist → use smart_scene_query (component property filters) or smart_scene_query_spatial (spatial region filters)
  • smart_move does not exist → use smart_snap_to_grid or smart_align_to_ground

Routing:

  • For creating objects → use gameobject module
  • For simple object search → use gameobject_find or scene_find_objects
  • For complex scene queries (SQL-like) → smart_scene_query (this module)

Skills

smart_scene_query

Find objects based on component property values (SQL-like).

Parameter Type Required Default Description
componentName string Yes - Component type (Light, Camera, MeshRenderer)
propertyName string Yes - Property to query (intensity, enabled, etc.)
op string No "==" ==, !=, >, <, >=, <=, contains
value string No null Value to compare
limit int No 50 Max results
query string No null Unsupported shorthand; if provided alone returns a guidance error

Example:

# Find all lights with intensity > 2
call_skill("smart_scene_query", componentName="Light", propertyName="intensity", op=">", value="2")

smart_scene_layout

Organize selected objects into a layout.

Parameter Type Required Default Description
layoutType string No "Linear" Linear, Grid, Circle, Arc
axis string No "X" X, Y, Z, -X, -Y, -Z
spacing float No 2.0 Space between items (or radius)
columns int No 3 For Grid layout
arcAngle float No 180 For Arc layout (degrees)
lookAtCenter bool No false Rotate to face center

Example:

# Arrange selected objects in a circle
call_skill("smart_scene_layout", layoutType="Circle", spacing=5)

smart_reference_bind

Auto-fill a List/Array field with matching objects.

Parameter Type Required Default Description
targetName string Yes - Target GameObject
componentName string Yes - Component on target
fieldName string Yes - Field to fill
sourceTag string No null Find by tag
sourceName string No null Find by name contains
appendMode bool No false Append instead of replace

Example:

# Fill GameManager.spawns with all SpawnPoint tagged objects
call_skill("smart_reference_bind", targetName="GameManager", componentName="GameController", fieldName="spawns", sourceTag="SpawnPoint")

smart_scene_query_spatial

Find objects within a sphere/box region, optionally filtered by component.

Parameter Type Required Default Description
x float Yes - Center X coordinate
y float Yes - Center Y coordinate
z float Yes - Center Z coordinate
radius float No 10 Search sphere radius
componentFilter string No null Only include objects with this component
limit int No 50 Max results

Returns: { success, count, center, radius, results }


smart_align_to_ground

Raycast selected objects downward to align them to the ground. Requires objects selected in Hierarchy first.

Parameter Type Required Default Description
maxDistance float No 100 Maximum raycast distance
alignRotation bool No false Align rotation to surface normal

Returns: { success, aligned, total }


smart_distribute

Evenly distribute selected objects between first and last positions. Requires at least 3 objects selected in Hierarchy first.

Parameter Type Required Default Description
axis string No "X" X, Y, Z, -X, -Y, -Z

Returns: { success, distributed, axis }


smart_snap_to_grid

Snap selected objects to a grid.

Parameter Type Required Default Description
gridSize float No 1 Grid cell size

Returns: { success, snapped, gridSize }


smart_randomize_transform

Randomize position/rotation/scale of selected objects within ranges.

Parameter Type Required Default Description
posRange float No 0 Position randomization range
rotRange float No 0 Rotation randomization range (degrees)
scaleMin float No 1 Minimum uniform scale
scaleMax float No 1 Maximum uniform scale

Returns: { success, randomized }


smart_replace_objects

Replace selected objects with a prefab (preserving transforms). Requires objects selected in Hierarchy first.

Parameter Type Required Default Description
prefabPath string Yes - Asset path to the replacement prefab

Returns: { success, replaced, prefab }


smart_select_by_component

Select all objects that have a specific component.

Parameter Type Required Default Description
componentName string Yes - Component type name to search for

Returns: { success, selected, component }


Exact Signatures

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

用于在Unity中创建、编辑地形,包括生成高度图、雕刻平滑区域及绘制纹理层。支持通过自然噪声或手动操作构建地形,并处理材质与物体放置路由。
用户要求创建或编辑地形 需要雕刻或平滑高度图 需要绘制地形纹理层 提及“地形”或“刷地面”
SkillsForUnity/unity-skills~/skills/terrain/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-terrain -g -y
SKILL.md
Frontmatter
{
    "name": "unity-terrain",
    "description": "Operate on Unity Terrain — create TerrainData, sculpt heights, paint texture layers, and smooth\/flatten regions. Use when creating or editing terrain, sculpting or smoothing the heightmap, or painting terrain texture layers, even if the user just says \"地形\" or \"刷地面\". 操作 Unity Terrain(创建 TerrainData、雕刻高度、绘制纹理层、平滑\/压平区域);当用户要创建或编辑地形、雕刻或平滑高度图、或绘制地形纹理层时使用。"
}

Unity Terrain Skills

Guardrails

Operating Mode (v1.9 three-tier):

  • Approval (default): query skills (terrain_get_info, terrain_get_height) run directly. Create/modify skills (terrain_create, terrain_set_height, terrain_set_heights_batch, terrain_add_hill, terrain_generate_perlin, terrain_smooth, terrain_flatten, terrain_paint_texture) are FullAuto — on MODE_RESTRICTED, run the grant protocol; /permission/grant executes the skill server-side and returns the result.
  • Auto / Bypass: SemiAuto and FullAuto run directly.
  • This module contains no Delete / PlayMode / Reload / RiskLevel="high" skills — nothing auto-classifies as forbidden. To remove a terrain delete the asset via asset_delete (subject to its own forbidden rules).

Note: All sculpt/paint operations require an existing Terrain in the scene, or use terrain_create to generate one.

DO NOT (common hallucinations):

  • terrain_set_texture does not exist → use terrain_paint_texture with layer index and brush parameters
  • terrain_add_tree / terrain_add_grass do not exist → these require Unity Terrain tools or custom scripts
  • terrain_set_size does not exist → terrain dimensions are set at creation via terrain_create
  • terrain_import_heightmap / terrain_set_heights do not exist → use terrain_set_heights_batch with a 2D heights array ([z][x] values 0-1)

Routing:

  • For terrain material → use material module on terrain's material
  • For objects on terrain → use gameobject module to create/place objects

Skills Overview

Skill Description
terrain_create Create new Terrain with TerrainData
terrain_get_info Get terrain size, resolution, layers
terrain_get_height Get height at world position
terrain_set_height Set height at normalized coords
terrain_set_heights_batch Batch set heights in region
terrain_add_hill ⭐ Add smooth hill with radius and falloff
terrain_generate_perlin ⭐ Generate natural terrain using Perlin noise
terrain_smooth ⭐ Smooth terrain to reduce sharp edges
terrain_flatten ⭐ Flatten terrain to target height
terrain_paint_texture Paint texture layer at position

Skills

terrain_create

Create a new Terrain GameObject with TerrainData asset.

Parameter Type Required Default Description
name string No "Terrain" Terrain name
width int No 500 Terrain width (X)
length int No 500 Terrain length (Z)
height int No 100 Max terrain height (Y)
heightmapResolution int No 513 Heightmap resolution (power of 2 + 1)
x, y, z float No 0 Position

Returns: {success, name, instanceId, terrainDataPath, size, position}

terrain_get_info

Get terrain information.

Parameter Type Required Description
name string No* Terrain name
instanceId int No* Instance ID

*If neither provided, uses first terrain in scene

Returns: {success, name, instanceId, position, size, heightmapResolution, alphamapResolution, detailResolution, terrainLayerCount, layers}

terrain_get_height

Get terrain height at world position.

Parameter Type Required Description
worldX float Yes World X coordinate
worldZ float Yes World Z coordinate
name string No Terrain name

Returns: {success, worldX, worldZ, height, worldY}

terrain_set_height

Set height at normalized coordinates.

Parameter Type Required Description
normalizedX float Yes X position (0-1)
normalizedZ float Yes Z position (0-1)
height float Yes Height value (0-1)
name string No Terrain name
instanceId int No Terrain instance ID

Returns: {success, normalizedX, normalizedZ, height, pixelX, pixelZ}

terrain_set_heights_batch

⚠️ BATCH SKILL: Set heights in rectangular region.

Parameter Type Required Description
startX int Yes Start X pixel index
startZ int Yes Start Z pixel index
heights float[][] Yes 2D array [z][x] with values 0-1
name string No Terrain name
instanceId int No Terrain instance ID

Returns: {success, startX, startZ, modifiedWidth, modifiedLength, totalPointsModified}

# Example: Create a 10x10 hill
heights = [[0.5 - abs(x-5)/10 - abs(z-5)/10 for x in range(10)] for z in range(10)]
call_skill("terrain_set_heights_batch", startX=50, startZ=50, heights=heights)

terrain_add_hill

RECOMMENDED: Add a smooth, natural-looking hill to the terrain.

Parameter Type Required Default Description
normalizedX float Yes - X position (0-1)
normalizedZ float Yes - Z position (0-1)
radius float No 0.2 Hill radius (0-1, relative to terrain size)
height float No 0.5 Hill height (0-1)
smoothness float No 1.0 Smoothness factor (higher = smoother)
name string No null Terrain name
instanceId int No 0 Terrain instance ID

Returns: {success, centerX, centerZ, radius, height, affectedArea}

# Add a large smooth hill at center
call_skill("terrain_add_hill",
    normalizedX=0.5, normalizedZ=0.5,
    radius=0.3, height=0.6, smoothness=2.0)

# Add multiple hills for varied terrain
for i in range(5):
    call_skill("terrain_add_hill",
        normalizedX=random.uniform(0.2, 0.8),
        normalizedZ=random.uniform(0.2, 0.8),
        radius=random.uniform(0.1, 0.25),
        height=random.uniform(0.3, 0.7))

terrain_generate_perlin

RECOMMENDED: Generate natural-looking terrain using Perlin noise algorithm.

Parameter Type Required Default Description
scale float No 20.0 Noise scale (lower = larger features)
heightMultiplier float No 0.3 Height intensity (0-1)
octaves int No 4 Detail layers (more = more detail)
persistence float No 0.5 Amplitude decrease per octave
lacunarity float No 2.0 Frequency increase per octave
seed int No 0 Random seed (0 = random)
name string No null Terrain name

Returns: {success, resolution, scale, heightMultiplier, octaves, persistence, lacunarity, seed}

# Generate rolling hills
call_skill("terrain_generate_perlin",
    scale=25.0, heightMultiplier=0.4, octaves=4)

# Generate mountainous terrain
call_skill("terrain_generate_perlin",
    scale=15.0, heightMultiplier=0.6, octaves=6, persistence=0.6)

# Generate with specific seed for reproducibility
call_skill("terrain_generate_perlin",
    scale=20.0, heightMultiplier=0.5, seed=12345)

terrain_smooth

⭐ Smooth terrain heights to reduce sharp edges and create natural transitions.

Parameter Type Required Default Description
normalizedX float Yes - X position (0-1)
normalizedZ float Yes - Z position (0-1)
radius float No 0.1 Smoothing radius (0-1)
iterations int No 1 Number of smoothing passes
name string No null Terrain name
instanceId int No 0 Terrain instance ID

Returns: {success, centerX, centerZ, radius, iterations, affectedArea}

# Smooth a specific area
call_skill("terrain_smooth",
    normalizedX=0.5, normalizedZ=0.5,
    radius=0.2, iterations=3)

terrain_flatten

⭐ Flatten terrain to a specific height in a region.

Parameter Type Required Default Description
normalizedX float Yes - X position (0-1)
normalizedZ float Yes - Z position (0-1)
targetHeight float No 0.5 Target height (0-1)
radius float No 0.1 Flatten radius (0-1)
strength float No 1.0 Flatten strength (0-1)
name string No null Terrain name
instanceId int No 0 Terrain instance ID

Returns: {success, centerX, centerZ, targetHeight, radius, strength}

# Create a flat plateau
call_skill("terrain_flatten",
    normalizedX=0.5, normalizedZ=0.5,
    targetHeight=0.6, radius=0.15, strength=1.0)

terrain_paint_texture

Paint terrain texture layer. Requires terrain layers already configured.

Parameter Type Required Default Description
normalizedX float Yes - X position (0-1)
normalizedZ float Yes - Z position (0-1)
layerIndex int Yes - Terrain layer index (0-based; use terrain_get_info to query available layers)
strength float No 1.0 Paint strength
brushSize int No 10 Brush size in pixels
name string No null Terrain name
instanceId int No 0 Terrain instance ID

Returns: {success, layerIndex, layerName, centerX, centerZ, brushSize, strength}


Example Usage

import unity_skills

# === Method 1: Quick terrain with Perlin noise (RECOMMENDED) ===
# Create terrain
result = unity_skills.call_skill("terrain_create",
    name="MyTerrain", width=200, length=200, height=50)

# Generate natural terrain with Perlin noise
unity_skills.call_skill("terrain_generate_perlin",
    scale=20.0,           # Larger scale = bigger features
    heightMultiplier=0.4, # Height intensity
    octaves=5,            # More octaves = more detail
    persistence=0.5,
    lacunarity=2.0)

# === Method 2: Add individual smooth hills ===
# Create flat terrain
result = unity_skills.call_skill("terrain_create",
    name="HillyTerrain", width=200, length=200, height=50)

# Add multiple smooth hills
import random
for i in range(8):
    unity_skills.call_skill("terrain_add_hill",
        normalizedX=random.uniform(0.2, 0.8),
        normalizedZ=random.uniform(0.2, 0.8),
        radius=random.uniform(0.15, 0.3),
        height=random.uniform(0.3, 0.6),
        smoothness=1.5)  # Higher = smoother

# Smooth the entire terrain for natural transitions
unity_skills.call_skill("terrain_smooth",
    normalizedX=0.5, normalizedZ=0.5,
    radius=0.5, iterations=2)

# === Method 3: Create specific features ===
# Create a mountain
unity_skills.call_skill("terrain_add_hill",
    normalizedX=0.5, normalizedZ=0.5,
    radius=0.25, height=0.8, smoothness=2.0)

# Create a flat plateau on top
unity_skills.call_skill("terrain_flatten",
    normalizedX=0.5, normalizedZ=0.5,
    targetHeight=0.8, radius=0.1, strength=1.0)

# === Method 4: Manual height control (advanced) ===
import math
heights = []
for z in range(64):
    row = []
    for x in range(64):
        # Distance from center
        dx = (x - 32) / 32
        dz = (z - 32) / 32
        dist = math.sqrt(dx*dx + dz*dz)
        # Smooth hill with cosine falloff
        h = max(0, 0.5 * math.cos(dist * math.pi / 2)) if dist < 1 else 0
        row.append(h)
    heights.append(row)

unity_skills.call_skill("terrain_set_heights_batch",
    startX=100, startZ=100, heights=heights)

# Query height at world position
info = unity_skills.call_skill("terrain_get_height", worldX=100, worldZ=100)
print(f"Height at position: {info['height']}")

Workflow Integration

All terrain operations support workflow undo/redo:

# Start workflow session
unity_skills.call_skill("workflow_session_start", tag="Create Terrain")

# Create and modify terrain
unity_skills.call_skill("terrain_create", name="TestTerrain")
unity_skills.call_skill("terrain_generate_perlin", scale=20, heightMultiplier=0.5)
unity_skills.call_skill("terrain_add_hill", normalizedX=0.3, normalizedZ=0.3, radius=0.2)

# End session
unity_skills.call_skill("workflow_session_end")

# Later: Undo entire terrain creation
sessions = unity_skills.call_skill("workflow_session_list")
unity_skills.call_skill("workflow_session_undo", sessionId=sessions['sessions'][0]['sessionId'])

Exact Signatures

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

异步执行Unity测试操作,包括运行、发现、列出及取消测试,轮询结果并生成模板。支持EditMode/PlayMode,需处理异步JobId轮询,注意并发限制及特定模式下的审批要求。
用户请求运行或检查Unity单元测试(如'跑测试') 需要发现、列出或取消Unity测试任务 轮询异步测试任务的执行结果 生成EditMode或PlayMode测试文件模板
SkillsForUnity/unity-skills~/skills/test/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-test -g -y
SKILL.md
Frontmatter
{
    "name": "unity-test",
    "description": "Run Unity Test Runner operations asynchronously — run\/discover\/list\/cancel tests, poll job results, and create test templates. Use when running EditMode\/PlayMode tests, discovering or listing tests, polling async test results, or scaffolding test files, even if the user just says \"跑测试\" or \"单元测试\". 异步执行 Unity Test Runner 操作(运行\/发现\/列出\/取消测试、轮询任务结果、创建测试模板);当用户要运行 EditMode\/PlayMode 测试、发现或列出测试、轮询异步测试结果、或生成测试文件时使用。"
}

Test Skills

Run and manage Unity tests.

Operating Mode

  • Approval: 只读 skill(test_get_result / test_list / test_discover_get_result / test_get_last_result / test_list_categories / test_smoke_skills / test_get_summary,标 SkillMode.SemiAuto)直接执行;执行/发现/创建型 skill(test_run / test_run_by_name / test_discover_start / test_cancel / test_create_editmode / test_create_playmode,默认 SkillMode.FullAuto)需用户 grant,grant 后服务端一步执行返结果(job 立即排进队列)。

  • Auto / Bypass: 直接执行。

  • 本模块有 4 个 NeverInSemi skill(按 IsForbiddenInSemi 自动判定):

    • MayEnterPlayMode = true: test_runtest_run_by_name
    • MayTriggerReload = true: test_create_editmodetest_create_playmode(同时标 MutatesAssets = true

    Approval 模式下这 4 个返 MODE_FORBIDDEN,仅 Bypass 或 Allowlist 命中可绕过。注意:test_run(testMode="PlayMode") / test_run_by_name 会让 Unity TestRunner 切入 PlayMode;test_create_editmode / test_create_playmode 落盘新的 .cs 文件后会触发 Domain Reload。

  • 异步约定test_run / test_run_by_name / test_discover_start / test_create_* 立即返回 jobId;用 test_get_result(jobId) / test_discover_get_result(jobId) 轮询;Unity TestRunner 串行化,正在跑测试时不要再起第二个 test_run

DO NOT (common hallucinations):

  • test_run_all does not exist → use test_run or test_run_by_name
  • test_create_template does not exist → use test_create_editmode or test_create_playmode
  • test_get_status does not exist → use test_get_result with jobId from test run
  • Test skills are async — they return a jobId, poll with test_get_result(jobId)
  • Unity Test Runner is serialized here: do not start a second test_run while another test job is still active
  • Prefer unity_skills.get_skills(category="Test") or GET /skills/schema for exact signatures instead of guessing from memory

Routing:

  • For compile error checking → use debug module's debug_check_compilation
  • For test script creation → test_create_editmode / test_create_playmode, then modify via script module
  • For broad regression probes across many skills → test_smoke_skills, which uses transient probes to avoid polluting workflow/batch persistence

Skills

test_list

List available tests via Unity Test Runner async discovery. Returns pendingDiscovery=true + discoveryJobId on first call (cache miss) — poll test_discover_get_result(jobId) then retry test_list. Parameters:

  • testMode (string, optional): EditMode or PlayMode. Default: EditMode.
  • limit (int, optional): Max tests to list. Default: 100.

Returns: { success, testMode, count, tests, pendingDiscovery, discoveryJobId, discoveryStatus }

test_run

Run Unity tests asynchronously. Returns a jobId immediately; poll with test_get_result(jobId). Parameters:

  • testMode (string, optional): EditMode or PlayMode. Default: EditMode. Returns: { success, status, jobId, kind, testMode, filter, message }

test_get_result

Get the result of a test run. Parameters:

  • jobId (string, required): Job ID from test_run / test_run_by_name.

Returns: { success, jobId, status, totalTests, passedTests, failedTests, skippedTests, inconclusiveTests, otherTests, failedTestNames, elapsedSeconds, resultSummary, error }

test_cancel

Cancel a running test job if supported (Unity TestRunner has no hard cancel — best-effort). Parameters:

  • jobId (string, required): Job ID to cancel.

Returns: { success, jobId, status, cancelled, note, warnings }

test_discover_start

Start asynchronous Unity Test Runner discovery and return a discovery jobId. Use this directly when you want explicit control over discovery; otherwise test_list / test_list_categories will trigger it on cache miss.

Parameter Type Required Default Description
testMode string No EditMode EditMode or PlayMode

Returns: { success, status, jobId, kind, testMode, message }

test_discover_get_result

Get the result of an asynchronous Unity Test Runner discovery job.

Parameter Type Required Default Description
jobId string Yes - Discovery job ID
limit int No 100 Max tests to return

Returns: { success, jobId, status, testMode, discoveryMode, count, tests, error }

test_run_by_name

Run specific tests by class or method name.

Parameter Type Required Default Description
testName string Yes - Test class or method name to run
testMode string No EditMode EditMode or PlayMode

Returns: { success, jobId, testName, testMode }

test_get_last_result

Get the most recent test run result.

No parameters.

Returns: { jobId, status, total, passed, failed, skipped, inconclusive, other, failedNames }

test_list_categories

List test categories via Unity Test Runner async discovery. Same cache-miss / poll pattern as test_list.

Parameter Type Required Default Description
testMode string No EditMode EditMode or PlayMode

Returns: { success, count, categories, pendingDiscovery, discoveryJobId, discoveryStatus }

test_smoke_skills

Run a reusable smoke test across registered skills.

Parameter Type Required Default Description
category string No - Only test one skill category
nameContains string No - Filter skills by partial name
excludeNamesCsv string No - Comma-separated skill names to exclude
executeReadOnly bool No true Execute safe read-only skills directly
includeMutating bool No true Include mutating skills via dryRun smoke testing
limit int No 0 Max skills to inspect; 0 means all

Returns: { success, totalSkills, executedCount, dryRunCount, failureCount, results }

test_create_editmode

Create an EditMode test script template. Writes the .cs file synchronously and returns a compile-monitor jobId; the script create will trigger a Domain Reload, so the server may be temporarily unavailable — serverAvailability carries the transient-unavailable hint.

Parameter Type Required Default Description
testName string Yes - Name of the test class to create
folder string No Assets/Tests/Editor Folder path for the test script

Returns: { success, status, path, testName, jobId, serverAvailability }

test_create_playmode

Create a PlayMode test script template. Writes the .cs file synchronously and returns a compile-monitor jobId; same Domain Reload + transient-unavailable note as test_create_editmode.

Parameter Type Required Default Description
testName string Yes - Name of the test class to create
folder string No Assets/Tests/Runtime Folder path for the test script

Returns: { success, status, path, testName, jobId, serverAvailability }

test_get_summary

Get aggregated test summary across all runs.

No parameters.

Returns: { success, totalRuns, completedRuns, totalPassed, totalFailed, totalSkipped, totalInconclusive, totalOther, allFailedTests }


Minimal Example

import unity_skills, time

# Run tests and poll for result (async pattern required)
result = unity_skills.call_skill("test_run", testMode="EditMode")
job_id = result["jobId"]

# Poll until done (test_* skills are async)
for _ in range(30):
    status = unity_skills.call_skill("test_get_result", jobId=job_id)
    if status.get("status") == "Completed":
        print(f"Passed: {status['totalPassed']}, Failed: {status['totalFailed']}")
        break
    time.sleep(2)

Exact Signatures

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

为Unity项目提供可测试性建议,指导如何将业务逻辑从MonoBehaviour中剥离至纯C#类,并规划EditMode与PlayMode测试策略。适用于提升代码可测性、抽取单元测试逻辑或解决“代码不好测”等场景。
怎么测试 代码不好测 提升可测试性 抽取逻辑 规划测试策略
SkillsForUnity/unity-skills~/skills/testability/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-testability -g -y
SKILL.md
Frontmatter
{
    "name": "unity-testability",
    "description": "Advises on Unity testability — isolating logic out of MonoBehaviour and planning EditMode\/PlayMode tests. Use when improving testability, extracting logic for unit tests, or planning a test strategy, even if the user just says \"怎么测试\" or \"代码不好测\". 为 Unity 可测试性提供建议(把逻辑从 MonoBehaviour 中剥离、规划 EditMode\/PlayMode 测试);当用户要提升可测试性、为单元测试抽取逻辑、或规划测试策略时使用。"
}

Unity Testability Advisor

Use this skill when deciding what logic should remain in Unity-facing classes and what should move into pure C# code.

Review Questions

  • Can the rule/algorithm run without Transform, GameObject, or scene state?
  • Can config be injected instead of read through static globals?
  • Can runtime decisions be moved to a plain C# class and called from a thin MonoBehaviour?
  • Does this need PlayMode coverage, or is EditMode enough?

Output Format

  • Logic that should move to pure C#
  • Logic that should stay Unity-facing
  • Suggested seams/interfaces
  • Candidate EditMode tests
  • Candidate PlayMode tests

Guardrails

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

  • Do not force test seams everywhere if the script is tiny and scene-bound.
  • Prefer a few meaningful seams over abstraction for its own sake.
用于在Unity中创建和编辑Timeline资产,支持添加动画、音频、激活等类型轨道及片段。适用于制作过场动画或序列,提供播放控制与对象绑定功能,需区分具体轨道技能避免幻觉。
用户请求制作过场动画 用户要求创建Timeline资产 用户提及添加轨道或片段 用户直接说'时间轴'
SkillsForUnity/unity-skills~/skills/timeline/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-timeline -g -y
SKILL.md
Frontmatter
{
    "name": "unity-timeline",
    "description": "Edit Unity Timeline — create Timeline assets and add typed tracks (animation, activation, audio, signal, etc.). Use when building cutscenes or sequences, creating a Timeline asset, or adding tracks and clips, even if the user just says \"时间轴\" or \"做个过场动画\". 编辑 Unity Timeline(创建 Timeline 资产、添加带类型的轨道:动画、激活、音频、信号等);当用户要制作过场或序列、创建 Timeline 资产、或添加轨道与片段时使用。"
}

Timeline Skills

Create and modify Unity Timeline assets — add typed tracks, drop clips on tracks, bind objects, set duration / wrap mode, and play/pause/stop the editor preview through the PlayableDirector.

Operating Mode

  • Approval:查询类 skill(timeline_list_tracks,源码标 SkillMode.SemiAuto)直接执行;其余变更/播放类(timeline_create / add_*_track / timeline_add_clip / timeline_set_duration / timeline_play / timeline_set_binding,标 SkillMode.FullAuto)需用户 grant,grant 后服务端一步执行返结果。
  • Auto / Bypass:未被禁列表拦截的 skill 直接执行。
  • 本模块含 Delete 类 skilltimeline_remove_track 标记为 SkillOperation.Delete,被 IsForbiddenInSemi 静态拦截 —— 仅 Bypass 模式或加入 Allowlist 才能调用。
  • timeline_play 仅驱动 Editor 预览(PlayableDirector.Evaluate / Play 在编辑器上下文),不会进入 Play mode。

DO NOT (common hallucinations):

  • timeline_create_animation / timeline_add_track do not exist → use the typed track skills: timeline_add_animation_track, timeline_add_audio_track, timeline_add_activation_track, timeline_add_control_track, timeline_add_signal_track
  • timeline_add_keyframe does not exist → Timeline uses clips, not direct keyframes; use timeline_add_clip
  • timeline_set_duration sets the Timeline asset duration, not individual clip duration

Routing:

  • For Animator parameters/states → use animator module
  • For runtime animation playback → use editor_play or write C# via script module

Skills

timeline_create

Create a new Timeline asset and Director instance.

Parameter Type Required Default Description
name string Yes - Name of the timeline/object
folder string No "Assets/Timelines" Folder to save asset

Returns: { success, assetPath, gameObjectName, directorInstanceId }

timeline_add_audio_track

Add an Audio track to a Timeline.

Parameter Type Required Default Description
name string No - GameObject name with PlayableDirector
instanceId int No 0 GameObject instance ID
path string No - GameObject hierarchy path
trackName string No "Audio Track" Name of the new track

Returns: { success, trackName }

timeline_add_animation_track

Add an Animation track to a Timeline, optionally binding an object.

Parameter Type Required Default Description
name string No - GameObject name with PlayableDirector
instanceId int No 0 GameObject instance ID
path string No - GameObject hierarchy path
trackName string No "Animation Track" Name of the new track
bindingObjectName string No - Name of the GameObject to bind (animator)

Returns: { success, trackName, boundObject }

timeline_add_activation_track

Add an Activation track to control object visibility.

Parameter Type Required Default Description
name string No - GameObject name with PlayableDirector
instanceId int No 0 GameObject instance ID
path string No - GameObject hierarchy path
trackName string No "Activation Track" Name of the new track

Returns: { success, trackName }

timeline_add_control_track

Add a Control track for nested Timelines or prefab spawning.

Parameter Type Required Default Description
name string No - GameObject name with PlayableDirector
instanceId int No 0 GameObject instance ID
path string No - GameObject hierarchy path
trackName string No "Control Track" Name of the new track

Returns: { success, trackName }

timeline_add_signal_track

Add a Signal track for event markers.

Parameter Type Required Default Description
name string No - GameObject name with PlayableDirector
instanceId int No 0 GameObject instance ID
path string No - GameObject hierarchy path
trackName string No "Signal Track" Name of the new track

Returns: { success, trackName }

timeline_remove_track

Remove a track by name from a Timeline.

Parameter Type Required Default Description
name string No - GameObject name with PlayableDirector
instanceId int No 0 GameObject instance ID
path string No - GameObject hierarchy path
trackName string No - Name of the track to remove

Returns: { success, removed }

timeline_list_tracks

List all tracks in a Timeline.

Parameter Type Required Default Description
name string No - GameObject name with PlayableDirector
instanceId int No 0 GameObject instance ID
path string No - GameObject hierarchy path

Returns: { count, tracks: [{ name, type, muted, clipCount }] }

timeline_add_clip

Add a clip to a track by track name.

Parameter Type Required Default Description
name string No - GameObject name with PlayableDirector
instanceId int No 0 GameObject instance ID
path string No - GameObject hierarchy path
trackName string No - Name of the target track
start double No 0 Clip start time in seconds
duration double No 1 Clip duration in seconds

Returns: { success, trackName, clipStart, clipDuration }

timeline_set_duration

Set Timeline duration and wrap mode.

Parameter Type Required Default Description
name string No - GameObject name with PlayableDirector
instanceId int No 0 GameObject instance ID
path string No - GameObject hierarchy path
duration double No 0 Fixed duration in seconds
wrapMode string No - Wrap mode: Hold/Loop/None

Returns: { success, duration, wrapMode }

timeline_play

Play, pause, or stop a Timeline (Editor preview).

Parameter Type Required Default Description
name string No - GameObject name with PlayableDirector
instanceId int No 0 GameObject instance ID
path string No - GameObject hierarchy path
action string No "play" Action: play/pause/stop

Returns: { success, action, time }

timeline_set_binding

Set the binding object for a track.

Parameter Type Required Default Description
name string No - GameObject name with PlayableDirector
instanceId int No 0 GameObject instance ID
path string No - GameObject hierarchy path
trackName string No - Name of the track
bindingObjectName string No - Name of the object to bind

Returns: { success, trackName, boundTo }

Exact Signatures

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

用于创建和布局 Unity UGUI 界面元素,支持 Canvas、按钮、文本等组件的生成与排版。提供批量创建及属性设置功能,需区分 UI Toolkit,删除操作应使用 gameobject 模块。
用户要求搭建 UGUI 界面或制作 UI 需要添加 Canvas 元素或调整 UI 布局
SkillsForUnity/unity-skills~/skills/ui/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-ui -g -y
SKILL.md
Frontmatter
{
    "name": "unity-ui",
    "description": "Create and lay out Unity UGUI (Canvas-based UI) — Canvas, panels, buttons, text, images, and layout groups. Use when building UGUI screens, adding Canvas elements, or arranging UI layout, even if the user just says \"做个UI\" or \"界面\". 创建与布局 Unity UGUI(基于 Canvas 的 UI:Canvas、面板、按钮、文本、图片、布局组);当用户要搭建 UGUI 界面、添加 Canvas 元素、或排布 UI 布局时使用。"
}

Unity UI Skills

Use this module for Unity UGUI / Canvas workflows. It is separate from UI Toolkit.

Batch-first: Prefer ui_create_batch when creating 2+ UI elements.

Operating Mode

  • Approval:查询类 skill(ui_find_all,源码标 SkillMode.SemiAuto)直接执行;其余创建/修改类(ui_create_* / ui_set_* / ui_add_* / ui_layout_children / ui_align_selected 等,标 SkillMode.FullAuto)需用户 grant,grant 后服务端一步执行返结果。
  • Auto / Bypass:所有 skill 直接执行;Auto 走 AI 自我评估,Bypass 全放行。
  • 本模块不含 Delete / PlayMode / Reload / 高危 skill,无 Bypass-only 拦截项。删除 UI 节点请走 gameobject 模块。

DO NOT (common hallucinations):

  • ui_add_canvas does not exist -> use ui_create_canvas
  • ui_create_label does not exist -> use ui_create_text
  • ui_create_checkbox does not exist -> use ui_create_toggle
  • ui_set_color does not exist -> use component_set_property on Image/Text, or the dedicated UI property skills when available
  • Do not confuse UGUI (ui) with UI Toolkit (uitoolkit)

Routing:

  • For UXML/USS/UIDocument -> use uitoolkit
  • For XR-compatible world-space Canvas conversion -> use xr_setup_ui_canvas
  • For text updates after creation -> use ui_set_text
  • For layout and alignment -> use ui_layout_children, ui_align_selected, ui_distribute_selected

Skills

Create Skills

Skill Use Key parameters
ui_create_canvas Create Canvas name?, renderMode?
ui_create_panel Create panel container name?, parent?, r/g/b/a?
ui_create_button Create button name?, parent?, text?, width/height?
ui_create_text Create text label name?, parent?, text?, fontSize?, r/g/b?
ui_create_image Create image name?, parent?, spritePath?, width/height?
ui_create_inputfield Create input field name?, parent?, placeholder?, width/height?
ui_create_slider Create slider name?, parent?, minValue?, maxValue?, value?
ui_create_toggle Create toggle name?, parent?, label?, isOn?
ui_create_dropdown Create dropdown name?, parent?, options?, width/height?
ui_create_scrollview Create ScrollRect hierarchy name?, parent?, width/height?, horizontal?, vertical?
ui_create_rawimage Create RawImage name?, parent?, texturePath?, width/height?
ui_create_scrollbar Create scrollbar name?, parent?, direction?, value?, size?
ui_create_batch Create multiple UI elements items (JSON string array)

Query and Layout Skills

Skill Use Key parameters
ui_find_all Find scene UI elements uiType?, limit?
ui_set_text Update text content name, text
ui_set_rect Set RectTransform size/offsets target, width, height, posX, posY, left/right/top/bottom?
ui_get_rect_transform Read full RectTransform data target
ui_set_rect_transform Set full RectTransform data anchors, pivot, offsets, local transform, width/height
ui_set_rect_transform_batch Set full RectTransform data for multiple elements items
ui_set_anchor Apply anchor preset target, preset?, setPivot?
ui_layout_children Vertical/Horizontal/Grid layout target, layoutType?, spacing?
ui_align_selected Align current selection alignment?
ui_distribute_selected Distribute current selection direction?

Property and Effect Skills

Skill Use Key parameters
ui_set_image Image type/fill/sprite target, type?, fillMethod?, fillAmount?, spritePath?
ui_add_layout_element Add LayoutElement constraints target, width/height prefs, flex values
ui_add_canvas_group Add CanvasGroup target, alpha?, interactable?, blocksRaycasts?
ui_add_mask Add Mask or RectMask2D target, maskType?, showMaskGraphic?
ui_add_outline Add Shadow/Outline effect target, effectType?, r/g/b/a?, distanceX/Y?
ui_configure_selectable Configure transitions/navigation/colors target, transition?, navigationMode?, color values

High-Frequency Defaults

Canvas and Parenting

  • ui_create_canvas defaults to ScreenSpaceOverlay.
  • Most create skills accept parent; if omitted, Unity will create under the active Canvas or scene root depending on the implementation context.
  • For reusable menu groups, create the Canvas once, then create a Panel and put all child controls under that panel.

Common Create Parameters

Skill High-frequency fields
ui_create_button text, width, height
ui_create_text text, fontSize, r/g/b
ui_create_image spritePath, width, height
ui_create_slider minValue, maxValue, value
ui_create_toggle label, isOn
ui_create_dropdown options
ui_create_scrollview horizontal, vertical, movementType

Important:

  • Most create skills do not take explicit x/y placement.
  • Create first, then place/anchor with ui_set_rect, ui_set_anchor, or ui_layout_children.

Full RectTransform Editing

Use ui_set_rect_transform when you need Inspector-level RectTransform coverage instead of a preset.

Skill Parameters
ui_get_rect_transform name, instanceId, path
ui_set_rect_transform target + anchorMinX/Y, anchorMaxX/Y, pivotX/Y, anchoredPosX/Y/Z, sizeDeltaX/Y, offsetMinX/Y, offsetMaxX/Y, localPosX/Y/Z, localRotX/Y/Z, localScaleX/Y/Z, width, height
ui_set_rect_transform_batch items JSON array with the same per-target fields

ui_get_rect_transform

Get full RectTransform data for a UI element.

Parameter Type Required Default Description
name string No* null GameObject name
instanceId int No* 0 GameObject instance ID
path string No* null Hierarchy path

Returns: { success, name, instanceId, path, anchorMin, anchorMax, pivot, anchoredPosition3D, sizeDelta, offsetMin, offsetMax, localPosition, localEulerAngles, localScale, rect }

ui_set_rect_transform

Set full RectTransform data for a UI element.

Parameter Type Required Default Description
name string No* null GameObject name
instanceId int No* 0 GameObject instance ID
path string No* null Hierarchy path
anchorMinX / anchorMinY float No null Anchor min
anchorMaxX / anchorMaxY float No null Anchor max
pivotX / pivotY float No null Pivot
anchoredPosX / anchoredPosY / anchoredPosZ float No null Anchored position 3D
sizeDeltaX / sizeDeltaY float No null Size delta
offsetMinX / offsetMinY float No null Offset min
offsetMaxX / offsetMaxY float No null Offset max
localPosX / localPosY / localPosZ float No null Local position
localRotX / localRotY / localRotZ float No null Local euler rotation
localScaleX / localScaleY / localScaleZ float No null Local scale
width / height float No null Size with current anchors

Returns: same shape as ui_get_rect_transform.

ui_set_rect_transform_batch

Set full RectTransform data for multiple UI elements.

Parameter Type Required Default Description
items json string Yes - JSON array of per-item target and RectTransform fields

Returns: { success, totalItems, successCount, failCount, results }

Layout and Anchoring Rules

  • ui_set_anchor is the fastest way to move a control into a standard layout position.
  • ui_set_rect is better for precise size/offset edits after anchoring.
  • ui_layout_children is preferred over hand-positioning every child when building vertical, horizontal, or grid menus.

Anchor presets commonly used in production:

  • MiddleCenter for modal/menu panels
  • TopLeft or TopRight for HUD corners
  • StretchAll for full-screen backgrounds

TextMeshPro Note

Text creation auto-detects TMP:

  • TMP available -> TextMeshProUGUI
  • TMP unavailable -> legacy Text

Read the response payload if you need to know which one was created before later component-specific edits.

Workflow Notes

  1. Create a Canvas first.
  2. Use panels to group related controls.
  3. Prefer ui_create_batch for menus, HUD groups, and repeated widgets.
  4. Use anchors and layout groups before hand-placing every child.
  5. Text creation auto-detects TextMeshPro. Responses indicate whether TMP was used.
  6. For world-space gameplay UI, build the Canvas here first, then convert for XR only if needed.
  7. ui_create_batch is mainly for bulk creation, not precise positioning. Follow it with layout or rect/anchor adjustments.
  8. ui_create_batch.items is a JSON string parameter in the current REST/API layer, not a raw array object.

Minimal Example

import unity_skills
import json

unity_skills.call_skill("ui_create_canvas", name="MainMenu")
unity_skills.call_skill("ui_create_panel", name="MenuPanel", parent="MainMenu", a=0.7)
unity_skills.call_skill("ui_set_rect", name="MenuPanel", width=320, height=240)
unity_skills.call_skill("ui_create_batch", items=json.dumps([
    {"type": "Button", "name": "StartBtn", "parent": "MenuPanel", "text": "Start", "width": 220, "height": 44},
    {"type": "Button", "name": "OptionsBtn", "parent": "MenuPanel", "text": "Options", "width": 220, "height": 44},
    {"type": "Button", "name": "QuitBtn", "parent": "MenuPanel", "text": "Quit", "width": 220, "height": 44}
]))

unity_skills.call_skill("ui_set_anchor", name="MenuPanel", preset="MiddleCenter")
unity_skills.call_skill("ui_layout_children", name="MenuPanel", layoutType="Vertical", spacing=12)

Exact Signatures

Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file. Load UI_REFERENCE.md for extended element creation details, property tables, and larger UGUI examples.

用于构建Unity UI Toolkit界面,支持创建编辑USS样式与UXML布局、配置UIDocument。需Unity 2022.3+,不混用UGUI。自动处理资源导入,部分写入操作需授权,删除操作受限。
用户要求使用UI Toolkit或UITK 需要编写或修改USS/UXML文件 配置UIDocument组件 创建或编辑运行时/编辑器UI
SkillsForUnity/unity-skills~/skills/uitoolkit/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-uitoolkit -g -y
SKILL.md
Frontmatter
{
    "name": "unity-uitoolkit",
    "description": "Build Unity UI Toolkit (UITK) UIs — create\/edit USS stylesheets and UXML layouts, and configure UIDocument components. Use when authoring runtime or editor UI with UI Toolkit, writing USS\/UXML, or wiring a UIDocument, even if the user just says \"UITK\" or \"UXML\". 构建 Unity UI Toolkit(UITK)界面(创建\/编辑 USS 样式表与 UXML 布局、配置 UIDocument 组件);当用户要用 UI Toolkit 编写运行时或编辑器 UI、编写 USS\/UXML、或接入 UIDocument 时使用。"
}

Unity UI Toolkit Skills

Use this module for Unity UI Toolkit only: UXML for structure, USS for styling, UIDocument for scene attachment, and PanelSettings for runtime rendering.

Requires Unity 2022.3+. Do not mix this module with ui_* UGUI/Canvas skills. Localization: Match visible UI text to the user's language. Chinese conversation -> Chinese labels/placeholders/button text. USS class names and CSS variables stay English.

Operating Mode

  • Approval:查询类 skill(uitk_read_file / uitk_find_files / uitk_get_panel_settings / uitk_list_documents / uitk_inspect_uxml / uitk_list_uss_variables / uitk_inspect_document,源码标 SkillMode.SemiAuto)直接执行;其余文件/场景写入类(uitk_create_* / uitk_write_file / uitk_add_* / uitk_modify_element 等,标 SkillMode.FullAuto)需用户 grant,grant 后服务端一步执行返结果。
  • Auto / Bypass:未被禁列表拦截的 skill 直接执行。
  • 本模块含 Delete 类 skilluitk_delete_fileuitk_remove_elementuitk_remove_uss_rule 标记为 SkillOperation.Delete,被 IsForbiddenInSemi 静态拦截 —— 仅 Bypass 模式或加入 Allowlist 才能调用。
  • Asset 重导行为:所有写文件/删文件 skill 通过 AssetDatabase.ImportAsset(path) 对单个 USS/UXML 资产单独触发导入,不会AssetDatabase.Refresh() 触发全项目扫描;批量创建依次单独 Import。但 USS/UXML 是 ScriptedImporter 类型,Import 仍会重建依赖此资产的 PanelSettings/UIDocument 引用,触发 IMGUI 检查器刷新与场景视图重绘。

DO NOT (common hallucinations):

  • uitoolkit_create_button / uitoolkit_create_label do not exist -> use uitk_add_element
  • uitoolkit_set_style does not exist -> use uitk_add_uss_rule, uitk_remove_uss_rule, or uitk_modify_element
  • uitoolkit_create_canvas does not exist -> UI Toolkit uses UIDocument, not Canvas
  • uitk_* and ui_* are different systems. Do not mix UI Toolkit structure/styling assumptions into UGUI workflows
  • USS is not full CSS. display:grid, box-shadow, calc(), @media, ::before, z-index, and gradients are unsupported

Routing:

  • For UGUI Canvas/Button/Text/Image -> use the ui module
  • For XR world-space Canvas conversion -> use xr_setup_ui_canvas
  • For generated starter layouts -> use uitk_create_from_template
  • For attaching an existing UXML to a scene object -> use uitk_create_document or uitk_set_document

Skills

File Skills

Skill Use Key parameters
uitk_create_uss Create USS file savePath, content?
uitk_create_uxml Create UXML file savePath, content?, ussPath?
uitk_read_file Read USS/UXML content filePath
uitk_write_file Overwrite file content filePath, content
uitk_delete_file Delete USS/UXML file filePath
uitk_find_files Search files by name/path type?, folder?, filter?, limit?
uitk_create_batch Create 2+ files in one call items

Scene Skills

Skill Use Key parameters
uitk_create_document Create UIDocument GameObject name, uxmlPath?, panelSettingsPath?, sortOrder?, parentName?/parentInstanceId?/parentPath?
uitk_set_document Change UIDocument asset bindings name/instanceId, uxmlPath?, panelSettingsPath?
uitk_create_panel_settings Create PanelSettings asset savePath, scaleMode, referenceResolutionX/Y, Unity 6 world-space options
uitk_get_panel_settings Read PanelSettings values assetPath
uitk_set_panel_settings Update PanelSettings selectively assetPath, changed fields only
uitk_list_documents List scene UIDocuments none
uitk_inspect_document Inspect live VisualElement tree name/instanceId/path, depth

UXML Structure Skills

Skill Use Key parameters
uitk_add_element Add a child element filePath, elementType, parentName?, elementName?, text?, classes?
uitk_remove_element Remove by name filePath, elementName
uitk_modify_element Change attributes/classes/text filePath, elementName, text?, classes?, style?, newName?, bindingPath?, custom attribute fields
uitk_clone_element Duplicate an element subtree filePath, elementName, newName?
uitk_inspect_uxml Parse UXML hierarchy filePath, depth?

USS Style Skills

Skill Use Key parameters
uitk_add_uss_rule Add or replace selector rule filePath, selector, properties
uitk_remove_uss_rule Remove selector rule filePath, selector
uitk_list_uss_variables Inspect design tokens / var() usage filePath

Template and CodeGen Skills

Skill Use Key parameters
uitk_create_from_template Generate paired UXML+USS template, savePath, name?
uitk_create_editor_window Generate EditorWindow script savePath, className, uxmlPath?, ussPath?, menuPath?
uitk_create_runtime_ui Generate runtime MonoBehaviour query scaffold savePath, className, elementQueries?

Supported starter templates include menu, hud, dialog, settings, inventory, list, tab-view, toolbar, card, and notification.

Core Domain Knowledge

USS vs CSS

Pattern Supported in USS What to do
Flex layout Yes Use flex-direction, flex-wrap, align-items, justify-content
border-radius, opacity, overflow:hidden Yes Safe to use
Transforms / transitions Yes translate, scale, rotate work
CSS variables Yes Prefer :root tokens
display:grid / display:block / display:inline No Everything is flex; emulate grids with wrapping rows
box-shadow No Fake with nested background element
linear-gradient() / radial-gradient() No Use image textures
calc() / @media No Use explicit values + PanelSettings.scaleMode
::before / ::after No Add a real child VisualElement
z-index No Later siblings render on top

Common USS workarounds

Need USS-safe workaround
Shadow Extra child VisualElement behind content
Responsive scaling PanelSettings.scaleMode = ScaleWithScreenSize
Grid cards flex-direction: row + flex-wrap: wrap + child widths
Circular avatar Equal width/height + radius = half size + overflow:hidden
Pseudo decoration Add an extra absolutely positioned child

High-Frequency Parameters

Skill Parameters you usually need first
uitk_create_panel_settings savePath, scaleMode, referenceResolutionX, referenceResolutionY
uitk_create_document name, uxmlPath, panelSettingsPath, sortOrder?
uitk_add_element filePath, elementType, parentName?, elementName?, text?, classes?
uitk_modify_element filePath, elementName, changed attributes only
uitk_add_uss_rule filePath, selector, properties

PanelSettings choices

  • ScaleWithScreenSize: default for runtime HUD/menu UI
  • ConstantPixelSize: use when strict pixel mapping matters
  • ConstantPhysicalSize: rare; only for physically sized UI requirements

Unity 6 world-space flows also need the scene-side document camera setup after configuring PanelSettings.

File and Structure Rules

  • Prefer one UXML root that references shared token/style files through <Style src="..."/>.
  • Keep USS next to UXML when possible so relative style references stay short.
  • Use uitk_inspect_uxml before complex structural edits if you did not create the file yourself.
  • uitk_create_uxml can auto-reference a stylesheet when ussPath is provided.

Workflow Notes

  1. Create USS/UXML first, then attach them through uitk_create_document.
  2. Runtime rendering needs a valid PanelSettings asset.
  3. When USS and UXML are in the same folder, prefer <Style src="MyStyle.uss" />; use a full asset path only for cross-folder references.
  4. Start with design tokens, then component rules, then layout containers.
  5. For incremental edits, prefer uitk_read_file -> edit -> uitk_write_file.
  6. When creating 2+ files, use uitk_create_batch.
  7. Unity 6 world-space rendering uses PanelSettings world-space options plus the scene-side UIDocument camera setup.
  8. Use uitk_create_from_template when the user needs a starter screen fast; use uitk_add_element / uitk_add_uss_rule for targeted edits on existing files.

Minimal Example

import unity_skills

unity_skills.call_skill("uitk_create_panel_settings",
    savePath="Assets/UI/GamePanel.asset",
    scaleMode="ScaleWithScreenSize",
    referenceResolutionX=1920,
    referenceResolutionY=1080
)

unity_skills.call_skill("uitk_create_uss",
    savePath="Assets/UI/HUD.uss",
    content=":root { --accent: #E8632B; } .title { color: var(--accent); }"
)

unity_skills.call_skill("uitk_create_uxml",
    savePath="Assets/UI/HUD.uxml",
    content="<?xml version=\"1.0\" encoding=\"utf-8\"?><engine:UXML xmlns:engine=\"UnityEngine.UIElements\"><Style src=\"HUD.uss\" /><engine:Label class=\"title\" text=\"Start\" /></engine:UXML>"
)

unity_skills.call_skill("uitk_create_document",
    name="HUD",
    uxmlPath="Assets/UI/HUD.uxml",
    panelSettingsPath="Assets/UI/GamePanel.asset"
)

Exact Signatures

Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file. Load USS_REFERENCE.md before generating non-trivial USS systems, layout patterns, component styles, or complete examples.

管理Unity URP资产、渲染器及特性。支持查询配置、修改渲染设置、增删启停渲染特性,适配URP 14/17版本差异与安全规范。
配置 URP 资产 添加或编辑渲染器特性 调整 URP 渲染设置 URP配置 渲染特性
SkillsForUnity/unity-skills~/skills/urp/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-urp -g -y
SKILL.md
Frontmatter
{
    "name": "unity-urp",
    "description": "Manage the Universal Render Pipeline (URP) — URP assets, the renderer, and renderer features. Use when configuring the URP asset, adding or editing renderer features, or adjusting URP rendering settings, even if the user just says \"URP配置\" or \"渲染特性\". 管理通用渲染管线(URP:URP 资产、渲染器、渲染器特性);当用户要配置 URP 资产、添加或编辑渲染器特性、或调整 URP 渲染设置时使用。"
}

URP Skills

URP-specific asset and renderer feature management for Unity 2022.3+ (URP 14 and Unity 6 / URP 17).

Operating Mode

  • Query skills (urp_get_info, urp_list_renderers, urp_list_renderer_features) are SkillMode.SemiAuto — they run in all three modes without grant.
  • Mutating skills (urp_set_asset_settings, urp_add_renderer_feature, urp_set_renderer_feature_active) are SkillMode.FullAuto — under Approval they need user grant (grant triggers one server-side execute returning the result); under Auto / Bypass they execute directly.
  • urp_remove_renderer_feature carries SkillOperation.Delete and is auto-forbidden in Approval / Auto modes (NeverInSemi). Only Bypass or the user-managed Allowlist can run it.

URP Package Stub

This module is compiled against com.unity.render-pipelines.universal (URP). When URP is not installed, every skill returns a stub { error: "Universal Render Pipeline package … is not installed." } (RenderPipelineSkillsCommon.NoURP()). The stub is a diagnostic payload, not a permission denial — it does not require grant and is not treated as NeverInSemi. Call project_get_render_pipeline first when you see this error.

Guardrails

DO NOT:

  • Use this module for ShaderGraph
  • Assume arbitrary custom renderer features are safe to instantiate
  • Assume Unity 2022 and Unity 6 expose the same built-in renderer features

Runtime-first rules:

  • Always call urp_get_info before urp_add_renderer_feature
  • Only use names returned by urp_get_info.creatableRendererFeatures
  • Do not hardcode RenderObjects, FullScreenPassRendererFeature, ScreenSpaceReflectionRendererFeature, etc. as universally available
  • Use urp_list_renderer_features to resolve existing feature names/indexes before calling urp_set_renderer_feature_active or urp_remove_renderer_feature

Validated behavior:

  • Unity 2022.3 + URP 14 real environment may expose a smaller creatable set, e.g. DecalRendererFeature and ScreenSpaceAmbientOcclusion
  • Unity 6 + URP 17 real environment may expose a larger set

Skills

urp_get_info

Inspect the active URP asset and renderer layout.

urp_set_asset_settings

Modify key URP asset settings like HDR, MSAA, render scale, shadows, and camera textures.

urp_list_renderers

List renderer data assets on the active URP asset.

urp_list_renderer_features

List renderer features on a specific renderer.

urp_add_renderer_feature

Add a safe built-in renderer feature to a renderer.

urp_remove_renderer_feature

Remove a renderer feature from a renderer.

urp_set_renderer_feature_active

Enable or disable a renderer feature.


Exact Signatures

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

用于校验Unity项目与场景健康度,查找断裂引用、丢失脚本及完整性问题。支持多种专项检查如纹理大小、Shader错误等,并提供清理空文件夹和修复丢失脚本的功能,确保构建前项目整洁。
用户要求检查断裂或丢失的引用 用户需要校验场景或项目的完整性 用户在构建前请求清理潜在问题 用户直接询问是否有丢失的资源或引用
SkillsForUnity/unity-skills~/skills/validation/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-validation -g -y
SKILL.md
Frontmatter
{
    "name": "unity-validation",
    "description": "Validate project and scene health plus cleanup — find broken references, missing scripts, and other integrity issues. Use when checking for broken or missing references, validating scene\/project integrity, or cleaning up issues before a build, even if the user just says \"检查引用\" or \"有没有丢失\". 校验项目与场景健康度并清理(查找断裂引用、丢失脚本及其他完整性问题);当用户要检查断裂或丢失引用、校验场景\/项目完整性、或在构建前清理问题时使用。"
}

Unity Validation Skills

Maintain project health - find problems, clean up, and validate your Unity project.

Operating Mode

  • Approval: 只读分析 skill(validate_scene / validate_find_missing_scripts / validate_find_unused_assets / validate_texture_sizes / validate_project_structure / validate_missing_references / validate_mesh_collider_convex / validate_shader_errors,标 SkillMode.SemiAuto)直接执行;含 Delete 的 skill(validate_cleanup_empty_foldersAnalyze | Deletevalidate_fix_missing_scriptsExecute | Delete,默认 SkillMode.FullAuto)需用户 grant。
  • Auto / Bypass: 直接执行。
  • 本模块含 Delete 类高危 skillvalidate_cleanup_empty_folders / validate_fix_missing_scripts 一旦 dryRun=false 即真删;它们在 Approval / Auto 下被 IsForbiddenInSemi 自动拦截,仅 Bypass 或 Allowlist 命中可执行强烈建议先用 dryRun=true 预览

DO NOT (common hallucinations):

  • Validation skill routes use the validate_* prefix, not validation_*
  • validation_run / validation_check do not exist → use specific skills such as validate_scene, validate_project_structure, validate_missing_references
  • validation_fix does not exist → validation skills report issues; use other modules to fix them
  • validation_clean does not exist → use cleaner module for cleanup operations

Routing:

  • For unused/duplicate asset cleanup → use cleaner module
  • For missing script fix → cleaner_fix_missing_scripts (cleaner module)
  • For compile errors → debug_check_compilation (debug module)

Skills Overview

Skill Description
validate_scene Comprehensive scene validation
validate_find_missing_scripts Find objects with missing scripts
validate_fix_missing_scripts Remove missing script components
validate_cleanup_empty_folders Remove empty folders
validate_find_unused_assets Find potentially unused assets
validate_texture_sizes Check texture sizes
validate_project_structure Get project overview
validate_missing_references Find null/missing object references on components
validate_mesh_collider_convex Find non-convex MeshColliders
validate_shader_errors Find shaders with compilation errors

Skills

validate_scene

Comprehensive scene validation.

Parameter Type Required Default Description
checkMissingScripts bool No true Check for missing scripts
checkMissingPrefabs bool No true Check for missing prefabs
checkDuplicateNames bool No true Check duplicate names
checkEmptyGameObjects bool No false Check empty GameObjects (no components)

Returns: {scene, totalIssues, summary: {errors, warnings, info}, issues: [{type, severity, gameObject, path, message, count}]}

validate_find_missing_scripts

Find objects with missing script references.

Parameter Type Required Default Description
searchInPrefabs bool No true Also check prefab assets

Returns: {totalFound, objects: [{source, gameObject, path, missingCount, prefabPath?}]} (prefabPath only present when source="Prefab")

validate_fix_missing_scripts

Remove missing script components.

Parameter Type Required Default Description
dryRun bool No true Preview only, don't remove

Returns: {success, dryRun, fixedCount, message, objects: [{gameObject, path, missingCount}]}

validate_cleanup_empty_folders

Remove empty folders from project.

Parameter Type Required Default Description
rootPath string No "Assets" Starting folder
dryRun bool No true Preview only, don't delete

Returns: { success, dryRun, emptyFolderCount, folders, message }

validate_find_unused_assets

Find potentially unused assets.

Parameter Type Required Default Description
assetType string No "Material" Filter: Texture/Material/Prefab/etc
limit int No 100 Max results

Returns: { success, assetType, potentiallyUnusedCount, assets }

validate_texture_sizes

Check for oversized textures.

Parameter Type Required Default Description
maxRecommendedSize int No 2048 Warn if larger
limit int No 50 Max results

Returns: {maxRecommendedSize, largeTextureCount, textures: [{path, name, width, height, maxTextureSize, format, recommendation}]}

validate_project_structure

Get project folder structure overview.

Parameter Type Required Default Description
rootPath string No "Assets" Starting folder
maxDepth int No 2 Max folder depth

Returns: { success, rootPath, assetCounts, structure }

validate_missing_references

Find null/missing object references on components in the scene.

Parameter Type Required Default Description
limit int No 50 Max results

Returns: { success, count, issues: [{ gameObject, path, component, property }] }

validate_mesh_collider_convex

Find non-convex MeshColliders (potential performance issue).

Parameter Type Required Default Description
limit int No 50 Max results

Returns: { success, count, nonConvexColliders: [{ gameObject, path, vertexCount }] }

validate_shader_errors

Find shaders with compilation errors.

Parameter Type Required Default Description
limit int No 50 Max results

Returns: { success, count, shaders: [{ name, path, errorCount }] }


Common Workflows

Pre-Build Check

import unity_skills

# Validate scene
scene_result = unity_skills.call_skill("validate_scene")
if scene_result['totalIssues'] > 0:
    print(f"Warning: {scene_result['totalIssues']} issues found")

# Check texture sizes
texture_result = unity_skills.call_skill("validate_texture_sizes", maxRecommendedSize=2048)
if texture_result['largeTextureCount'] > 0:
    print(f"Warning: {texture_result['largeTextureCount']} oversized textures")

Project Cleanup

import unity_skills

# 1. Preview missing scripts fix
preview = unity_skills.call_skill("validate_fix_missing_scripts", dryRun=True)
print(f"Would fix {preview['fixedCount']} objects")

# 2. Actually fix (if preview looks good)
unity_skills.call_skill("validate_fix_missing_scripts", dryRun=False)

# 3. Preview empty folder cleanup
preview = unity_skills.call_skill("validate_cleanup_empty_folders", dryRun=True)
print(f"Would delete {len(preview['folders'])} folders")

# 4. Actually cleanup
unity_skills.call_skill("validate_cleanup_empty_folders", dryRun=False)

# 5. Review unused assets (manual review recommended)
unused = unity_skills.call_skill("validate_find_unused_assets")
for asset in unused['assets']:
    print(f"Potentially unused: {asset}")

Best Practices

  1. Always use dryRun=True first to preview changes
  2. Run validation before major builds
  3. Review unused assets manually before deletion
  4. Keep texture sizes appropriate for target platform
  5. Fix missing scripts before they cause runtime errors
  6. Regular cleanup prevents project bloat

Exact Signatures

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

用于Unity SRP Volume框架,支持创建/加载VolumeProfile资产及全局/局部Volume GameObject。提供组件管理、参数设置及类型查询功能,适配URP/HDRP,需先检查渲染管线安装状态。
搭建 Volume 创建或加载 VolumeProfile 向场景添加全局/局部 Volume 用户提及 Volume 或 体积
SkillsForUnity/unity-skills~/skills/volume/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-volume -g -y
SKILL.md
Frontmatter
{
    "name": "unity-volume",
    "description": "Work with the SRP Volume framework — create\/load VolumeProfile assets and create global\/local Volume GameObjects with components. Use when setting up volumes, creating or loading a VolumeProfile, or adding global\/local volumes to a scene, even if the user just says \"Volume\" or \"体积\". 使用 SRP Volume 框架(创建\/加载 VolumeProfile 资产、创建全局\/局部 Volume GameObject 及组件);当用户要搭建 Volume、创建或加载 VolumeProfile、或向场景添加全局\/局部 Volume 时使用。"
}

Volume Skills

Shared SRP Volume framework skills for Unity 2022.3+ — works in URP and HDRP via SRP Core.

Operating Mode

  • Query skills (volume_list_component_types, volume_get_component) are SkillMode.SemiAuto — they run in all three modes without grant.
  • Mutating skills (volume_profile_create, volume_create, volume_set_profile, volume_add_component, volume_set_parameter, volume_set_parameter_batch) are SkillMode.FullAuto — under Approval they need user grant (grant triggers one server-side execute returning the result); under Auto / Bypass they execute directly.
  • volume_remove_component carries SkillOperation.Delete and is auto-forbidden in Approval / Auto modes (NeverInSemi). Only Bypass or the user-managed Allowlist can run it.

SRP Package Stub

This module is compiled against com.unity.render-pipelines.core (SRP_CORE). When neither URP nor HDRP is installed (no SRP Core), every skill returns a stub { error: "Scriptable Render Pipeline Core package … is not installed." } (RenderPipelineSkillsCommon.NoSRP()). The stub is a diagnostic payload, not a permission denial — it does not require grant and is not treated as NeverInSemi. Inspect project_get_render_pipeline first when you see this error.

Guardrails

Routing:

  • For Volume container/profile CRUD: use this module
  • For high-level modern post-processing effects like Bloom/DOF/Tonemapping: prefer postprocess

Runtime-first rules:

  • Always call volume_list_component_types before assuming a component type exists on the active pipeline
  • Use volume_get_component after add/create to inspect the actual parameter names before writing values
  • Prefer exact parameter names returned by the live component data instead of guessing from memory
  • volume_set_parameter_batch expects items to be a JSON array string

Skills

volume_profile_create

Create a VolumeProfile asset.

volume_create

Create a global or local Volume GameObject.

volume_set_profile

Assign or replace the profile on an existing Volume.

volume_list_component_types

List explicit supported VolumeComponent types for the active SRP pipeline.

volume_add_component

Add a VolumeComponent override to a VolumeProfile.

volume_remove_component

Remove a VolumeComponent override from a VolumeProfile.

volume_get_component

Inspect a VolumeComponent override and its parameters.

volume_set_parameter

Set one override parameter on a VolumeComponent.

volume_set_parameter_batch

Set multiple override parameters on one VolumeComponent.


Exact Signatures

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

提供Unity AI操作的持久化历史管理与回滚功能,支持快照、书签、任务/会话级撤销及批量操作规划。适用于高危改动前备份、多步或会话级撤销、以及批量重试和回滚场景。
用户要求撤销整个任务或会话 用户要求进行回滚操作 用户希望在修改前创建快照 用户需要规划或预览批量操作
SkillsForUnity/unity-skills~/skills/workflow/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-workflow -g -y
SKILL.md
Frontmatter
{
    "name": "unity-workflow",
    "description": "Persistent operation history and orchestration — snapshots, task\/session undo, bookmarks, and batch planning\/retry\/rollback. Use when undoing a whole task or session, snapshotting before risky changes, planning or previewing batch operations, or rolling back, even if the user just says \"撤销整个操作\" or \"回滚\". 持久化操作历史与编排(快照、任务\/会话级撤销、书签、批量规划\/重试\/回滚);当用户要撤销整个任务或会话、在高危改动前快照、规划或预览批量操作、或回滚时使用。"
}

Workflow Skills

Persistent history and rollback system for AI operations ("Time Machine"). Allows tagging tasks, snapshotting objects before modification, and undoing specific tasks even after Editor restarts.

NEW: Session-level undo - Group all changes from a conversation and undo them together.

Operating Mode

  • Approval:本模块大部分 skill 标 SkillMode.SemiAuto(bookmark / history / task / session 系列 + workflow_plan,后者 ReadOnly=true 仅生成聚合计划),可直接执行。少数写类 skill (workflow_snapshot_object / workflow_snapshot_created / batch_retry_failed) 走默认 SkillMode.FullAuto,需 grant。
  • Auto / Bypass:FullAuto 直接执行。
  • 含 NeverInSemi 高危 skillbookmark_delete / workflow_delete_task(标 Operation.Delete,删除书签/任务记录)。这些在 Approval/Auto 下返 MODE_FORBIDDEN,仅 Bypass 或 Allowlist 命中可调。

注意:workflow_undo_task / workflow_session_undo 不是 Delete operation(标的是 Modify/Execute),它们能在 Approval/Auto 直接撤销已记录任务。

DO NOT (common hallucinations):

  • workflow_save does not exist → use workflow_task_end to end and save a task
  • workflow_rollback does not exist → use workflow_undo_task (by taskId) or workflow_session_undo (by sessionId)
  • workflow_create does not exist → use workflow_task_start
  • workflow_revert_task is deprecated → use workflow_undo_task

Routing:

  • For simple undo/redo (1 step) → editor_undo / editor_redo (editor module)
  • For multi-step undo → history_undo with steps parameter (this module)
  • For conversation-level undo → workflow_session_undo (this module)

Bookmark Skills

bookmark_set

Save current selection and scene view position as a bookmark.

Parameter Type Required Default Description
bookmarkName string Yes - Name for the bookmark
note string No null Optional note for the bookmark

Returns: { success, bookmark, selectedCount, hasSceneView, note }

bookmark_goto

Restore selection and scene view from a bookmark.

Parameter Type Required Default Description
bookmarkName string Yes - Name of the bookmark to restore

Returns: { success, bookmark, restoredSelection, note }

bookmark_list

List all saved bookmarks.

No parameters.

Returns: { success, count, bookmarks: [{ name, selectedCount, hasSceneView, note, createdAt }] }

bookmark_delete

Delete a bookmark.

Parameter Type Required Default Description
bookmarkName string Yes - Name of the bookmark to delete

Returns: { success, deleted }

History Skills

history_undo

Undo the last operation (or multiple steps).

Parameter Type Required Default Description
steps int No 1 Number of undo steps to perform

Returns: { success, undoneSteps }

history_redo

Redo the last undone operation (or multiple steps).

Parameter Type Required Default Description
steps int No 1 Number of redo steps to perform

Returns: { success, redoneSteps }

history_get_current

Get the name of the current undo group.

No parameters.

Returns: { success, currentGroup, groupIndex }

Planning And Batch Governance

workflow_plan

Generate a combined execution plan for multiple skills on the server side.

Parameter Type Required Default Description
skillsJson string Yes - JSON array of { "name": "...", "params": { ... } } entries

Returns: { totalSteps, totalRisk, steps, dependencies, warnings, mayDisconnect }

batch_query_assets

Query project assets with filters that are useful before batch cleanup or migration work.

Parameter Type Required Default Description
searchFilter string No - Extra AssetDatabase.FindAssets filter text
folder string No Assets Search root
typeFilter string No - Asset type filter such as t:Material or Prefab
namePattern string No - Regex applied to file name without extension
labelFilter string No - Asset label filter such as l:Addressable
maxResults int No 200 Max assets returned

Returns: { count, totalMatched, summary, assets }

batch_retry_failed

Retry only the failed items from an earlier batch execution report. This now reuses the original operation context stored in the report.

Parameter Type Required Default Description
reportId string Yes - Source report ID from batch_report_get / batch_report_list
runAsync bool No true Return a jobId immediately or wait for completion
chunkSize int No 100 Chunk size for retry execution

Returns: { status, jobId?, retryCount, originalReportId, reportId? }

Session Management (Conversation-Level Undo)

workflow_session_start

Start a new session (conversation-level). All changes will be tracked and can be undone together. Call this at the beginning of each conversation.

Parameter Type Required Default Description
tag string No null Label for the session

Returns: { success, sessionId, message }

workflow_session_end

End the current session and save all tracked changes. Call this at the end of each conversation.

No parameters.

Returns: { success, sessionId, message }

workflow_session_undo

Undo all changes made during a specific session (conversation-level undo).

Parameter Type Required Default Description
sessionId string No null The UUID of the session to undo. If not provided, undoes the most recent session

Returns: { success, sessionId, message }

workflow_session_list

List all recorded sessions (conversation-level history).

No parameters.

Returns: { success, count, currentSessionId, sessions: [{ sessionId, taskCount, totalChanges, startTime, endTime, tags }] }

workflow_session_status

Get the current session status.

No parameters.

Returns: { success, hasActiveSession, currentSessionId, isRecording, currentTaskId, currentTaskTag, currentTaskDescription, snapshotCount }

Task-Level Skills

workflow_task_start

Start a new persistent workflow task to track changes for undo. Call workflow_task_end when done.

Parameter Type Required Default Description
tag string Yes - Short label for the task (e.g., "Create NPC")
description string No "" Detailed description or prompt

Returns: { success, taskId, message }

workflow_task_end

End the current workflow task and save it. Requires an active task (call workflow_task_start first).

No parameters.

Returns: { success, taskId, snapshotCount, message }

workflow_snapshot_object

Manually snapshot an object's state before modification. Requires an active task (call workflow_task_start first). Call this BEFORE component_set_property, gameobject_set_transform, etc.

Parameter Type Required Default Description
name string No null Name of the Game Object
instanceId int No 0 Instance ID of the object (preferred)

Returns: { success, objectName, type }

workflow_snapshot_created

Record a newly created object for undo tracking. Requires an active task (call workflow_task_start first). Note: component_add and gameobject_create automatically record created objects, so you typically don't need to call this manually.

Parameter Type Required Default Description
name string No null Name of the Game Object
instanceId int No 0 Instance ID of the object (preferred)

Returns: { success, objectName, type }

workflow_list

List persistent workflow history.

No parameters.

Returns: { success, count, history: [{ id, tag, description, time, changes }] }

workflow_undo_task

Undo changes from a specific task (restore to previous state). The undone task is saved and can be redone later.

Parameter Type Required Default Description
taskId string Yes - The UUID of the task to undo

Returns: { success, taskId }

workflow_redo_task

Redo a previously undone task (restore changes).

Parameter Type Required Default Description
taskId string No null The UUID of the task to redo. If not provided, redoes the most recently undone task

Returns: { success, taskId }

workflow_undone_list

List all undone tasks that can be redone.

No parameters.

Returns: { success, count, undoneStack: [{ id, tag, description, time, changes }] }

workflow_revert_task

(deprecated) Alias for workflow_undo_task. Use workflow_undo_task instead.

Parameter Type Required Default Description
taskId string Yes - The UUID of the task to undo

Returns: { success, taskId }

workflow_delete_task

Delete a task from history (does not revert changes, just removes the record).

Parameter Type Required Default Description
taskId string Yes - The UUID of the task to delete

Returns: { success, deletedId }

Minimal Example

import unity_skills

# Session-level: wrap entire conversation for bulk undo
unity_skills.call_skill("workflow_session_start", tag="Build Player")
unity_skills.call_skill("gameobject_create", name="Player", primitiveType="Capsule")
unity_skills.call_skill("component_add", name="Player", componentType="Rigidbody")
unity_skills.call_skill("workflow_session_end")
# Later: undo entire session
sessions = unity_skills.call_skill("workflow_session_list")
unity_skills.call_skill("workflow_session_undo", sessionId=sessions["sessions"][0]["sessionId"])

Auto-Tracked Operations

The following operations are automatically tracked for undo when a session/task is active:

  • gameobject_create / gameobject_create_batch
  • gameobject_duplicate / gameobject_duplicate_batch
  • component_add / component_add_batch
  • ui_create_* (canvas, button, text, image, etc.)
  • light_create
  • prefab_instantiate / prefab_instantiate_batch
  • material_create / material_duplicate
  • terrain_create
  • cinemachine_create_vcam

For modification operations, the system auto-snapshots target objects before changes when possible.

Exact Signatures

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

用于在Unity中配置XR Interaction Toolkit,支持VR/AR交互、XR Rig搭建及抓取/射线等交互器设置。涵盖XRI 2.x/3.x版本,提供场景检查、Rig创建及组件配置功能,需严格匹配API属性名。
构建 VR/AR 交互逻辑 搭建 XR Origin/Rig 配置抓取、插槽或射线交互器 用户提及 'VR' 或 'XR交互'
SkillsForUnity/unity-skills~/skills/xr/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-xr -g -y
SKILL.md
Frontmatter
{
    "name": "unity-xr",
    "description": "Set up XR Interaction Toolkit (XRI) for VR\/AR — XR rigs and grab\/socket\/ray interactors. Use when building VR\/AR interaction, setting up an XR rig, or configuring grab\/socket\/ray interactors, even if the user just says \"VR\" or \"XR交互\". 搭建用于 VR\/AR 的 XR Interaction Toolkit(XRI:XR rig、抓取\/插槽\/射线交互器);当用户要构建 VR\/AR 交互、搭建 XR rig、或配置抓取\/插槽\/射线交互器时使用。"
}

Unity XR Interaction Toolkit Skills

Use this module for XR Interaction Toolkit setup and configuration. All xr_* skills are reflection-based and support XRI 2.x on Unity 2022 and XRI 3.x on Unity 6+.

Requires: com.unity.xr.interaction.toolkit. Hard rule: Read this file before the first xr_* call in a session. Wrong property names can fail silently because the bridge is reflection-based.

Guardrails

Operating Mode (v1.9 three-tier):

  • Approval (default): query/list/info skills (xr_check_setup, xr_get_scene_report, xr_list_interactors, xr_list_interactables) run directly. Create/modify skills are FullAuto — on MODE_RESTRICTED, run the grant protocol; a successful /permission/grant executes the skill server-side and returns the result in the same response.
  • Auto / Bypass: SemiAuto and FullAuto run directly.
  • This module contains no Delete / PlayMode / Reload / RiskLevel="high" skills, so nothing is auto-classified as forbidden — every skill is reachable via grant.
  • When com.unity.xr.interaction.toolkit is missing, every xr_* skill returns the NoXRI() install instruction instead of executing.
  • Reflection-sensitive: property names on XRI components must match XRI 2.x/3.x exactly. A wrong field name on xr_configure_interactable / xr_configure_haptics / xr_configure_interaction_layers is silently ignored. Load API_REFERENCE.md before issuing detailed property edits.

DO NOT (common hallucinations):

  • XRHand, XRPlayer, XRTeleporter, GrabInteractor, VRController, XRLocomotion, and XRManager are not the runtime classes you want here
  • interactable.OnGrab() / OnRelease() are not the XRI event model -> use selectEntered / selectExited
  • controller.vibrate() is not the documented route here -> configure haptics through xr_configure_haptics
  • Do not assume physics Layer or Tag replaces InteractionLayerMask
  • Do not guess component property names. Load API_REFERENCE.md before setting detailed XR component properties

Correct class names to anchor on:

  • XRInteractionManager
  • XROrigin
  • XRRayInteractor
  • XRDirectInteractor
  • XRSocketInteractor
  • XRGrabInteractable
  • XRSimpleInteractable
  • TeleportationProvider
  • TeleportationArea
  • TeleportationAnchor
  • ContinuousMoveProvider
  • SnapTurnProvider
  • ContinuousTurnProvider
  • TrackedDeviceGraphicRaycaster
  • XRUIInputModule
  • TrackedPoseDriver

Routing:

  • For non-XR Canvas UI creation -> use ui
  • For architecture or lifecycle decisions in XR gameplay code -> load advisory modules such as architecture, patterns, async, or scriptdesign
  • For exact component property names and full workflow examples -> load API_REFERENCE.md

Skills

Setup and Diagnostics

Skill Use Key parameters
xr_check_setup Validate XR package, rig, managers, and scene prerequisites verbose?
xr_setup_rig Create XR Origin + camera + controllers name, cameraYOffset?
xr_setup_interaction_manager Add or find manager none
xr_setup_event_system Replace/add XR UI input stack none
xr_get_scene_report Report scene-side XR status none

Interactors and Interactables

Skill Use Key parameters
xr_add_ray_interactor Remote pointing / ray interaction name, maxDistance?, lineType?
xr_add_direct_interactor Close-range hand grab name, radius?
xr_add_socket_interactor Snap-to slot name, showHoverMesh?, recycleDelay?
xr_add_grab_interactable Rigidbody + collider + grab config name, movementType?, throwOnDetach?
xr_add_simple_interactable Hover/select without grab name
xr_configure_interactable Fine-tune interactable behavior target + changed fields only
xr_list_interactors List all scene interactors none
xr_list_interactables List all scene interactables none

Locomotion and XR UI

Skill Use Key parameters
xr_setup_teleportation Add teleport provider to XR Origin none
xr_add_teleport_area Mark a surface as teleportable name, matchOrientation?
xr_add_teleport_anchor Create fixed teleport destination name, x/y/z, rotY?, matchOrientation?
xr_setup_continuous_move Add stick locomotion moveSpeed?, enableStrafe?, enableFly?
xr_setup_turn_provider Add snap or smooth turn turnType, turnAmount?, turnSpeed?
xr_setup_ui_canvas Convert Canvas for XR interaction name

Feedback and Filtering

Skill Use Key parameters
xr_configure_haptics Set hover/select vibration name, intensities, durations
xr_add_interaction_event Wire interaction callback to target method name, eventType, targetName, targetMethod
xr_configure_interaction_layers Set InteractionLayerMask name, layers, isInteractor

Quick Start

import unity_skills as u

u.call_skill("xr_check_setup")
u.call_skill("xr_setup_rig", name="XR Origin")
u.call_skill("xr_add_ray_interactor", name="Right Controller")
u.call_skill("xr_add_direct_interactor", name="Left Controller")
u.call_skill("xr_setup_teleportation")
u.call_skill("xr_setup_turn_provider", turnType="Snap", turnAmount=45)
u.call_skill("xr_add_grab_interactable", name="MyCube", movementType="VelocityTracking")

Workflow Summary

Rig Setup

  1. Run xr_check_setup.
  2. Create the rig with xr_setup_rig.
  3. Ensure XR UI input exists with xr_setup_event_system.
  4. Add at least one interactor per controller.

Grab Setup

  • Direct hand grab: xr_add_direct_interactor + xr_add_grab_interactable
  • Distance grab: xr_add_ray_interactor + xr_add_grab_interactable
  • Socket placement: xr_add_socket_interactor + grabbable object

movementType defaults matter:

  • VelocityTracking: best general-purpose physical grab
  • Kinematic: use for handles/tools that should not get stuck
  • Instantaneous: best for precise remote grab

Locomotion Setup

  • Teleport: xr_setup_teleportation + xr_add_ray_interactor + xr_add_teleport_area/xr_add_teleport_anchor
  • Continuous locomotion: xr_setup_continuous_move
  • Turn: xr_setup_turn_provider

Comfort default: snap turn + moderate move speed (~2.0 m/s).

XR UI

  1. Convert Canvas with xr_setup_ui_canvas
  2. Ensure xr_setup_event_system
  3. Add a ray interactor on the controller that should click UI

Collider Configuration Matrix

This is the most important XR anti-hallucination table in the repo.

Component Collider required isTrigger Recommended collider Reason
XRDirectInteractor Yes True SphereCollider (0.1-0.25) Overlap detection
XRRayInteractor No - None Uses raycasts
XRSocketInteractor Yes True SphereCollider (0.1-0.3) Snap zone
XRGrabInteractable Yes False BoxCollider or convex MeshCollider Physics + ray target
XRSimpleInteractable Yes False BoxCollider Selection detection
TeleportationArea Yes False MeshCollider or BoxCollider Surface raycast target
TeleportationAnchor Yes False Thin BoxCollider Point raycast target

Critical rules:

  1. XRGrabInteractable needs a Rigidbody.
  2. A grabbable collider must not be trigger.
  3. A direct interactor collider must be trigger.
  4. Dynamic mesh colliders must be convex.
  5. Socket colliders should be trigger-only overlap zones.

Version Compatibility

Topic XRI 2.x XRI 3.x
Main namespace style root namespace split sub-namespaces
Rig type XROrigin XROrigin
Locomotion core LocomotionSystem LocomotionMediator
Controller type ActionBasedController ActionBasedController
Bridge behavior Reflection helper falls back automatically Reflection helper prefers 3.x first

Important Notes

  1. Scenes should normally have exactly one XRInteractionManager.
  2. Most locomotion skills assume an XROrigin already exists.
  3. Package installation or reconfiguration can trigger Domain Reload. Wait before retrying XR calls.
  4. Use InteractionLayerMask for interactor/interactable filtering.
  5. For custom XR scripts, prefer XRI lifecycle hooks and events over Update() polling when possible.

Minimal Example

import unity_skills as u

u.call_skill("xr_setup_rig", name="XR Origin", cameraYOffset=1.36)
u.call_skill("xr_setup_event_system")
u.call_skill("xr_add_ray_interactor", name="Right Controller", maxDistance=30, lineType="StraightLine")
u.call_skill("xr_add_grab_interactable", name="Tool", movementType="VelocityTracking", throwOnDetach=True)
u.call_skill("xr_configure_haptics", name="Right Controller", selectIntensity=0.7, selectDuration=0.15)

Exact Signatures

Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file. Before configuring XR component properties in detail, load API_REFERENCE.md. XR property names are reflection-sensitive.

为YooAsset v2.3.18提供源码级设计规则,涵盖初始化、资源加载、热更流程及句柄释放等关键陷阱。用于编写或审查相关代码时确保正确性。
编写或审查 YooAsset 代码 初始化 ResourcePackage 使用 AssetHandle 加载资源 配置热更新/下载流程 选择运行模式 (Play Mode) 用户提及'热更'或'资源包'
SkillsForUnity/unity-skills~/skills/yooasset-design/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-yooasset-design -g -y
SKILL.md
Frontmatter
{
    "name": "unity-yooasset-design",
    "description": "Source-anchored design rules for YooAsset v2.3.18 — initialization, default-package shortcuts, play modes, asset handles, loading, updates, filesystem, build, and pitfalls. Use when writing or reviewing YooAsset code, initializing packages, loading assets via handles, setting up hot-update\/download, or choosing a play mode, even if the user just says \"热更\" or \"资源包\". 为 YooAsset v2.3.18 提供源码锚定的设计规则(初始化、默认包快捷方式、运行模式、资源句柄、加载、更新、文件系统、构建、陷阱);当用户要编写或审查 YooAsset 代码、初始化 package、用句柄加载资源、配置热更\/下载、或选择运行模式时使用。"
}

YooAsset - Design Rules

Advisory module. Every rule is distilled from YooAsset v2.3.18 (2025-12-04) source at Assets/YooAsset/. Each rule cites a concrete file/line so the reasoning is auditable and the AI does not improvise against stale memory.

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

When to Load This Module

Load before writing or reviewing any of:

  • YooAssets.Initialize() / CreatePackage() / Destroy() bootstrap code
  • default package shortcuts: YooAssets.SetDefaultPackage(...), YooAssets.LoadAssetAsync(...), YooAssets.CreateResourceDownloader(...)
  • ResourcePackage.InitializeAsync(...) with any of the 5 EPlayMode variants
  • LoadAssetSync/Async, LoadSubAssetsAsync, LoadAllAssetsAsync, LoadRawFileAsync, LoadSceneAsync and their matching Handle usage / release
  • Patch flow: RequestPackageVersionAsync → UpdatePackageManifestAsync → CreateResourceDownloader → BeginDownload
  • FileSystemParameters construction (Buildin / Cache / Editor / WebServer / WebRemote / custom)
  • IDecryptionServices / IRemoteServices / IWebDecryptionServices implementations
  • Editor-side AssetBundleBuilder.Run(...) and AssetBundleCollector configuration
  • Any code branching on EOperationStatus / EFileClearMode / PackageDetails

Critical Rule Summary (memorize even if you skip the sub-docs)

# Rule Source anchor
1 Call YooAssets.Initialize() before any CreatePackage() and keep it as a process-level singleton. A second call only logs a warning and returns, but normal architecture should gate it with YooAssets.Initialized. The call creates a [{nameof(YooAssets)}] driver GameObject via DontDestroyOnLoad to pump OperationSystem.Update(). Do not Destroy this driver yourself. Runtime/YooAssets.cs:38-64
2 ResourcePackage.InitializeAsync(...) has no separate EPlayMode argument: it infers play mode from the concrete InitializeParameters subclass. The five built-in subclasses map 1:1 to the five modes; an unknown subclass throws NotImplementedException, while a recognized but semantically wrong subclass wires the wrong file-system topology and fails later. Runtime/ResourcePackage/ResourcePackage.cs:107-135, 170-181, Runtime/InitializeParameters.cs:8-110
3 EditorSimulateMode works only when UNITY_EDITOR is defined; WebPlayMode works only when UNITY_WEBGL is defined (and every other mode is rejected on WebGL). Runtime/ResourcePackage/ResourcePackage.cs:160-197
4 Every AssetHandle / SubAssetsHandle / AllAssetsHandle / RawFileHandle / SceneHandle must be released via Release() or Dispose(). Without release, bundles never unload even with AutoUnloadBundleWhenUnused = true. Runtime/ResourceManager/Handle/HandleBase.cs:21-40, Runtime/InitializeParameters.cs:48-49
5 LoadAssetSync/Async performs a DEBUG-only type guard that rejects any Type derived from UnityEngine.Behaviour and any type not derived from UnityEngine.Object. Treat the restriction as architectural even though the guard is compiled out of non-DEBUG builds. Runtime/ResourcePackage/ResourcePackage.cs:1172-1187
6 YooAsset 2.3.18 includes default-package static shortcuts on YooAssets (SetDefaultPackage, Load*, CreateResourceDownloader, etc.). They are valid API, but architecture should prefer explicit ResourcePackage references in multi-package or library code. Runtime/YooAssetsExtension.cs:16, 217-295, 479-506
7 RequestPackageVersionAsync() returns RequestPackageVersionOperation (exposes .PackageVersion). There is no UpdatePackageVersionOperation class in 2.3.18 — if you think you remember one, you are confusing it with the older name. Runtime/ResourcePackage/ResourcePackage.cs:225-231
8 Before UpdatePackageManifestAsync, call UnloadAllAssetsAsync(); YooAsset logs a warning when loaders are still alive. Runtime/ResourcePackage/ResourcePackage.cs:242-247
9 Downloader callbacks (DownloadFinishCallback / DownloadUpdateCallback / DownloadErrorCallback / DownloadFileBeginCallback) must be assigned before BeginDownload(). They are delegate fields, not events — only one subscriber per slot. Runtime/DownloadSystem + Runtime/ResourcePackage/Operation/DownloaderOperation.cs:86-101, 330-336
10 ResourcePackage.DestroyAsync() must run before YooAssets.RemovePackage(). RemovePackage refuses when InitializeStatus != EOperationStatus.None. Runtime/YooAssets.cs:177-190, Runtime/ResourcePackage/ResourcePackage.cs:210-218
11 The patch flow is strictly ordered: InitializeAsync → RequestPackageVersionAsync → UpdatePackageManifestAsync(version) → CreateResourceDownloader → BeginDownload. Jumping ahead (e.g. loading assets between version and manifest) is unsupported. Runtime/ResourcePackage/ResourcePackage.cs:225, 238, 972, Samples~/Space Shooter/.../PatchLogic/FsmNode/Fsm*.cs

Sub-doc Routing

Sub-doc When to read
INIT.md Initialize / Destroy / CreatePackage / TryGetPackage / RemovePackage; single driver GameObject; OperationSystem loop
PLAYMODE.md All 5 EPlayMode values, their matching InitializeParameters subclass, platform #if guards, and the runtime dispatch table
HANDLES.md HandleBase API (Release / IsDone / Progress / Status / LastError / Completed / Task / IEnumerator), AssetHandle.Instantiate*, reference counting, AutoUnloadBundleWhenUnused
LOADING.md LoadAsset, LoadSubAssets, LoadAllAssets, LoadRawFile, LoadScene — all overloads + Behaviour/Type rejection + LoadSceneParameters
UPDATE.md Patch flow, RequestPackageVersionOperation, UpdatePackageManifestOperation, PreDownloadContentOperation, ResourceDownloaderOperation (4 callbacks, pause/resume/cancel, Combine)
FILESYSTEM.md FileSystemParameters + 24 FileSystemParametersDefine constants + 5 factory helpers + IDecryptionServices / IRemoteServices / IWebDecryptionServices
BUILD.md AssetBundleBuilder.Run(...), BuildParameters (Scriptable / Raw / Simulate), AssetBundleCollector, IFilterRule.FindAssetType, ScriptableBuildParameters.ReplaceAssetPathWithAddress
PITFALLS.md 30 concrete hallucination pitfalls + legacy API migration section

Routing to Other Modules

  • Asmdef & assembly layout for YooAsset consumers → load asmdef
  • Async orchestration across multiple YooAsset operations → load async
  • Architecture-level decisions (Addressables vs YooAsset, single-package vs multi-package) → load architecture
  • Performance review of load/release hot paths → load performance

Version Scope

This document targets YooAsset 2.3.18 (2025-12-04). Key recent history:

  • 2.3.18 — added UNPACK_FILE_SYSTEM_ROOT file-system parameter, EFileClearMode.ClearBundleFilesByLocations, RawFileBuildParameters.IncludePathInHash.
  • 2.3.17[CRITICAL] fixed a CRC-validation bug that let corrupted downloads pass verification on 2.3.15/2.3.16. Also fixed a Package-destroy race where an in-flight AssetBundle load could block unload.
  • 2.3.16 — removed the downloader timeout parameter (use DOWNLOAD_WATCH_DOG_TIME on the cache file system instead). IFilterRule gained a required FindAssetType property.
  • 2.3.15 — bumped the manifest binary format; installers built with 2.3.15+ are not readable by 2.3.14 or earlier clients and vice versa. Added FILE_VERIFY_MAX_CONCURRENCY, StripUnityVersion, preview UseWeakReferenceHandle (under YOOASSET_EXPERIMENTAL).

Source: Assets/YooAsset/CHANGELOG.md:5-275.

Migration Notes (hallucination shield)

Legacy API (pre-2.3.18) Status in 2.3.18 Replacement Source
CreateResourceDownloader(count, retry, timeout) overload / ResourceDownloaderOperation.timeout property Removed in 2.3.16 Assign DOWNLOAD_WATCH_DOG_TIME on the CacheFileSystemParameters / BuildinFileSystemParameters CHANGELOG.md:173-177, FileSystemParametersDefine.cs:18
IFilterRule without a FindAssetType property Breaking change in 2.3.16 — compilation breaks Implement public string FindAssetType { get; } that returns a Unity asset-type filter string CHANGELOG.md:179-192
Old manifest binary (pre-2.3.15 client reading a 2.3.15+ manifest, or vice versa) Wire-incompatible Rebuild + re-ship installer; no runtime bridge exists CHANGELOG.md:196-198
YooAssets.LoadAsset(...) Does not exist — method names include LoadAssetSync / LoadAssetAsync, not bare LoadAsset package.LoadAssetAsync<T>(location) or YooAssets.LoadAssetAsync<T>(location) after SetDefaultPackage Runtime/YooAssetsExtension.cs:217-295, Runtime/ResourcePackage/ResourcePackage.cs:641-732
YooAssets.LoadAssetAsync(...) marked as hallucination Outdated rule — 2.3.18 has this default-package shortcut Prefer package.LoadAssetAsync<T>(location) for explicit ownership; static shortcut is acceptable only after YooAssets.SetDefaultPackage(package) Runtime/YooAssetsExtension.cs:16, 260-295
package.UnloadUnusedAssets() (synchronous) Does not exist package.UnloadUnusedAssetsAsync(int loopCount = 10) returns an UnloadUnusedAssetsOperation Runtime/ResourcePackage/ResourcePackage.cs:355-361
UpdatePackageVersionOperation class (often confused with the real type) Does not exist RequestPackageVersionOperation, with a .PackageVersion string property Runtime/ResourcePackage/ResourcePackage.cs:225-231
NetworkVariable<T> / OnValueChanged style sync for assets (leaked in from Netcode) Does not exist in YooAsset Subscribe AssetHandle.Completed event or await handle.Task / yield return handle Runtime/ResourceManager/Handle/AssetHandle.cs:20-37, Runtime/ResourceManager/Handle/HandleBase.cs:152-173
ResourceDownloaderOperation.OnDownloadFinishCallback (event-style) Field is a plain delegate, not an event Assign once: downloader.DownloadFinishCallback = OnFinish; — do not += (single-slot field) Runtime/ResourcePackage/Operation/DownloaderOperation.cs:86-101

When in doubt, read the cited source — not your memory.

自动化 Unity YooAsset 热更新流程,涵盖构建资源包、编辑器模拟、Collector 分组管理及 BuildReport 分析。适用于用户提及热更或打 AB 包时,提供从配置到校验的一站式 Editor 侧辅助。
构建或模拟 YooAsset 资源包 配置 Collector 分组 校验热更资源 用户提及热更 用户提及打AB包
SkillsForUnity/unity-skills~/skills/yooasset/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-yooasset -g -y
SKILL.md
Frontmatter
{
    "name": "unity-yooasset",
    "description": "Automate YooAsset hot-update and asset bundles — build bundles, run Editor simulate builds, manage Collector groups, analyze BuildReport, and validate runtime. Use when building or simulating YooAsset bundles, configuring collectors, or validating hot-update assets, even if the user just says \"热更\" or \"打AB包\". 自动化 YooAsset 热更新与资源包(构建 bundle、编辑器模拟构建、管理 Collector 分组、分析 BuildReport、运行时校验);当用户要构建或模拟 YooAsset 资源包、配置 collector、或校验热更资源时使用。"
}

Unity YooAsset Skills

Editor-side automation for the YooAsset hot-update framework — build pipeline orchestration, Collector configuration CRUD, BuildReport analysis, PlayMode runtime validation, and companion YooAsset tools. Every skill wraps a concrete YooAsset Editor/runtime API path validated against 2.3.18 source. When the package is absent, every skill except yooasset_check_installed returns a NoYooAsset() error with install instructions.

Requires: com.tuyoogame.yooasset ≥ 2.3.15, Unity 2022.3+ (validated against 2.3.18). Strongly recommended: before writing ANY YooAsset runtime code, load yooasset-design. PlayMode / parameter-class / handle-lifecycle pitfalls are strict, and only the advisory module surfaces them.

Guardrails

Operating Mode (v1.9 three-tier):

  • Approval (default): query/list/read skills (yooasset_check_installed, yooasset_get_default_paths, yooasset_get_build_settings, yooasset_list_collector_packages, yooasset_list_collector_rules, yooasset_list_assetart_scanners, yooasset_runtime_get_validation_result, yooasset_load_build_report, yooasset_list_report_bundles, yooasset_get_bundle_detail, yooasset_list_report_assets, yooasset_get_asset_detail, yooasset_get_dependency_graph, yooasset_compare_build_reports, yooasset_list_independ_assets) run directly. Builders / Collector mutators / scanner runs / window-openers are FullAuto — on MODE_RESTRICTED, run the grant protocol.

  • Auto / Bypass: SemiAuto and FullAuto run directly.

  • Auto-forbidden in this module:

    • MayEnterPlayMode = trueyooasset_runtime_validate_package, yooasset_runtime_cleanup
    • SkillOperation.Deleteyooasset_remove_collector_package, yooasset_remove_collector_group, yooasset_remove_collector

    Reachable only under Bypass mode or via a user-managed Allowlist entry; the grant flow returns MODE_FORBIDDEN. Note yooasset_build_bundles runs heavy disk I/O but has no Reload/PlayMode flag, so it stays grantable.

  • When com.tuyoogame.yooasset is missing, every skill except yooasset_check_installed returns a NoYooAsset() error with install instructions.

DO NOT (common hallucinations):

  • yooasset_initialize / yooasset_load_asset / yooasset_create_downloader — do NOT exist as general-purpose REST skills. Runtime APIs (YooAssets.Initialize, default-package YooAssets.LoadAssetAsync, ResourcePackage.LoadAssetAsync, RequestPackageVersionAsync, CreateResourceDownloader) belong in game code. Use yooasset-design when writing runtime code.
  • yooasset_modify_group / yooasset_delete_collector / yooasset_open_scanner_window — wrong names. Use the exact schema names below or query GET /skills/schema?category=YooAsset.
  • yooasset_install — NOT a skill. Package install is a Package Manager user action.
  • Do NOT pass timeout to yooasset_build_bundles — the property was removed in YooAsset 2.3.16. Runtime watchdog now lives on CacheFileSystemParameters.DOWNLOAD_WATCH_DOG_TIME (runtime concern, not a build parameter).
  • Do NOT call yooasset_build_bundles while EditorUserBuildSettings.isBuildingPlayer == trueBuildParameters.CheckBuildParameters throws.

Routing:

  • Collector configuration (packages, groups, collectors, rules) → this module.
  • Actual bundle build + simulate + paths → this module.
  • Build report analysis (bundle size, asset list/detail, dependency graph, report compare, orphan) → this module.
  • Runtime validation in Editor PlayMode → yooasset_runtime_validate_package + polling/cleanup skills in this module.
  • Runtime code generation/design (Initialize / Load / Download / Scene in game scripts) → write it yourself using yooasset-design.
  • YooAsset companion windows and AssetArtScanner config/runs → this module.
  • Version-policy decisions (2.x vs pre-2.3.15 manifest, FindAssetType on IFilterRule) → yooasset-design/PITFALLS.md.

Skills

Environment (1)

Skill Purpose Key Parameters
yooasset_check_installed Reflection probe — works even when the package is missing. Reports runtime assembly, package version, editor availability, and which of the 4 pipelines are present. (none)

Build pipeline (7)

Skill Purpose Key Parameters
yooasset_build_bundles Build bundles via ScriptableBuildPipeline or RawFileBuildPipeline. Writes to <projectPath>/Bundles/<PackageName>/<Version>. packageName, packageVersion="auto", pipeline="ScriptableBuildPipeline", buildTarget?, compression="LZ4", fileNameStyle="HashName", clearBuildCache=false, useAssetDependencyDB=true, verifyBuildingResult=true, replaceAssetPathWithAddress=false, stripUnityVersion=false, disableWriteTypeTree=false, trackSpriteAtlasDependencies=false, writeLinkXML=true, cacheServerHost="", cacheServerPort=0, builtinShadersBundleName="", monoScriptsBundleName="", includePathInHash=false, buildinFileCopyOption="None", buildinFileCopyParams="", enableLog=true
yooasset_simulate_build Run AssetBundleSimulateBuilder.SimulateBuild for an EditorSimulateMode package — virtual bundles only, no files written. packageName
yooasset_get_default_paths Return BuildOutputRoot + StreamingAssetsRoot that YooAsset uses. (none)
yooasset_get_build_settings Read persisted YooAsset AssetBundle Builder EditorPrefs for a package/pipeline. packageName, pipeline?
yooasset_set_build_settings Persist AssetBundle Builder EditorPrefs for repeatable build UI defaults. packageName, pipeline?, compression?, fileNameStyle?, buildinFileCopyOption?, buildinFileCopyParams?, encryptionServicesClassName?, manifestProcessServicesClassName?, manifestRestoreServicesClassName?, clearBuildCache?, useAssetDependencyDB?
yooasset_open_builder_window Open the YooAsset AssetBundle Builder Editor window. (none)
yooasset_open_collector_window Open the YooAsset AssetBundle Collector Editor window. (none)

YooAsset tools (8)

Skill Purpose Key Parameters
yooasset_open_reporter_window Open the YooAsset AssetBundle Reporter window. (none)
yooasset_open_debugger_window Open the YooAsset AssetBundle Debugger window. (none)
yooasset_open_assetart_scanner_window Open the YooAsset AssetArt Scanner window. (none)
yooasset_list_assetart_scanners List AssetArtScanner configurations, optionally filtered by keyword. keyword?
yooasset_run_assetart_scanner Run one scanner and optionally save its report file. scannerGUID, saveDirectory?
yooasset_run_all_assetart_scanners Run all scanners, optionally filtered by keyword. keyword?
yooasset_import_assetart_scanner_config Import AssetArtScanner JSON config. configPath
yooasset_export_assetart_scanner_config Export AssetArtScanner JSON config. configPath

Runtime validation (3)

Skill Purpose Key Parameters
yooasset_runtime_validate_package Start an async PlayMode job that initializes EditorSimulateMode, sets default package, optionally validates one asset load/release and downloader status, then optionally cleans up and returns to Edit Mode. packageName, assetLocation?, restoreEditMode=true, cleanup=true, checkDownloader=true, downloadingMaxNumber=4, failedTryAgain=1
yooasset_runtime_get_validation_result Poll the runtime validation job status/result. jobId
yooasset_runtime_cleanup Remove completed validation jobs and optionally force YooAssets.Destroy() / exit PlayMode. jobId?, forceYooAssetsDestroy=false, exitPlayMode=false

Collector configuration (13)

Skill Purpose Key Parameters
yooasset_list_collector_packages List Packages → Groups → Collectors tree. verbose=true returns the full descent. verbose=false
yooasset_list_collector_rules Return registered Active / Address / Pack / Filter / Ignore rule classes. ruleKind="all" (or `activeRule
yooasset_create_collector_package Create a new Collector Package. Fails on duplicate unless allowDuplicate=true. packageName, allowDuplicate=false
yooasset_create_collector_group Create a Group inside an existing Package. packageName, groupName, groupDesc="", activeRule="EnableGroup", assetTags=""
yooasset_add_collector Add an AssetBundleCollector to a Group. Validates collectPath via AssetDatabase and each rule via its registered class name. packageName, groupName, collectPath, collectorType="MainAssetCollector", addressRule="AddressByFileName", packRule="PackDirectory", filterRule="CollectAll", assetTags="", userData=""
yooasset_save_collector_config Persist the AssetBundleCollectorSetting.asset. Optionally run FixFile() to repair dangling rule references. fixErrors=true
yooasset_modify_collector_settings Modify global Collector settings. showPackageView=false, uniqueBundleName=false, save=true
yooasset_modify_collector_package Rename/describe a package and set package-level options. packageName, packageDesc?, newPackageName?, enableAddressable=false, supportExtensionless=true, locationToLower=false, includeAssetGUID=false, autoCollectShaders=true, ignoreRule="NormalIgnoreRule", save=true
yooasset_remove_collector_package Remove a Collector package by name. packageName, save=true
yooasset_modify_collector_group Rename/describe a group and update active rule/tags. packageName, groupName, newGroupName?, groupDesc?, activeRule="EnableGroup", assetTags?, save=true
yooasset_remove_collector_group Remove a group from a package. packageName, groupName, save=true
yooasset_modify_collector Modify an existing collector matched by collectPath. packageName, groupName, collectPath, newCollectPath?, collectorType="MainAssetCollector", addressRule="AddressByFileName", packRule="PackDirectory", filterRule="CollectAll", assetTags?, userData?, save=true
yooasset_remove_collector Remove a collector matched by collectPath. packageName, groupName, collectPath, save=true

Build report analysis (8)

Skill Purpose Key Parameters
yooasset_load_build_report Deserialize a YooAsset BuildReport .report file and return ReportSummary metadata + top-level totals. reportPath
yooasset_list_report_bundles Paginated / filtered / sorted bundle listing from the report. reportPath, filterEncrypted?, filterTag?, sortBy="size" (`size
yooasset_get_bundle_detail Full ReportBundleInfo for a single bundle — DependBundles, ReferenceBundles, asset BundleContents. reportPath, bundleName
yooasset_list_report_assets Paginated / filtered / sorted asset listing from the report. reportPath, filterBundle?, filterTag?, search?, sortBy="path" (`path
yooasset_get_asset_detail Full ReportAssetInfo by asset path or address. reportPath, assetPath?, address?
yooasset_get_dependency_graph Compact bundle/asset dependency graph for visualization or focused analysis. reportPath, rootBundle?, rootAssetPath?, maxNodes=200
yooasset_compare_build_reports Compare two .report files for bundle/asset additions, removals, and size changes. oldReportPath, newReportPath, limit=100
yooasset_list_independ_assets Assets not referenced by any main asset — cleanup candidates. reportPath, limit=100, offset=0

Quick Start

import unity_skills as u

# 0. Probe installation (works even if package is missing)
u.call_skill("yooasset_check_installed")
# -> { installed, packageVersion, availablePipelines: [...], editorAvailable, ... }

# 1. Configure collectors (end-to-end)
u.call_skill("yooasset_list_collector_rules", ruleKind="all")  # discover available rule class names
u.call_skill("yooasset_create_collector_package", packageName="DefaultPackage")
u.call_skill("yooasset_create_collector_group",
    packageName="DefaultPackage", groupName="UI", activeRule="EnableGroup",
    assetTags="ui")
u.call_skill("yooasset_add_collector",
    packageName="DefaultPackage", groupName="UI",
    collectPath="Assets/GameRes/UI",
    collectorType="MainAssetCollector",
    addressRule="AddressByFileName",
    packRule="PackDirectory",
    filterRule="CollectAll")
u.call_skill("yooasset_modify_collector_package",
    packageName="DefaultPackage",
    enableAddressable=True,
    supportExtensionless=True,
    locationToLower=False)
u.call_skill("yooasset_save_collector_config", fixErrors=True)

# 2. Simulate build (EditorSimulateMode) — fast, no file I/O
u.call_skill("yooasset_simulate_build", packageName="DefaultPackage")
# -> { packageRootDirectory: ".../Bundles/DefaultPackage/Simulate" }

# 3. Real build
result = u.call_skill("yooasset_build_bundles",
    packageName="DefaultPackage",
    packageVersion="1.0.0",
    pipeline="ScriptableBuildPipeline",
    compression="LZ4",
    fileNameStyle="HashName",
    verifyBuildingResult=True)

# 4. Analyze the report
import os
report_path = os.path.join(
    result["outputDirectory"],
    f"{result['packageName']}_{result['packageVersion']}.report")
u.call_skill("yooasset_load_build_report", reportPath=report_path)
u.call_skill("yooasset_list_report_bundles", reportPath=report_path, sortBy="size", limit=20)
u.call_skill("yooasset_list_report_assets", reportPath=report_path, search="UI", limit=20)
u.call_skill("yooasset_get_dependency_graph", reportPath=report_path, maxNodes=100)
u.call_skill("yooasset_list_independ_assets", reportPath=report_path)

# 5. Optional PlayMode runtime validation
job = u.call_skill("yooasset_runtime_validate_package",
    packageName="DefaultPackage",
    assetLocation="ui/example",
    restoreEditMode=True,
    cleanup=True)
u.call_skill("yooasset_runtime_get_validation_result", jobId=job["jobId"])

Critical Rules (must read)

  1. yooasset_check_installed is the ONLY skill that works without YOO_ASSET compile define. Every other skill returns NoYooAsset() — correct the environment (install or upgrade the package, then let Unity recompile) before retrying.
  2. Pipeline ↔ Parameters pairing is enforced. yooasset_build_bundles pipeline=ScriptableBuildPipeline uses ScriptableBuildParameters; pipeline=RawFileBuildPipeline uses RawFileBuildParameters. EditorSimulateBuildPipeline is rejected here — use yooasset_simulate_build. BuiltinBuildPipeline is legacy and explicitly rejected.
  3. packageVersion="auto" fills DateTime.UtcNow.ToString("yyyyMMddHHmm"). Pass a semver string when you want deterministic versioning.
  4. yooasset_add_collector validates collectPath via AssetDatabase.LoadAssetAtPath. Paths must be under Assets/...; absolute or relative ../ paths will fail.
  5. Rule names in Create Skills are CLASS names, not display names. Use yooasset_list_collector_rules to discover valid values (e.g. EnableGroup, AddressByFileName, PackDirectory, CollectAll, NormalIgnoreRule).
  6. Collector mutations can save immediately or be batched. Create skills mark IsDirty=true; modify/remove skills expose save=true. For bulk edits, pass save=false and finish with yooasset_save_collector_config.
  7. yooasset_build_bundles is NOT undo-tracked (external file I/O, not scene/asset state). clearBuildCache=true re-runs the full pipeline; defaults avoid it for incremental speed.
  8. BuildReport lives next to bundles as a .report file — YooAsset 2.3.18 writes it as <BuildOutputRoot>/<BuildTarget>/<PackageName>/<Version>/<PackageName>_<PackageVersion>.report. Do not pass BuildReport.json, <PackageName>_<PackageVersion>.json, or buildlogtep.json: the .json file is the package manifest and buildlogtep.json is the Scriptable Build Pipeline trace log. yooasset_list_report_bundles reads the .report file standalone, so you can also point it at an archived copy.
  9. Runtime validation may enter PlayMode. yooasset_runtime_validate_package is intentionally async; poll the job result and use yooasset_runtime_cleanup if the editor is left in a state you do not want.
  10. yooasset_list_independ_assets identifies assets not referenced by any main asset — candidates for the Collector to drop. Verify manually before removing; a main asset created later could still need them.

Version Scope

  • Target: YooAsset 2.3.18 (published 2025-12-04). Source anchors use this version.
  • Minimum: 2.3.15 (enforced by the asmdef versionDefines entry). Earlier versions use an incompatible manifest format and pre-FindAssetType IFilterRule (would not compile against this Skill module).
  • 2.3.17 fixed a critical CRC validation bug; users on 2.3.15/2.3.16 should upgrade before relying on verifyBuildingResult=true.
  • Runtime-side rules (PlayMode mapping, handle lifecycle, update flow, legacy-API migration) → yooasset-design/SKILL.md.

Exact Signatures

For authoritative parameter names, defaults, and return fields, query GET /skills/schema?category=YooAsset or unity_skills.get_skill_schema(). This document is a routing / best-practice guide, not the signature source.

通过本地 REST API 自动化 Unity 编辑器,支持创建脚本、管理资源、构建场景及批量操作。适用于从对话中执行 Unity 相关任务,需先获取技能概览并校验参数后再执行。
用户希望从聊天界面操作 Unity 编辑器 需要创建或修改 GameObject、脚本、场景或资产 执行批量编辑或运行测试等自动化任务 用户提及“在 Unity 里…”或“操作 Unity”
SkillsForUnity/unity-skills~/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-skills -g -y
SKILL.md
Frontmatter
{
    "name": "unity-skills",
    "description": "Automate the Unity Editor through a local REST API — create and edit scripts, build scenes and prefabs, manage assets\/materials\/lighting, run tests, and drive hundreds of Editor operations across modules. Use whenever the user wants to operate Unity from chat — create or modify GameObjects\/scripts\/scenes\/assets, batch-edit, or run any Unity Editor automation, even if they just say \"在 Unity 里…\" or \"操作 Unity\". 通过本地 REST API 自动化 Unity 编辑器(创建与编辑脚本、搭建场景与 Prefab、管理资源\/材质\/灯光、运行测试,覆盖跨模块的数百项编辑器操作);当用户想从对话里操作 Unity——创建或修改 GameObject\/脚本\/场景\/资源、批量编辑、或执行任何 Unity 编辑器自动化时使用。"
}

Unity Skills

Use this skill when the user wants to automate the Unity Editor through the local UnitySkills REST server.

Schema: query only when unsure

The schema is the canonical source for exact skill names, parameters, defaults, and returns — but you do not need it for every call. For common read-only or simple write calls whose parameters you already know, call directly; query schema only when a skill name or signature is uncertain.

  • Awareness — first fetch (lite): GET /skills?summary=1 — every skill's name, full description, category, operation, and riskLevel (~143 KB ≈ 35K tokens, server-cached). Pull this FIRST per session for full project awareness cheaply: you see all 726 skills and what each does, so you can pick the best one — including cross-module ones you'd otherwise miss (e.g. a manual loop instead of batch_query_*). Skipping awareness risks myopic, suboptimal choices. This is complete awareness (all skills + full descriptions); it omits only execution-detail (parameter schemas, tags, outputs) — see the dryRun gate below before executing.
  • Full detail (when needed): unity_skills.get_skill_schema() / GET /skills/schema — full schema with exact parameter schemas (~618 KB ≈ 150K tokens, client-cached 300s). Pull when the lite view didn't surface a matching skill, or when you need exact parameter types/defaults to execute. Don't re-pull every call.
  • Per-module detail: GET /skills/schema?category=<Category> — scoped schema (~13–44 KB, server-cached) for exact signatures of one module you're about to execute. A supplement to awareness, not a replacement.

Before executing a skill — the dryRun gate (do not skip). The lite/summary manifest is for awareness (picking the right skill), not for calling. Descriptions are informal (human-written, not a formal signature; some omit parameter hints) and parameter schemas are omitted. Before the first execution of any skill whose exact parameters you don't already hold in context, dryRun it: POST /skill/<name>?mode=dryRun with your best-guess args. The server validates parameters and, on error, returns unknownParams with suggestions (the correct parameter names) plus the full parameters schema — iterate until valid: true, then execute without ?mode=dryRun. This is the mechanism that turns "awareness" into "correct operation steps"; never guess parameters from descriptions and never skip dryRun for a skill you have not yet called successfully this session.

Multi-skill tasks — aggregate-plan first. When a task needs several skills in sequence, call workflow_plan (POST a JSON array of {name, params} steps) before executing any of them. It returns combined steps, dependencies, totalRisk, and warnings, so you sequence correctly and surface cross-step blockers before the first mutation. Then dryRun + execute each step in order.

Use module SKILL.md files for routing guidance, guardrails, and minimal examples, not as the canonical source of exact signatures.

Current snapshot: 750 REST skills, 51 functional source modules, 68 module documentation directories (49 REST/module docs + 19 advisory docs), Unity 2022.3+, default timeout 15 minutes.

Python helper: unity-skills/scripts/unity_skills.py

Operating Mode (v1.9.0+)

Operating mode is a server-side permission gate, configured in Window > UnitySkills > Server and persisted in EditorPrefs per-machine. It is not an AI routing policy and cannot be switched via chat or REST — chat-side trigger words no longer apply.

Boot Handshake

On session start (or before the first skill call), call GET /health and read:

  • currentMode"approval" / "auto" / "bypass"
  • panelApprovalRequired — only meaningful under Approval; selects the grant channel
  • pendingCount — outstanding grant requests

Three Modes (aligned with Claude Code permission modes)

Factory default: a fresh install starts in Auto; an upgraded install (any pre-existing UnitySkills_* pref) starts in Bypass. It never defaults to Approval. The "Claude Code 类比" column below is only a mental model, not the factory default — always read /health.currentMode before acting.

Mode Claude Code 类比(心智对照,非默认) FullAuto skill Auto-detected NeverInSemi skill
Approval default / plan First call returns MODE_RESTRICTED; run the grant protocol below MODE_FORBIDDEN
Auto acceptEdits Executes directly (audit written); you must self-assess sensitive cases MODE_FORBIDDEN
Bypass bypassPermissions Executes directly Executes directly (only ConfirmationToken still gates high-risk)

NeverInSemi is derived automatically by IsForbiddenInSemi() — there is no manual marker. See "Skill Mode Annotation" below.

Approval Mode Grant Protocol

Approval grants are single-shot one-step execution: a successful /permission/grant call runs the original skill server-side and returns the result in the same response. You do not retry the skill after grant. Grants are not persisted — calling the same skill a second time will hit MODE_RESTRICTED again and must go through grant again. If the user wants permanent bypass for a skill, direct them to the Allowlist (see below).

On MODE_RESTRICTED, branch on details.approvalChannel:

Dialog channel ("dialog", default — panelApprovalRequired = false)

  1. Tell the user in chat: "要调用 <skill><目的>,参数 <argsSummary>,请求码 #<token 前 6 位>,是否允许?"
  2. After explicit user consent, call POST /permission/grant { skill, token, args } once
  3. On success, the response contains { ok: true, executed: true, skill, result: <Execute output> } — the skill has already run server-side. Consume result directly; do not call the original skill endpoint again

Panel channel ("panel", when panelApprovalRequired = true)

  1. Tell the user in chat: "要调用 <skill><目的>,请到 Window > UnitySkills 面板的 Pending Grant Requests 点 [Approve](请求码 #<token 前 6 位>)"
  2. Do not call /permission/grant yet — calling it before the user clicks Approve returns GRANT_PENDING_APPROVAL
  3. Poll GET /permission/status?token=<token> to observe the request state (look at focus.approvedByPanel)
  4. Once the user has pressed Approve in the panel, call POST /permission/grant { skill, token, args } once — this takes the Granted branch and triggers one-step execution, returning { ok: true, executed: true, skill, result }. Consume result directly; do not call the original skill endpoint again

Note: panel approval no longer auto-routes the result back to the AI. The Approve click only flips the request into the Granted state; AI must follow up with one /permission/grant call to fetch the execution result.

On MODE_FORBIDDEN: the skill is auto-classified as NeverInSemi (Delete / Domain Reload / Play Mode / high-risk). It is callable only under Bypass, or if the user has explicitly added it to the Allowlist (see below). Do not attempt the grant flow — tell the user the action requires Bypass mode, an Allowlist entry, or offer an alternative skill.

Allowlist (user-managed permanent bypass)

The Allowlist is a user-managed permanent whitelist of skill names, configured in Window > UnitySkills > Server settings drawer (Allowlist Skills section / + Add Skill button). It is independent of Approval grants:

  • Allowlisted skills execute directly under any mode — the server skips the Approval/MODE_RESTRICTED gate
  • An Allowlist entry overrides MODE_FORBIDDEN for that skill (covers Delete / MayEnterPlayMode / MayTriggerReload / RiskLevel="high"). This is intentional: the user has explicitly opted in
  • Allowlist does NOT bypass the high-risk ConfirmationToken gate. When RequireConfirmation is enabled (Settings drawer → Runtime → Require Confirmation), high-risk skills still require the _confirm token two-step handshake even if allowlisted — Allowlist only covers the mode/approval channel, not the per-call safety confirmation
  • The list is opaque to the AI: allowlisted skills look like normal successful calls, never returning MODE_RESTRICTED
  • The AI should not call /permission/allowlist/add on its own initiative. Only call it when the user has explicitly authorized a session-scoped bulk add (e.g. "把这几个 skill 加白名单方便我后面批量调"); otherwise direct the user to add entries through the panel
  • Allowlist endpoints: GET /permission/allowlist / POST /permission/allowlist/add / POST /permission/allowlist/remove (body {skill} or {all: true})

The previous GrantedSkills semantics ("after one grant the skill is permanently auto-allowed") has been removed. Grants are now single-shot. Permanent allow == Allowlist; one-shot approval == grant.

Auto Mode Self-Assessment

Under Auto, FullAuto skills run directly. You must pause and confirm with the user in chat when any of the following apply:

  • Batch operation touching ≥ 5 objects
  • Prefab apply / scene-level mutation / asset overwrite
  • Dry-run shows irreversible changes (deletes, overrides, cascading edits)

This confirmation is a chat-level check (explain plan + risk + ask), independent of the server-side mode gate. The server will not stop you in Auto — the audit log records the call regardless.

Relationship with ConfirmationTokenService

Mode authorization (persistent, per-skill) and ConfirmationToken (single-shot, per-call) are orthogonal:

  • Mode check runs first; if allowed, the existing confirmation gate may still issue CONFIRMATION_REQUIRED with a dry-run for RiskLevel=high or Operation.Delete skills
  • Granted skills still flow through ConfirmationToken when triggered — continue using the original dry-run → user consent → retry with _confirm loop
  • Neither replaces the other

Skill Mode Annotation

The REST surface (~750 skills) is partitioned by [UnitySkill] Mode and runtime metadata. Use schema endpoints for the canonical list:

Annotation Count Source
SkillMode.SemiAuto ~270 Manually annotated. Covers read-only / query / analyze skills across script / perception / scene / editor / asset / workflow / debug / console and most modules' info / list / get / find skills
Auto-detected NeverInSemi ~75-79 IsForbiddenInSemi() derives purely from Operation.Delete, MayEnterPlayMode, MayTriggerReload, RiskLevel="high" (no fallback list)
SkillMode.FullAuto (default) remainder Unannotated skills (write / mutate by default). Approval requires grant; Auto / Bypass execute directly

SemiAuto (read/query/analyze) skills are directly callable in every mode and span the modules below; use GET /skills?category=<Category> for the exact list (write skills in the same modules stay FullAuto):

  • script (read/list/get_info/find_in_file/get_compile_feedback) · perception (scene_analyze/context/health_check/find_hotspots, project_stack_detect) · scene (get_info/get_hierarchy/get_loaded/find_objects) · editor (get_context/state/selection/tags/layers) · asset (find/get_info) · workflow (list/session_*/plan — prefer workflow & batch helpers for planning/preview/jobs/rollback) · debug + console (check_compilation/get_errors/get_system_info/get_memory_info/get_logs)
  • plus most modules' own info / list / get / find skills. Advisory: 19 design-only modules (no REST skills) — see Coding Reference Index below.

Core Rules

  1. If the user specifies a Unity version or editor line, set instance/version routing first with unity_skills.set_unity_version(...).
  2. BATCH-FIRST — whenever the task touches 2+ objects, use the *_batch variant. Calling the single-object skill in a loop is N round-trips (and 2N under Approval, since each call needs its own grant). Always look for a *_batch form before looping.
  3. For multi-step editor mutations, prefer workflow wrappers instead of free-form mutation sequences.
  4. Script edits, define changes, package changes, some imports, and test template creation can trigger compilation or Domain Reload. Wait and retry on transient unavailability.
  5. test_* skills are async. They return a jobId and must be polled with test_get_result(jobId).
  6. Object location (Unity 6000.4+) — on Unity 6000.4+ the legacy instanceId is reported as 0 and is no longer a reliable handle; locate GameObjects/components by entityId (the entityId field returned by object skills) instead. Locator priority is entityId > instanceId > path > name. Object skills accept a synthetic entityId parameter and return both entityId and instanceId; on Unity < 6000.4 the instanceId path still works unchanged.

Coding Reference Index

Before writing or refactoring Unity code, load the relevant advisory module first. These are the 19 Documentation only design modules (no REST skills — loadable under any mode) that pin rules to engine source and prevent hallucinated / removed APIs. Load on demand by topic, not all at once.

General coding & architecture — before writing gameplay code or making structural decisions:

Module Load when
project-scout Before proposing changes in an existing project — first check Unity version, packages, asmdef, folders, coding patterns
architecture Module boundaries, scene design, SOLID structure, decoupling, refactor direction
script-roles Whether a class should be a MonoBehaviour, ScriptableObject, plain C# service, or installer
scriptdesign Code review, reducing coupling, improving maintainability, refactoring scripts
patterns Choosing among ScriptableObject / event / state-machine / object-pool / observer designs
testability Improving testability, isolating logic out of MonoBehaviour, planning EditMode/PlayMode tests
asmdef Module boundaries, faster compiles, clearer dependencies, editor/runtime/test split
async Choosing among Update / coroutine / UniTask / timers, or cleanup & cancellation
inspector SerializeField usage, Tooltip/Header organization, validation, Inspector UX
scene-contracts Required scene objects, component dependencies, bootstrap logic, reference wiring
adr Comparing options, choosing among approaches, locking in a design decision
performance Performance review, frame drops, Update/allocation/pooling/physics optimization
blueprints Starter structure for a small game (platformer, shooter, runner, puzzle, tower-defense, clicker, card)

Library-specific — before writing code against that library (guards against removed / hallucinated APIs):

Module Load before writing
addressables-design InitializeAsync / LoadAssetAsync / LoadSceneAsync / UpdateCatalogs / AssetReference
dotween-design DOTween.Init / DOMove / Sequence / SetLoops / SetLink / ToUniTask
netcode-design NetworkBehaviour / RPC / NetworkVariable / Spawn
shadergraph-design Graph structure, node chains, SubGraph boundaries, keyword / blackboard layout
unitask-design async UniTask / UniTaskVoid / PlayerLoopTiming / CancellationToken / WhenAll
yooasset-design ResourcePackage / AssetHandle / Downloader / FileSystem / AssetBundleBuilder
yaml-editing Hand-editing .unity / .prefab / .asset / .meta / ProjectSettings YAML when REST cannot reach (compile failure, .meta, hidden ProjectSettings fields, merge conflict)

Unity API reference: references/*.md — official API grouped by topic (2d, 3d, animation, assets, audio, editor, networking, physics, rendering, scripting, shaders, ui, xr, …). Read the relevant file to ground exact signatures instead of guessing.

Load any module via the index: unity-skills/skills/<module>/SKILL.md.

Route

  • Module index: unity-skills/skills/SKILL.md
  • Script guidance: unity-skills/skills/script/SKILL.md
  • Advisory guidance: load advisory modules on demand from the module index

XR rule: Before calling any xr_* skill in a session, load skills/xr/SKILL.md first. XR is reflection-based; wrong property names can fail silently.

提供Unity Addressables源码级设计规则,覆盖1.22.3与2.9.1版本。指导异步加载、资源管理、热更新及版本迁移,确保代码合规性。
编写Addressables初始化或异步加载代码 审查AssetReference使用或AsyncOperationHandle释放 配置目录更新或内容下载逻辑 进行Addressables版本迁移(如1.22.3至2.9.1) 用户提及'可寻址'或'热更'相关需求
SkillsForUnity/unity-skills~/skills/addressables-design/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-addressables-design -g -y
SKILL.md
Frontmatter
{
    "name": "unity-addressables-design",
    "description": "Source-anchored design rules for Unity Addressables across two versions — 1.22.3 on Unity 2022 and 2.9.1 on Unity 6 — covering initialization, async operation handles, asset\/scene loading, catalog updates, content download, AssetReference, and version migration. Use when writing or reviewing Addressables code, loading assets\/scenes asynchronously, setting up hot-update or catalog refresh, or migrating between versions, even if the user just says \"可寻址\" or \"热更\". 为 Unity Addressables 提供源码锚定的设计规则(覆盖两个版本,Unity 2022 用 1.22.3、Unity 6 用 2.9.1;含初始化、异步操作句柄、资源\/场景加载、目录更新、资源下载、AssetReference、版本迁移);当用户要编写或审查 Addressables 代码、异步加载资源\/场景、配置热更新或目录刷新时使用。"
}

Addressables - Design Rules

Advisory module. Every rule is distilled from Unity Addressables source at two versions:

  • 1.22.3com.unity.addressables@1.22.3 (Unity 2022, min 2019.4)
  • 2.9.1com.unity.addressables@8460f1c9c927 (Unity 6, min 2023.1)

Each rule cites a concrete file/line so the reasoning is auditable and the AI does not improvise against stale memory.

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

When to Load This Module

Load before writing or reviewing any of:

  • Addressables.InitializeAsync() / LoadContentCatalogAsync() bootstrap code
  • LoadAssetAsync<T> / LoadAssetsAsync<T> / InstantiateAsync and their handle release
  • LoadSceneAsync / UnloadSceneAsync — especially with SceneReleaseMode (2.9.1)
  • CheckForCatalogUpdatesUpdateCatalogsCleanBundleCache patch flow
  • GetDownloadSizeAsync / DownloadDependenciesAsync / ClearDependencyCacheAsync
  • AssetReference / AssetReferenceT<T> field declarations and load/release
  • Any code that calls WaitForCompletion() or uses AsyncOperationHandle directly
  • Migration from 1.22.3 to 2.9.1 — removed APIs, changed overload signatures

Version Difference Matrix

Area 1.22.3 (Unity 2022) 2.9.1 (Unity 6)
Non-Async variants (LoadAsset, Instantiate, LoadScene, etc.) [Obsolete] — compile warning Removed — compile error
IList<object> multi-key overloads Present Replaced by IEnumerable
SceneReleaseMode enum Does not exist New — controls bundle lifetime on scene unload
LoadSceneAsync releaseMode param Absent SceneReleaseMode.ReleaseSceneWhenSceneUnloaded default
LoadAssetsAsync<T>(string key, ...) Does not exist New string-key overload
UpdateCatalogs(bool autoCleanBundleCache, ...) Does not exist New overload
LegacyResourcesLocator / LegacyResourcesProvider Present Removed
DiagnosticEvent / DiagnosticEventCollector Present Removed
ResourceManagerEventCollector Present Removed
ResourceManager.RegisterDiagnosticCallback() [Obsolete] Removed
InitializationOperation property [Obsolete], returns default Removed
BinaryCatalogInitializationData Does not exist New
CachedFileProvider Does not exist New

Critical Rule Summary

# Rule Version Source anchor
1 All non-Async variants (LoadAsset, Instantiate, LoadScene, UnloadScene, GetDownloadSize, DownloadDependencies, Initialize, LoadContentCatalog) are [Obsolete] in 1.22.3 and removed in 2.9.1. Always use the *Async form. Both Addressables.cs:1.22.3:862-2226, Addressables.cs:2.9.1 (absent)
2 Every AsyncOperationHandle returned by a Load/Instantiate call MUST be released via Addressables.Release(handle). Forgetting leaks the AssetBundle in memory indefinitely — even after the scene unloads. Both AsyncOperationHandle.cs:2.9.1:178-203
3 WaitForCompletion() blocks the calling thread synchronously. On WebGL it is unsupported and throws. Never call it on the main thread in production; use await handle.Task or the Completed event instead. Both AsyncOperationHandle.cs:2.9.1:178-203
4 LoadSceneAsync in 2.9.1 adds SceneReleaseMode releaseMode (default ReleaseSceneWhenSceneUnloaded). If a Single-mode load unloads your additive scene and you need the bundle to stay alive, pass OnlyReleaseSceneOnHandleRelease and release the handle manually. 2.9.1 ISceneProvider.cs:2.9.1:14-26, Addressables.cs:2.9.1:1914
5 Multi-key overloads changed from IList<object> to IEnumerable in 2.9.1. The old IList<object> overloads no longer exist — pass IEnumerable or string[]. 2.9.1 Addressables.cs:2.9.1:1148,1566,1636
6 LegacyResourcesLocator and LegacyResourcesProvider were removed in 2.9.1. Do not reference them in code targeting Unity 6. 2.9.1 Runtime/ResourceLocators/ (absent in 2.9.1)
7 ResourceManager.RegisterDiagnosticCallback() was [Obsolete] in 1.22.3 and removed in 2.9.1. Use the Addressables Profiler window instead. 2.9.1 ResourceManager.cs:1.22.3:353 (absent in 2.9.1)
8 Catalog update flow is strictly ordered: CheckForCatalogUpdates → UpdateCatalogs. In 2.9.1, UpdateCatalogs(bool autoCleanBundleCache, ...) can auto-clean stale bundles in one call. Both Addressables.cs:2.9.1:2092-2147
9 AssetReference.LoadAssetAsync<T>() returns a handle that must be released via assetRef.ReleaseAsset(), NOT Addressables.Release(handle). Mixing the two causes double-release exceptions. Both AssetReference.cs:1.22.3:44-46
10 InitializationOperation property (1.22.3) is [Obsolete] and returns default. Do not await it. Use await Addressables.InitializeAsync() instead. 1.22.3 Addressables.cs:1.22.3:981-982

Sub-doc Routing

Sub-doc When to read
INIT.md InitializeAsync / LoadContentCatalogAsync / catalog loading order / autoReleaseHandle semantics
HANDLES.md AsyncOperationHandle<T> lifecycle — Completed, WaitForCompletion, Release, IsDone, Status, OperationException, ref-counting
LOADING.md LoadAssetAsync, LoadAssetsAsync (all overloads + version diff), MergeMode, InstantiateAsync, ReleaseInstance
SCENE.md LoadSceneAsync / UnloadSceneAsync / SceneInstance.ActivateAsync / SceneReleaseMode (2.9.1) / activateOnLoad=false pattern
UPDATE.md CheckForCatalogUpdatesUpdateCatalogs flow / autoCleanBundleCache (2.9.1) / CleanBundleCache / ResourceLocatorInfo
DOWNLOAD.md GetDownloadSizeAsync / DownloadDependenciesAsync / ClearDependencyCacheAsync / DownloadStatus struct
ASSETREF.md AssetReference / AssetReferenceT<T> / LoadAssetAsync / ReleaseAsset / OperationHandle property / IsDone guard
PITFALLS.md 30 concrete hallucination pitfalls with version tags + legacy API migration section

Routing to Other Modules

  • Asmdef layout for Addressables consumers → load asmdef
  • Async orchestration across multiple Addressables operations → load async
  • Architecture-level decisions (Addressables vs YooAsset, group strategy) → load architecture
  • Performance review of load/release hot paths → load performance

Version Scope

This document targets two versions:

  • 1.22.3 — shipped with Unity 2022 LTS. Contains [Obsolete] non-Async variants still present for migration.
  • 2.9.1 — shipped with Unity 6 (2023.1+). All [Obsolete] APIs removed. New SceneReleaseMode, binary catalog format, AutoGroupGenerator.

When a rule applies to only one version it is tagged [1.22.3] or [2.9.1]. Untagged rules apply to both.

Migration Notes (hallucination shield)

Legacy API Status Replacement Source
Addressables.Initialize() [Obsolete] in 1.22.3, removed in 2.9.1 Addressables.InitializeAsync() Addressables.cs:1.22.3:862-864
Addressables.LoadAsset<T>(key) [Obsolete] in 1.22.3, removed in 2.9.1 Addressables.LoadAssetAsync<T>(key) Addressables.cs:1.22.3:992-1007
Addressables.LoadAssets<T>(keys, cb, mode) [Obsolete] in 1.22.3, removed in 2.9.1 Addressables.LoadAssetsAsync<T>(keys, cb, mode) Addressables.cs:1.22.3:1242-1276
Addressables.Instantiate(key, ...) [Obsolete] in 1.22.3, removed in 2.9.1 Addressables.InstantiateAsync(key, ...) Addressables.cs:1.22.3:1892-1972
Addressables.LoadScene(key, ...) [Obsolete] in 1.22.3, removed in 2.9.1 Addressables.LoadSceneAsync(key, ...) Addressables.cs:1.22.3:2090-2106
Addressables.UnloadScene(handle, ...) [Obsolete] in 1.22.3, removed in 2.9.1 Addressables.UnloadSceneAsync(handle, ...) Addressables.cs:1.22.3:2180-2226
Addressables.GetDownloadSize(key) [Obsolete] in 1.22.3, removed in 2.9.1 Addressables.GetDownloadSizeAsync(key) Addressables.cs:1.22.3:1547
Addressables.DownloadDependencies(key) [Obsolete] in 1.22.3, removed in 2.9.1 Addressables.DownloadDependenciesAsync(key) Addressables.cs:1.22.3:1608
Addressables.InitializationOperation [Obsolete] in 1.22.3, removed in 2.9.1 await Addressables.InitializeAsync() Addressables.cs:1.22.3:981-982
LoadResourceLocationsAsync(IList<object> keys, ...) Present in 1.22.3, removed in 2.9.1 LoadResourceLocationsAsync(IEnumerable keys, ...) Addressables.cs:2.9.1:1148
GetDownloadSizeAsync(IList<object> keys) Present in 1.22.3, removed in 2.9.1 GetDownloadSizeAsync(IEnumerable keys) Addressables.cs:2.9.1:1566
DownloadDependenciesAsync(IList<object> keys, mode, ...) Present in 1.22.3, removed in 2.9.1 DownloadDependenciesAsync(IEnumerable keys, mode, ...) Addressables.cs:2.9.1:1636
LegacyResourcesLocator / LegacyResourcesProvider Present in 1.22.3, removed in 2.9.1 Use Addressables groups for all assets Runtime/ResourceLocators/LegacyResourcesLocator.cs:1.22.3
ResourceManager.RegisterDiagnosticCallback(...) [Obsolete] in 1.22.3, removed in 2.9.1 Addressables Profiler window ResourceManager.cs:1.22.3:353
DiagnosticEvent / DiagnosticEventCollector Present in 1.22.3, removed in 2.9.1 Addressables Profiler / custom IProfilerEmitter Runtime/ResourceManager/Diagnostics/:1.22.3

When in doubt, read the cited source — not your memory.

为DOTween 1.3.015提供源码级设计规则,涵盖补间基础、序列构建、生命周期绑定及UniTask集成。用于编写、审查动画代码或排查陷阱,支持Unity 2018+。
编写或审查DOTween动画代码 构建序列动画 绑定补间生命周期 排查补间陷阱 用户提及'补间'或'做个动画'
SkillsForUnity/unity-skills~/skills/dotween-design/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-dotween-design -g -y
SKILL.md
Frontmatter
{
    "name": "unity-dotween-design",
    "description": "Source-anchored design rules for DOTween 1.3.015 (Unity 2018+) — tween\/sequence basics, ease curves, shortcuts, lifetime binding, callbacks, safe mode, and integration with UniTask\/Addressables. Use when writing or reviewing DOTween animation code, building sequences, binding tween lifetime to objects, or debugging tween pitfalls, even if the user just says \"补间\" or \"做个动画\". 为 DOTween 1.3.015(Unity 2018+)提供源码锚定的设计规则(补间\/序列基础、缓动曲线、快捷方法、生命周期绑定、回调、安全模式、与 UniTask\/Addressables 集成);当用户要编写或审查 DOTween 动画代码、构建序列动画、绑定补间生命周期或排查补间陷阱时使用。"
}

DOTween - Design Rules

Advisory module. Every rule is distilled from Demigiant DOTween source at:

  • 1.3.015 — bundled in _DOTween.Assembly/DOTween/ and bin/Modules/ module files (Unity 2018+)

Each rule cites a concrete file/line so the reasoning is auditable and the AI does not improvise against stale memory.

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

When to Load This Module

Load before writing or reviewing any of:

  • DOTween.Init(...) bootstrap, DOTweenSettings configuration, SetTweensCapacity adjustments
  • Any .DOMove / .DORotate / .DOScale / .DOColor / .DOFade / .DOShake* / .DOPath / .DOPunch* shortcut call
  • DOTween.Sequence() + .Append / .Join / .Insert / .Prepend / .AppendInterval / .PrependInterval / .AppendCallback
  • .SetEase / .SetDelay / .SetLoops / .SetAutoKill / .SetLink / .SetId / .SetTarget / .SetUpdate / .SetRelative / .SetRecyclable / .SetSpeedBased
  • .OnStart / .OnUpdate / .OnStepComplete / .OnComplete / .OnKill / .OnPlay / .OnPause / .OnRewind
  • .AsyncWaitForCompletion / .AsyncWaitForKill / .AsyncWaitForRewind / .AsyncWaitForElapsedLoops / .AsyncWaitForPosition
  • tween.ToUniTask(TweenCancelBehaviour, CancellationToken) (UniTask bridge)
  • DOTween.Kill(target, complete) / DOTween.KillAll() batch operations
  • Safe Mode debugging — useSafeMode, safeModeLogBehaviour, nestedTweenFailureBehaviour
  • DOTween Module generation (Audio / Physics / Physics2D / Sprite / UI / UnityUI / TextMeshPro)

Critical Rule Summary

# Rule Source anchor
1 DOTween.Init(recycleAllByDefault, useSafeMode, logBehaviour) returns IDOTweenInit for fluent .SetCapacity(...). If not called explicitly, Auto-init runs on first tween creation (AutoInit at DOTween.cs:236). DOTween.Version = "1.3.015" is exposed as a const. DOTween.cs:38,227,236,243
2 Every tween is driven by a single [DOTween] GameObject MonoBehaviour (DOTweenComponent) marked DontDestroyOnLoad. It is created on first init and survives scene loads. Don't destroy it — DOTween.Clear(destroy: true) is the only supported teardown. DOTweenComponent.cs:268-270, DOTween.cs:311
3 Default autoKill = true: tween is killed on completion. After kill, calls like .Restart() / .Kill() / .Complete() are no-ops (Safe Mode) or NullReferenceException (Safe Mode off). Use .SetAutoKill(false) to keep tween alive for replay. DOTween.cs useSafeMode:49, TweenSettingsExtensions.cs:39,49
4 Safe Mode is ON by default (useSafeMode = true). Target destroyed while tween plays → Safe Mode catches the exception and logs per safeModeLogBehaviour (default: Warning). Disable Safe Mode to locate missing-link bugs during development. DOTween.cs:49,51
5 SetLink(gameObject, LinkBehaviour) binds tween lifecycle to a GameObject. Default LinkBehaviour.KillOnDestroy. Without SetLink, tween continues running after target is destroyed and relies on Safe Mode for protection. TweenSettingsExtensions.cs:91,103, LinkBehaviour.cs
6 SetTarget(object target) is required for DOTween.Kill(target) / DOTween.KillAll(target) grouping. Shortcut extensions (.DOMove, .DOFade, etc.) set target automatically; manual DOTween.To(...) does NOT. TweenSettingsExtensions.cs:116, DOTween.cs:884,892
7 Sequence.Append(t) runs after previous. Sequence.Join(t) runs in parallel with previous. Sequence.Insert(float atPosition, t) inserts at absolute time. Sequence.Prepend(t) pushes to front, shifting existing. TweenSettingsExtensions.cs:499,508,517,528
8 AsyncWaitForCompletion / AsyncWaitForKill / AsyncWaitForRewind live in DOTweenModuleUnityVersion.cs (MODULE file, gated by `UNITY_2018_1_OR_NEWER && (NET_4_6
9 UniTask bridge tween.ToUniTask(TweenCancelBehaviour, CancellationToken) lives in UniTask's External/DOTween/ extensions and is the recommended await path over AsyncWaitForCompletion. TweenCancelBehaviour has 9 values (Kill / Complete / CancelAwait / KillAndCancelAwait / ...). UniTask DOTweenAsyncExtensions.cs:14-27,54
10 Ease enum has 38 entries (36 user-facing + 2 reserved INTERNAL_*): Unset / Linear + In/Out/InOut variants of Sine/Quad/Cubic/Quart/Quint/Expo/Circ/Elastic/Back/Bounce (10 × 3 = 30 math eases) + Flash / InFlash / OutFlash / InOutFlash. INTERNAL_Zero and INTERNAL_Custom are auto-assigned by DOTween for zero-duration and AnimationCurve-based tweens. Ease.cs:9-53

Sub-doc Routing

Sub-doc When to read
BASICS.md DOTween.Init, driver GameObject, DOTweenSettings asset, Modules architecture, Safe Mode, tween capacity
TWEEN.md Tween base class, Tweener vs Sequence, autoKill, Play/Pause/Rewind/Restart/Kill/Complete/Goto lifecycle
SEQUENCE.md Sequence.Append / Join / Insert / Prepend / AppendInterval / PrependInterval / AppendCallback / InsertCallback, nesting, loop composition
SHORTCUTS.md .DOMove / DOLocalMove / DOAnchorPos / DORotate / DOScale / DOColor / DOFade / DOPath / DOJump / DOPunch / DOShake* cheat sheet by target type
EASE.md Full Ease enum, SetEase overloads (Ease / amplitude+period / AnimationCurve / EaseFunction), Flash family, Elastic/Back overshoot
LIFETIME.md SetAutoKill / SetLink / SetRecyclable / SetId / SetTarget / DOTween.Kill / DOTween.KillAll, Safe Mode, tween pool capacity
INTEGRATION.md DOTween + UniTask (ToUniTask), DOTween + Coroutine (WaitForCompletion), DOTween + Addressables lifetime, DOTween + Netcode deterministic replay
PITFALLS.md 30 concrete hallucination / runtime pitfalls (missing target, stale tween handle, OnComplete not firing on infinite loop, Safe Mode hiding bugs, etc.)

Routing to Other Modules

  • Async integration (ToUniTask, AsyncWaitForCompletion) → load unitask-design and async
  • UI animation (uGUI / UIToolkit) choice between DOTween and native animators → load inspector
  • Architecture / performance review of tween-heavy scenes → load performance
  • Asmdef layout for DOTween consumers (DOTween.asmdef, DOTween Modules asmdef) → load asmdef
  • Addressables-loaded prefab tween lifetime (bundle unload vs tween running) → load addressables-design

Version Scope

Targets DOTween 1.3.015 (the Pro/Free source bundled in _DOTween.Assembly/). Version is exposed as the const DOTween.Version = "1.3.015" at DOTween.cs:38.

Earlier 1.2.x versions are source-compatible for most APIs. Key differences:

  • Modules system (UI / TMP / Physics / etc.) requires post-1.2.0 source and the Utility Panel scanner.
  • SetLink was added in 1.2.x series; LinkBehaviour.KillOnDestroy vs KillOnDisable variants in later 1.2/1.3.
  • TweenCancelBehaviour (UniTask bridge) shipped separately via the UniTask package.

When in doubt, read the cited source — not your memory.

为Unity 2022.3 Shader Graph提供源码锚定的设计规则,涵盖图结构、节点子集及SubGraph边界。用于构建或审查着色器,指导节点链组织、黑板配置及URP/HDRP配方实现,确保建议基于实际包行为且符合安全白名单。
构建Shader Graph 审查Shader Graph结构 连个shader graph 着色器节点
SkillsForUnity/unity-skills~/skills/shadergraph-design/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-shadergraph-design -g -y
SKILL.md
Frontmatter
{
    "name": "unity-shadergraph-design",
    "description": "Source-anchored Shader Graph design rules for Unity 2022.3 — graph structure, node subset, SubGraph boundaries, master stack, blackboard\/keywords, recipes, and review. Use when building or reviewing Shader Graphs, structuring node chains or SubGraphs, laying out blackboard\/keywords, or following URP\/HDRP graph recipes, even if the user just says \"连个shader graph\" or \"着色器节点\". 为 Unity 2022.3 的 Shader Graph 提供源码锚定的设计规则(图结构、节点子集、SubGraph 边界、主节点堆栈、黑板\/关键字、配方、审查);当用户要构建或审查 Shader Graph、组织节点链或 SubGraph、布置黑板\/关键字、或参考 URP\/HDRP 图配方时使用。"
}

ShaderGraph - Design Rules

Advisory module. Read this before giving Shader Graph guidance. The goal is to keep recommendations anchored to actual package/source behavior, not stale model memory.

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

Source Scope

Validated against:

  • Unity 2022.3 package source: E:/CodeSpace/temp/shadergraph/com.unity.shadergraph@14.0.12
  • Unity 6 Graphics source: E:/CodeSpace/temp/Graphics/Packages/com.unity.shadergraph
  • Runtime/editor behavior in this repo's ShaderGraph skills and dual-version test environments

Core anchors:

  • Editor/Data/Graphs/GraphData.cs
  • Editor/Data/Nodes/AbstractMaterialNode.cs
  • Editor/Data/Interfaces/Graph/SlotReference.cs
  • Specific node files under Editor/Data/Nodes/...

When To Load

Load before:

  • Designing a new Graph or SubGraph architecture
  • Reviewing a proposed Shader Graph node chain
  • Advising on blackboard properties, keywords, samplers, or SubGraph boundaries
  • Suggesting changes to graphs through the constrained shadergraph_* node editing skills

What This Module Assumes

  • Graph editing is limited to the current safe node whitelist exposed by shadergraph_list_supported_nodes
  • Guidance must stay inside what Unity 2022.3 and Unity 6 both support
  • shadergraph_get_structure is the fact source for current node ids, slot ids, and live topology
  • The practical overlap is 28 nodes across both versions; AppendVectorNode is currently Unity 6 only in live validation

Sub-doc Routing

Sub-doc Read when
VERSIONS.md You need version differences or portability rules
NODES.md You need the supported node subset and editable fields
RECIPES.md You need patterns that the current skill subset can actually build
PITFALLS.md You are reviewing a graph or suspect bad advice / hidden costs
REVIEW.md You want a checklist for judging a Shader Graph plan

Hard Rules

  • Do not recommend nodes outside the current whitelist unless you clearly say the current skills cannot build them.
  • Do not talk about "editing by node name"; the implementation uses serialized nodeId and slotId.
  • Do not assume Unity 2022.3 has package graph templates. It commonly does not.
  • Do not tell the agent to mutate Master Stack, Target, Context, Block, or SubGraph output structure. Stage 2 does not support that.
  • For PropertyNode, create or verify the blackboard property first; the node binds a real property object, not just a string.
  • Prefer small SubGraphs when reuse or porting matters, but keep them within the currently supported node subset if you expect the skills to edit them later.

When in doubt, cite the relevant source path or ask the runtime graph for structure first.

为Unity UniTask提供源码级设计规则,涵盖结构体语义、PlayerLoop时机、取消令牌处理及异步组合等。适用于编写或审查UniTask代码、选择时机、处理CancellationToken及使用WhenAll/WhenAny时,确保零分配与正确性。
编写 async UniTask 代码 审查 UniTask 实现 选择 PlayerLoopTiming 处理 CancellationToken 组合 WhenAll/WhenAny 用户提及异步或零分配
SkillsForUnity/unity-skills~/skills/unitask-design/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-unitask-design -g -y
SKILL.md
Frontmatter
{
    "name": "unity-unitask-design",
    "description": "Source-anchored design rules for Cysharp UniTask 2.5.10 (Unity 2018.4+) — struct semantics, PlayerLoop timing, cancellation, composition, conversion, async enumerables, triggers, and pitfalls. Use when writing or reviewing async UniTask code, choosing PlayerLoopTiming, handling CancellationToken, or composing WhenAll\/WhenAny, even if the user just says \"异步\" or \"零分配async\". 为 Cysharp UniTask 2.5.10(Unity 2018.4+)提供源码锚定的设计规则(struct 语义、PlayerLoop 时机、取消、组合、转换、异步流、触发器、陷阱);当用户要编写或审查 async UniTask 代码、选择 PlayerLoopTiming、处理 CancellationToken、或组合 WhenAll\/WhenAny 时使用。"
}

UniTask - Design Rules

Advisory module. Every rule is distilled from Cysharp UniTask source at:

  • 2.5.10com.cysharp.unitask@2.5.10 (Unity 2018.4 baseline; actively used with 2022.3 / Unity 6)

Each rule cites a concrete file/line so the reasoning is auditable and the AI does not improvise against stale memory.

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

When to Load This Module

Load before writing or reviewing any of:

  • Any async UniTask / async UniTask<T> / async UniTaskVoid method signature
  • .Forget(), .AttachExternalCancellation(token), .SuppressCancellationThrow() chaining
  • UniTask.Yield, UniTask.NextFrame, UniTask.Delay, UniTask.WaitForEndOfFrame, UniTask.WaitForFixedUpdate
  • UniTask.WaitUntil, UniTask.WaitWhile, UniTask.WaitUntilValueChanged, UniTask.WaitUntilCanceled
  • UniTask.WhenAll, UniTask.WhenAny, UniTask.WhenEach
  • UniTask.SwitchToMainThread, UniTask.SwitchToThreadPool, UniTask.Run
  • AsyncOperation.ToUniTask(), UnityWebRequest.SendWebRequest().ToUniTask(), Coroutine.ToUniTask()
  • this.GetCancellationTokenOnDestroy(), GetAsyncStartTrigger() and other AsyncTrigger* extensions
  • UniTaskCompletionSource / UniTaskCompletionSource<T> manual completion sources
  • IUniTaskAsyncEnumerable<T> / UniTaskAsyncEnumerable / AsyncReactiveProperty<T> / Channel<T>
  • WebGL-specific async code paths where Task.Run / SwitchToThreadPool are forbidden

Critical Rule Summary

# Rule Source anchor
1 UniTask is a readonly partial struct (value type). Once awaited, its IUniTaskSource is recycled; awaiting the same UniTask variable twice throws. Use .Preserve() to obtain a memoized copy that can be awaited multiple times. UniTask.cs:34, UniTask.cs:103-113
2 A UniTask returned by a method must be either awaited, .Forget()ed, or .AttachExternalCancellation(token)ed. Orphan UniTasks silently swallow exceptions into UniTaskScheduler.UnobservedTaskException. UniTaskScheduler.cs:13, UniTaskVoid.cs:11-17
3 PlayerLoopTiming defines 16 timing slots (2020.2+; 14 on older Unity). Default UniTask.Yield() / UniTask.Delay uses PlayerLoopTiming.Update. Mixing LastPostLateUpdate with legacy WaitForEndOfFrame coroutines changes observed frame ordering. PlayerLoopHelper.cs:71-99
4 UniTask.Delay(int ms, DelayType, PlayerLoopTiming, CancellationToken, bool cancelImmediately) accepts DelayType.DeltaTime / UnscaledDeltaTime / Realtime. The old bool ignoreTimeScale overload still exists but mixes semantics — prefer the DelayType overload for new code. UniTask.Delay.cs:12-20, UniTask.Delay.cs:147-165
5 this.GetCancellationTokenOnDestroy() is defined for MonoBehaviour, GameObject, and Component in AsyncTriggerExtensions. Plain C# classes do NOT receive this extension — they must own a CancellationTokenSource explicitly. Triggers/AsyncTriggerExtensions.cs:14,22,28
6 UniTask.WhenAll(params UniTask[] tasks) and the IEnumerable<UniTask> overload both exist. Semantically match Task.WhenAll but are zero-alloc when tasks are UniTask-native. WhenAny returns (winnerIndex, result) tuple for UniTask<T>. UniTask.WhenAll.cs:12,22,31,41, UniTask.WhenAny.cs
7 AsyncOperation.ToUniTask(IProgress<float>, PlayerLoopTiming, CancellationToken) is the canonical adapter. await operation works too but silently leaks the progress callback if you also set operation.completed += …. UnityAsyncExtensions.cs
8 UniTaskCompletionSource and UniTaskCompletionSource<T> support TrySetResult / TrySetException / TrySetCanceled. Once any of the three succeeds, subsequent calls return false — they do not throw. UniTaskCompletionSource.cs:573,610,754,792
9 UniTask.SwitchToThreadPool() and UniTask.Run(...) are compile-time available on all platforms BUT throw NotSupportedException at runtime on WebGL. Guard with `#if !UNITY_WEBGL
10 Returning async UniTaskVoid is the fire-and-forget idiom that lets await be used INSIDE the method. async void methods cannot return UniTask — a common compile error when porting from Task. UniTaskVoid.cs:11-17, UniTask.Factory.cs:112-131

Sub-doc Routing

Sub-doc When to read
BASICS.md UniTask vs Task differences, struct semantics, UniTaskVoid, zero-alloc state machine, AsyncUniTaskMethodBuilder
PLAYERLOOP.md 16-value PlayerLoopTiming table, Yield/NextFrame/Delay/WaitForEndOfFrame/WaitForFixedUpdate, DelayType, frame-ordering with legacy coroutines
CANCELLATION.md CancellationToken patterns, GetCancellationTokenOnDestroy (3 overloads), AttachExternalCancellation, CancelAfterSlim, AddTo, OperationCanceledException flow
COMPOSITION.md WhenAll, WhenAny, WhenEach, Forget, SuppressCancellationThrow, ContinueWith, timeout patterns
CONVERSION.md AsyncOperation.ToUniTask, UnityWebRequest.SendWebRequest().ToUniTask, IEnumerator.ToUniTask, Task.AsUniTask, UniTask.AsTask, UniTask.ToCoroutine
ASYNCENUMERABLE.md IUniTaskAsyncEnumerable<T>, UniTaskAsyncEnumerable, AsyncReactiveProperty<T>, Channel<T>, EveryValueChanged, Publish, LINQ-to-async operators
TRIGGERS.md AsyncTriggerBase, GetAsyncStartTrigger, GetAsyncDestroyTrigger, OnCollisionEnterAsync, OnClickAsync, MonoBehaviourMessagesTriggers, lifecycle cancellation
PITFALLS.md 30 concrete hallucination / runtime pitfalls (double-await, forgotten Forget, WebGL threadpool, tracker memory, wrong PlayerLoopTiming, coroutine interop bugs)

Routing to Other Modules

  • Choice between UniTask, raw Task, and IEnumerator at the architecture layer → load async
  • DOTween tween → UniTask adapter (tween.ToUniTask(TweenCancelBehaviour, token)) → load dotween-design
  • YooAsset handle → UniTask via handle.ToUniTask() extension → load yooasset-design
  • Addressables AsyncOperationHandle.ToUniTask() rules → load addressables-design
  • Performance review of UniTask-heavy code paths (tracker cost, state machine alloc) → load performance
  • Asmdef layout for UniTask consumers (Cysharp.Threading.Tasks.asmdef reference) → load asmdef

Version Scope

Targets UniTask 2.5.10. Earlier 2.x versions are mostly source-compatible; key differences:

  • WaitForEndOfFrame(MonoBehaviour coroutineRunner) overload added in recent 2.x — on 2023.1+ a parameterless overload is available (#if UNITY_2023_1_OR_NEWER). See UniTask.Delay.cs:78-103.
  • UniTask.WhenEach is a newer addition; not all 2.x builds ship it.

When in doubt, read the cited source — not your memory.

Unity序列化YAML安全手编指南,作为REST API无法处理时的最后手段。涵盖编译失败、.meta文件修改、ProjectSettings隐藏字段及合并冲突场景。核心功能包括修复断裂的fileID引用、m_Script GUID错误及解决YAML合并冲突,确保资产引用正确。
场景文件打不开 引用丢了 脚本重命名或移动导致GUID失效 编译失败导致组件缺失 需要手动修复.meta文件或ProjectSettings YAML合并冲突
SkillsForUnity/unity-skills~/skills/yaml-editing/SKILL.md
npx skills add Besty0728/Unity-Skills --skill unity-yaml-editing -g -y
SKILL.md
Frontmatter
{
    "name": "unity-yaml-editing",
    "description": "Last-resort guidance for safely hand-editing Unity serialized YAML (.unity\/.prefab\/.asset\/.meta\/ProjectSettings) — reference\/fileID repair, GUID safety, and merge-conflict fixes. Use when REST cannot reach the change and YAML must be hand-edited — fixing m_Script GUIDs, broken fileID references, .meta files, or merge conflicts, even if the user just says \"场景文件打不开\" or \"引用丢了\". 安全手编 Unity 序列化 YAML(.unity\/.prefab\/.asset\/.meta\/ProjectSettings)的最后手段(引用\/fileID 修复、GUID 安全、合并冲突修复);当 REST 无法触达、必须手编 YAML 时使用——修复 m_Script GUID、断裂 fileID 引用、.meta 文件或合并冲突。"
}

YAML Editing - Safe Hand-Edit Rules

Advisory module. This is operational guidance for directly editing Unity serialized YAML text when the REST skills (and the Editor itself) cannot do the job. Hand-editing YAML is the last resort, not a shortcut.

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

When To Load / When NOT

Prefer REST first. For normal object/asset work, use the REST skills — they keep serialization valid for you:

  • GameObjects / components → gameobject_*
  • Prefabs → prefab_*
  • ScriptableObjects → scriptableobject_*
  • Scenes → scene_*
  • Importers → importer_*
  • Graphics / rendering → graphics_*

Only hand-edit YAML when REST cannot reach, i.e. one of:

  1. Compile failure — a script fails to compile, so the Editor cannot deserialize the component. Editor/REST APIs are unavailable; the only level left is the YAML text.
  2. .meta files — no REST skill touches .meta; GUID and importer fields live only in text.
  3. Hidden ProjectSettings fields — many ProjectSettings/*.asset fields have no public API or REST surface.
  4. Merge conflicts — REST runs sequentially and cannot perform a 3-way merge of .unity / .prefab.

If none of these apply, stop and use REST. Do not hand-edit YAML for convenience.

Core Concepts

  • Object block / anchor: every serialized object is a block headed by --- !u!<classID> &<fileID>. <classID> is the Unity type id (e.g. 1 = GameObject, 4 = Transform, 114 = MonoBehaviour). <fileID> is the object's anchor, unique within this file.
  • GUID vs fileID:
    • GUID = asset-level identity, a 32-char hex string, stored in the asset's .meta. Identifies the whole asset (a script, prefab, texture, ...).
    • fileID = sub-object identity inside a file (a specific component, the specific MonoBehaviour script class, ...).
  • Serialized reference: a cross-object/asset reference is {fileID: N, guid: H, type: T}. guid is omitted for same-file references ({fileID: N}).
  • m_Script: a MonoBehaviour points at its script via m_Script: {fileID: 11500000, guid: <scriptGUID>, type: 3}. fileID: 11500000 is the conventional MonoScript fileID; guid is the .cs file's GUID from its .meta; type: 3 means the reference targets an asset on disk. A wrong guid/fileID here is exactly what produces a "missing script / missing component".

Coverage Scenarios

1. Reference / fileID repair

When: a script was renamed or moved, so a prefab/scene m_Script guid/fileID no longer resolves; or a compile failure left a component as Missing and you must locate, delete, or re-point it at the YAML level (the Editor cannot deserialize a broken component, so REST/Editor API is unavailable).

How: read the script's current GUID from its .cs.meta. In the prefab/scene, find the offending m_Script: {fileID: 11500000, guid: ..., type: 3} and set guid to the correct value (keep fileID: 11500000, type: 3). To delete a Missing component, remove its whole --- !u!114 &<fileID> block and the matching {component: {fileID: <fileID>}} entry under the owner GameObject's m_Component list — leaving one without the other corrupts the file.

Danger: deleting the object block but not its m_Component reference (or vice versa) breaks the GameObject; changing a fileID that other objects reference orphans those references.

2. .meta / GUID safety

When: a .meta GUID looks like a pseudo-random GUID and risks third-party collision, or you must edit an importer field that REST does not expose.

How: for pseudo-GUID detection and the uuid4 repair flow, reuse /metacheck — it documents 5 pseudo-GUID heuristics (consecutive hex runs, interleaved increment, repeated chars, literal abcdef, wrong length), the uuid4 regeneration step, and the ValidationSkills.cs.meta collision lesson. Do not re-derive that here. Generate replacement GUIDs with python -c "import uuid; print(uuid.uuid4().hex)", never by hand.

Danger: changing a GUID without updating every reference. Before changing any GUID, grep the whole project for that GUID (.asset / .prefab / .unity / .meta) and update every reference point in the same change. Run /metacheck for a full GUID health audit before/after.

3. ProjectSettings patch

When: you need a ProjectSettings/*.asset field (YAML) that REST does not expose — e.g. a specific physics layer / collision matrix entry, or a hidden QualitySettings value.

How: git-back up (or confirm a clean tree) first, locate the exact field by key, change only its value, then let Unity reload and re-serialize to validate. Confirm the change round-trips (Unity rewriting the file the same way) rather than reverting or reformatting it.

Danger: editing collision-matrix or enum-backed fields by guessing the encoding can silently break settings; always verify Unity accepts the value on reload.

4. Merge conflict assistance

When: a .unity / .prefab has Git conflict markers and you must resolve them.

How: Unity YAML is line-mergeable because each object is an independent --- !u!<classID> &<fileID> block. Resolve per-block: for a block changed on only one side, take that side; for the same block changed on both sides, do a true 3-way merge of the conflicting fields. After resolving, ensure every fileID/guid referenced still has a defining block.

Danger: blindly accepting one side (--theirs/--ours) drops objects added on the other side or leaves dangling references. Never resolve by deleting whole conflict regions without checking the fileID references inside them.

Hard Rules

  • Back up first: confirm a clean git tree (or commit/stash) before any YAML edit, so you can diff and revert.
  • Don't touch structure unless repairing references: change values only; do not renumber or reorder anchor/fileID unless the explicit task is reference repair.
  • Re-import to validate: after editing, trigger a Unity reimport/reload and confirm no new errors and the file round-trips.
  • GUIDs are uuid4, never hand-written: python -c "import uuid; print(uuid.uuid4().hex)".
  • Dry-run before bulk edits: grep the impact set first; know exactly how many references a change touches before making it.
  • Change a GUID → change every reference: a GUID edit is not done until all referencing files are updated in the same change.

Routing

  • If a REST skill can do it, use REST — gameobject_* / prefab_* / scriptableobject_* / scene_* / importer_* / graphics_* — and do not hand-edit.
  • GUID health audit / pseudo-GUID detection / uuid4 repair → /metacheck.
  • After editing skill docs or for doc/code consistency → /skillcheck.

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