unity-perception
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBefore calling any skill in this module: if you are about to call a skill with parameters guessed from its name or description, STOP — read this file (or fetch its schema via) first. If you already have the parameter definitions from recommend/schema, you may proceed straight to dryRun.GET /skills/recommend?includeSchema=true
**调用本模块中的任何技能之前:**如果您打算仅凭技能名称或描述猜测参数来调用技能,请停止——先阅读本文档(或通过获取其 schema)。如果您已经从推荐/schema中获取了参数定义,可以直接执行dryRun。GET /skills/recommend?includeSchema=true
Triggers
触发场景
- Gathering context before editing
- Understanding unfamiliar scene/project
- Auditing structure without changes
- 编辑前收集上下文、理解陌生场景或项目、在不改动的前提下审查结构
- 编辑前收集上下文
- 理解陌生场景/项目
- 在不改动的前提下审查结构
- 编辑前收集上下文、理解陌生场景或项目、在不改动的前提下审查结构
Unity Perception Skills
Unity Perception Skills
Use this module for read-only scene and project analysis.
使用本模块进行只读场景和项目分析。
Operating Mode
运行模式
- Approval / Auto / Bypass: 本模块 18 个 skill 里有 17 个标 ,三档模式下直接执行无需 grant。其中 16 个是纯读(
Mode = SkillMode.SemiAuto):ReadOnly = true/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_spatial_query/scene_materials/scene_contract_validate/project_stack_detect/script_analyze。script_dependency_graph - 是第 17 个 SemiAuto,但它不是纯读:传
scene_dependency_analyze会savePath+Directory.CreateDirectory+File.WriteAllText落一个新工程资产,所以它标ImportAsset而不再标MutatesAssets = true。仍然无需 grant,但它会进 router 的 diff 捕获,schema/flags 里也会带ReadOnly—— 不传mutatesAssets时才真的什么都不写。savePath - 特别说明:写 markdown 文件到磁盘(
scene_export_report,标Operation = Analyze | Execute),因此不是 SemiAuto——它走默认MutatesAssets = true,Approval 模式下需要 grant 才能执行。SkillMode.FullAuto - 本模块不含 Delete / PlayMode / Reload / RiskLevel=high 类 skill —— 没有 拦截。
IsForbiddenInSemi
DO NOT (common hallucinations):
- ,
perception_analyze, andperception_scando not existperception_describe - is not
scene_context: it exports hierarchy/components/references, while editor context focuses on current editor stateeditor_get_context - ,
scene_analyze,scene_health_check,scene_contract_validate,scene_component_stats, andscene_find_hotspotsbelong to this module even if the prefix looks likeproject_stack_detectorscene_*project_*
Routing:
- Current selection/play-mode/editor state ->
editor_get_context - Object search by name/path -> or
scene_find_objectsgameobject_find - Script dependency closure ->
script_dependency_graph
- 审批/自动/绕过:本模块的18个skill中有17个标记为,在三档模式下直接执行无需授权(grant)。其中16个为纯读(
Mode = SkillMode.SemiAuto):ReadOnly = true/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_spatial_query/scene_materials/scene_contract_validate/project_stack_detect/script_analyze。script_dependency_graph - 是第17个SemiAuto,但它不是纯读:传入
scene_dependency_analyze会执行savePath+Directory.CreateDirectory+File.WriteAllText来生成一个新的工程资产,因此它标记为ImportAsset,不再标记MutatesAssets = true。仍然无需授权,但它会被路由的diff捕获,schema/flags中也会带有ReadOnly——只有不传mutatesAssets时才真正不会写入任何内容。savePath - 特别说明:会将markdown文件写入磁盘(
scene_export_report,标记为Operation = Analyze | Execute),因此不属于SemiAuto——它使用默认的MutatesAssets = true,在审批模式下需要授权(grant)才能执行。SkillMode.FullAuto - 本模块不含Delete / PlayMode / Reload / RiskLevel=high类skill——没有拦截。
IsForbiddenInSemi
请勿(常见幻觉):
- ,
perception_analyze, 和perception_scan不存在perception_describe - 不是
scene_context:它导出层级结构/组件/引用,而编辑器上下文专注于当前编辑器状态editor_get_context - 即使前缀看起来是或
scene_*,project_*,scene_analyze,scene_health_check,scene_contract_validate,scene_component_stats, 和scene_find_hotspots仍属于本模块project_stack_detect
路由规则:
- 当前选择/播放模式/编辑器状态 ->
editor_get_context - 按名称/路径搜索对象 -> 或
scene_find_objectsgameobject_find - 脚本依赖闭包 ->
script_dependency_graph
Skills
技能列表
Scene Health and Summary
场景健康与概述
| Skill | Use | Key parameters |
|---|---|---|
| Combined scene + project analysis | |
| Read-only health report | |
| Structured scene summary | |
| Component and facility stats | |
| Deep hierarchy / large group / empty node hotspots | thresholds + |
| Tag/layer usage | none |
| Prioritized optimization hints | none |
| Skill | 用途 | 关键参数 |
|---|---|---|
| 场景+项目组合分析 | |
| 只读健康报告 | |
| 结构化场景概述 | |
| 组件与设施统计 | |
| 深层层级/大型组/空节点热点检测 | 阈值 + |
| 标签/层使用情况统计 | 无 |
| 优先级优化建议 | 无 |
Scene Snapshots and Exports
场景快照与导出
| Skill | Use | Key parameters |
|---|---|---|
| Capture or compare lightweight snapshots | |
| Return text hierarchy tree | |
| Export hierarchy, components, references | |
| Save markdown scene report | |
| Analyze impact / dependency graph in-scene | |
onsavePathis a write, not an output option. Supplying it creates the directory, writes the markdown report and imports it as a project asset, which is why the skill is flaggedscene_dependency_analyzerather thanmutatesAssets. OmitReadOnlyand you get the same analysis in the response (savePath,analysis) with nothing touched on disk — that is the form to use for a pure "what depends on this" question. Only passmarkdownwhen the user actually asked for a file, and expectsavePathin the response naming it.savedTo
| Skill | 用途 | 关键参数 |
|---|---|---|
| 捕获或对比轻量级快照 | |
| 返回文本层级树 | |
| 导出层级结构、组件、引用 | |
| 保存markdown场景报告 | |
| 分析场景内的影响/依赖图 | |
**的scene_dependency_analyze是写入操作,而非输出选项。**提供该参数会创建目录、写入markdown报告并将其导入为项目资产,这也是该技能标记为savePath而非mutatesAssets的原因。省略ReadOnly时,您会在响应中得到相同的分析结果(savePath,analysis),且不会改动磁盘上的任何内容——这是用于纯粹的“哪些对象依赖于此”问题的形式。仅当用户明确要求生成文件时才传入markdown,响应中会返回savePath字段指明文件路径。savedTo
Project and Script Analysis
项目与脚本分析
| Skill | Use | Key parameters |
|---|---|---|
| Detect pipeline, input, UI, packages, tests, folders | none |
| Analyze one MonoBehaviour / ScriptableObject / user class by class name | |
| N-hop dependency closure for one script class name | |
| Skill | 用途 | 关键参数 |
|---|---|---|
| 检测管线、输入、UI、包、测试、文件夹 | 无 |
| 按类名分析单个MonoBehaviour / ScriptableObject / 用户类 | |
| 单个脚本类的N跳依赖闭包 | |
Spatial and Material Queries
空间与材质查询
| Skill | Use | Key parameters |
|---|---|---|
| Find objects near a point or object | |
| Summarize scene materials and shaders | |
| Validate default roots/tags/layers/UI EventSystem conventions | |
| Skill | 用途 | 关键参数 |
|---|---|---|
| 查找点或对象附近的对象 | |
| 汇总场景材质与着色器 | |
| 验证默认根节点/标签/层/UI EventSystem约定 | |
High-Frequency Skill Differences
高频技能差异
scene_summarize
vs scene_analyze
vs scene_health_check
scene_summarizescene_analyzescene_health_checkscene_summarize
对比 scene_analyze
对比 scene_health_check
scene_summarizescene_analyzescene_health_check| Skill | Best for | Typical output focus |
|---|---|---|
| Fast overview | object counts, hierarchy depth, top components |
| Broad diagnosis | summary + findings + warnings + recommendations + next-skill hints |
| Hygiene / red flags | missing scripts, duplicate names, deep hierarchy, empty nodes, hotspot-style findings |
| Skill | 适用场景 | 典型输出重点 |
|---|---|---|
| 快速概览 | 对象数量、层级深度、主要组件 |
| 全面诊断 | 概述+发现+警告+建议+后续技能提示 |
| 健康检查/风险标记 | 缺失脚本、重复名称、深层层级、空节点、热点类发现 |
scene_context
vs hierarchy_describe
scene_contexthierarchy_describescene_context
对比 hierarchy_describe
scene_contexthierarchy_describe| Skill | Best for | Output style |
|---|---|---|
| Human-readable tree | text tree, lightweight |
| AI coding context | structured hierarchy + components + references + optional code dependencies |
| Skill | 适用场景 | 输出风格 |
|---|---|---|
| 人类可读的层级树 | 文本树,轻量级 |
| AI编码上下文 | 结构化层级+组件+引用+可选代码依赖 |
scene_dependency_analyze
vs script_dependency_graph
scene_dependency_analyzescript_dependency_graphscene_dependency_analyze
对比 script_dependency_graph
scene_dependency_analyzescript_dependency_graph| Skill | Scope | Use when |
|---|---|---|
| Scene object references | ask "who depends on this object if I delete or disable it" |
| Script class dependency closure | ask "which scripts do I have to touch to change this feature" |
| Skill | 范围 | 适用场景 |
|---|---|---|
| 场景对象引用 | 询问“如果我删除或禁用此对象,哪些对象会受影响” |
| 脚本类依赖闭包 | 询问“要更改此功能,我需要修改哪些脚本” |
Key Return Shapes
关键返回结构
scene_summarize
scene_summarizescene_summarize
scene_summarizeReturns , , and optional .
sceneNamestatstopComponents返回, , 和可选的。
sceneNamestatstopComponentsscene_analyze
scene_analyzescene_analyze
scene_analyzeReturns , , , , , and .
summarystatsfindingswarningsrecommendationssuggestedNextSkills返回, , , , , 和 。
summarystatsfindingswarningsrecommendationssuggestedNextSkillsscene_health_check
scene_health_checkscene_health_check
scene_health_checkReturns , , , and .
summaryfindingshotspotssuggestedNextSkills返回, , , 和 。
summaryfindingshotspotssuggestedNextSkillsscene_context
scene_contextscene_context
scene_contextReturns a structured export with , , and optional . Use it when another AI step needs full scene context, not just a human summary.
objectsreferencescodeDependenciesHigh-frequency options:
- to export only one subtree
rootPath - when serialized field values matter
includeValues=true - when AI needs a rough scene-to-code dependency picture
includeCodeDeps=true
返回包含, , 和可选的结构化导出。当其他AI步骤需要完整场景上下文而非仅人类可读的摘要时使用此技能。
objectsreferencescodeDependencies高频选项:
- :仅导出单个子树
rootPath - :当序列化字段值很重要时使用
includeValues=true - :当AI需要了解场景到代码的大致依赖关系时使用
includeCodeDeps=true
scene_export_report
scene_export_reportscene_export_report
scene_export_reportWrites a markdown artifact to disk and returns , object/script/reference counts, and success state. Prefer this when the user wants a durable report file.
savedToDefaults:
savePath = "Assets/Docs/SceneReport.md"maxDepth = 10maxObjects = 500
将markdown工件写入磁盘,并返回, 对象/脚本/引用数量以及成功状态。当用户需要持久化的报告文件时优先使用此技能。
savedTo默认值:
savePath = "Assets/Docs/SceneReport.md"maxDepth = 10maxObjects = 500
When to Use Which Skill
技能选择指南
| Need | Best first skill |
|---|---|
| Quick scene overview | |
| Full diagnosis | |
| Suspicious hierarchy or clutter | |
| Safe-to-delete / impact question | |
| AI coding context export | |
| Script reading order | |
| Render/input/UI stack detection | |
| 需求 | 首选技能 |
|---|---|
| 快速场景概览 | |
| 全面诊断 | |
| 可疑层级或杂乱结构 | |
| 安全删除/影响评估问题 | |
| AI编码上下文导出 | |
| 脚本读取顺序 | |
| 渲染/输入/UI栈检测 | |
Minimal Example
最简示例
python
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")python
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 or , not by this file.
GET /skills/schemaunity_skills.get_skill_schema()精确的名称、参数、默认值和返回结果由或定义,而非本文档。
GET /skills/schemaunity_skills.get_skill_schema()