gamedev-unity/skills/unity-skills/skills/smart/SKILL.md
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 与空间对象查询、自动布局、自动绑定);当用户要按条件或邻近关系查询场景对象、自动排布对象、或自动连线引用时使用。
npx skillsauth add bernatmv/ai-rules unity-smartInstall 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.
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 单次执行返结果。smart_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 toolssmart_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_groundRouting:
gameobject modulegameobject_find or scene_find_objectssmart_scene_query (this module)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")
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)
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_spatialFind 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_groundRaycast 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_distributeEvenly 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_gridSnap selected objects to a grid.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| gridSize | float | No | 1 | Grid cell size |
Returns: { success, snapped, gridSize }
smart_randomize_transformRandomize 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_objectsReplace 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_componentSelect 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 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 文件或合并冲突。