unity-prefab

Create, instantiate, and manage Unity prefabs and prefab variants in scenes.

Updated Aug 31, 2026
One-click install
npx skills add https://github.com/pikachu0310/codex-agent-ops-public --skill unity-prefab-pikachu0310
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-prefab
Source: https://github.com/pikachu0310/codex-agent-ops-public/tree/main/.agents/skills/unity-skills/skills/prefab
Command: npx skills add https://github.com/pikachu0310/codex-agent-ops-public --skill unity-prefab-pikachu0310

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing Unity prefabs manually through the editor is slow and error-prone, especially when spawning many instances, applying instance overrides back to source assets, or tracking down every instance of a prefab in a scene. This Skill exposes prefab operations as callable skills so an AI agent can perform them programmatically. ## Core Features & Use Cases - Prefab lifecycle management: Create prefabs from scene objects, instantiate single or batched instances, unpack instances, and create prefab variants. - Override control: Inspect, apply, or revert property overrides between prefab instances and their source assets, including direct property edits on prefab asset files via prefab_set_property. - Batch instantiation: Spawn many prefab instances in a single prefab_instantiate_batch call instead of one API call per object. - Use Case: When procedurally populating a level, call prefab_instantiate_batch with an array of positions to spawn dozens of enemies in one request, then use prefab_find_instances to verify placement. ## Quick Start Ask the agent to instantiate three enemy prefabs at spaced positions in the current Unity scene using the batch instantiation skill.

Frequently Asked Questions about unity-prefab

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I instantiate multiple prefabs in Unity at once?

Use prefab_instantiate_batch with an items array containing prefabPath, name, position, rotation, scale, and parent for each instance. It returns per-item success results in a single call, avoiding one API request per spawned object.

How to apply prefab instance changes back to the prefab asset in Unity?

Call prefab_apply with the instance name, instanceId, or path to write instance changes back to the source prefab asset. To apply only accumulated overrides, use prefab_apply_overrides; to discard them, use prefab_revert_overrides.

Can I edit a prefab asset without instantiating it in Unity?

Yes, prefab_set_property modifies a serialized property on a component inside the prefab asset file directly. It supports basic types, vectors, colors, enums, and asset references via assetReferencePath, and can target child objects with gameObjectName.

How do I find all instances of a prefab in a Unity scene?

Use prefab_find_instances with the prefab asset path. It returns up to a configurable limit (default 50) of instances with their names, hierarchy paths, entityIds, and instanceIds.

Why does prefab_set_property return SEMANTIC_INVALID?

SEMANTIC_INVALID means the target is not a prefab instance, the property is not an Object reference field, or the value string could not be parsed for that serialized type. For unsupported serialized types, switch to assetReferencePath instead of reformatting the value.