gamedev-unity/skills/unity-skills/skills/perception/SKILL.md
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 编码提供上下文(分析场景结构、探测项目技术栈、健康检查、定位热点);当用户要在编辑前收集上下文、理解陌生场景或项目、或在不改动的前提下审查结构时使用。
npx skillsauth add bernatmv/ai-rules unity-perceptionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this module for read-only scene and project analysis.
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 模式可直接执行。IsForbiddenInSemi 拦截。DO NOT (common hallucinations):
perception_analyze, perception_scan, and perception_describe do not existscene_context is not editor_get_context: it exports hierarchy/components/references, while editor context focuses on current editor statescene_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:
editor_get_contextscene_find_objects or gameobject_findscript_dependency_graph| 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 |
| 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? |
| 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? |
| 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? |
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" |
scene_summarizeReturns sceneName, stats, and optional topComponents.
scene_analyzeReturns summary, stats, findings, warnings, recommendations, and suggestedNextSkills.
scene_health_checkReturns summary, findings, hotspots, and suggestedNextSkills.
scene_contextReturns 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 subtreeincludeValues=true when serialized field values matterincludeCodeDeps=true when AI needs a rough scene-to-code dependency picturescene_export_reportWrites 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 = 10maxObjects = 500| 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 |
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 names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file.
development
Keyword research and validation with real search-demand data — never ship keywords from intuition alone. Probes Google Autocomplete per language (free, no account) to prove demand and discover the exact phrasing people type, checks SERPs for winnability, and uses Keyword Planner/Ahrefs/Semrush exports when the user has access. Activates when: choosing or reviewing SEO keywords, meta keywords, page titles, article topics or slugs, landing page copy targeting search, App Store/ASO keyword fields, multilingual keyword sets, 'what should we rank for', 'keyword analysis', or auditing why a page doesn't rank. Also invoke it as a validation pass whenever another skill or task produces a keyword list.
development
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、或校验热更资源时使用。
development
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、用句柄加载资源、配置热更/下载、或选择运行模式时使用。
data-ai
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 文件或合并冲突。