addressables-design
Source-anchored design rules for Unity Addressables 1.22.3/2.9.1
Manage Prefabs and variants
$ npx -y skills add Besty0728/Unity-Skills --skill prefab --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/prefabContext preview
The summary Claude sees to decide when to auto-load this skill.
Manage Prefabs and variants
name: unity-prefab description: Manage Prefabs and variants
> **Before 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 `GET /skills/recommend?includeSchema=true`) first. If you already have the parameter definitions from recommend/schema, you may proceed straight to dryRun.
> **BATCH-FIRST**: Use `prefab_instantiate_batch` when spawning 2+ prefab instances.
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):
**Routing**:
| Single Object | Batch Version | Use Batch When | |---------------|---------------|----------------| | `prefab_instantiate` | `prefab_instantiate_batch` | Spawning 2+ instances |
**No batch needed**:
---
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, name}`
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}`
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, entityId, instanceId, 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"}
])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, appliedTo}` (`appliedTo` is the prefab asset path)
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, unpacked}` (`unpacked` is the instance's GameObject name)
Get a summary of property overrides on a prefab instance (counts, not the individual override list).
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `name` | string | No* | Prefab instance name | | `instanceId` | int | No* | Instance ID |
**Returns**
REST API-based AI-driven Unity Editor Automation Engine Let AI control Unity scenes directly through Skills 🎉 We are now indexed by DeepWiki! Got questions? Check out the AI-generated docs → The current official maintenance baseline is Unity 2022.3+.
Source-anchored design rules for Unity Addressables 1.22.3/2.9.1
Manage Addressables groups, entries, profiles and content builds (com.unity.addressables, reflection-based)