gamedev-unity/skills/unity-skills/skills/validation/SKILL.md
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 "有没有丢失". 校验项目与场景健康度并清理(查找断裂引用、丢失脚本及其他完整性问题);当用户要检查断裂或丢失引用、校验场景/项目完整性、或在构建前清理问题时使用。
npx skillsauth add bernatmv/ai-rules unity-validationInstall 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.
Maintain project health - find problems, clean up, and validate your Unity project.
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_folders 标 Analyze | Delete、validate_fix_missing_scripts 标 Execute | Delete,默认 SkillMode.FullAuto)需用户 grant。validate_cleanup_empty_folders / validate_fix_missing_scripts 一旦 dryRun=false 即真删;它们在 Approval / Auto 下被 IsForbiddenInSemi 自动拦截,仅 Bypass 或 Allowlist 命中可执行。强烈建议先用 dryRun=true 预览。DO NOT (common hallucinations):
validate_* prefix, not validation_*validation_run / validation_check do not exist → use specific skills such as validate_scene, validate_project_structure, validate_missing_referencesvalidation_fix does not exist → validation skills report issues; use other modules to fix themvalidation_clean does not exist → use cleaner module for cleanup operationsRouting:
cleaner modulecleaner_fix_missing_scripts (cleaner module)debug_check_compilation (debug module)| 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 |
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}]}
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")
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}]}
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 }
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 }
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}]}
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_referencesFind 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_convexFind 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_errorsFind shaders with compilation errors.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| limit | int | No | 50 | Max results |
Returns: { success, count, shaders: [{ name, path, errorCount }] }
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")
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}")
dryRun=True first to preview changesExact 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 文件或合并冲突。