Unity Prefab logo

Unity Prefab

CommunityPopular
Besty0728
unity-prefab

Manage Prefabs and variants

Overview

PublisherBesty0728
RepositoryUnity-Skills
Skill nameunity-prefab
Stars
1.8K
Forks
164
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by Besty0728 on GitHub. Read the source before you install it.

Installation

Install the Unity Prefab AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.

Use it in TypingMind

Enable Unity Prefab in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Unity Prefab on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Unity Prefab is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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.

Triggers

  • Creating or editing prefabs
  • Instantiating or applying prefab changes
  • Finding instances in scenes
  • Creating prefab variants
  • 创建或编辑预制体、实例化或应用预制体改动、在场景中查找实例、创建预制体变体

Unity Prefab Skills

BATCH-FIRST: Use prefab_instantiate_batch when spawning 2+ prefab instances.

Operating Mode

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):

  • prefab_create_from_object does not exist → use prefab_create (takes scene object name/instanceId and savePath)
  • prefab_spawn does not exist → use prefab_instantiate
  • prefab_edit / prefab_modify do not exist → use prefab_set_property (edit prefab asset directly) or instantiate, modify, then prefab_apply
  • prefab_save does not exist → use prefab_apply (applies instance changes to source prefab)

Routing:

  • To modify components on a prefab instance in scene → use component module skills, then prefab_apply
  • To set a property directly on the prefab asset → prefab_set_property (this module)
  • To find all instances of a prefab → prefab_find_instances (this module)

Skills Overview

Single ObjectBatch VersionUse Batch When
prefab_instantiateprefab_instantiate_batchSpawning 2+ instances

No batch needed:

  • prefab_create - Create prefab from scene object
  • prefab_apply - Apply instance changes to prefab
  • prefab_unpack - Unpack prefab instance
  • prefab_get_overrides - Get instance overrides
  • prefab_revert_overrides - Revert to prefab values
  • prefab_apply_overrides - Apply overrides to prefab
  • prefab_create_variant - Create a prefab variant
  • prefab_find_instances - Find all instances of a prefab in scene
  • prefab_set_property - Set a property on a component inside a Prefab asset (supports basic types, vectors, colors, and asset references)

Skills

prefab_create

Create a prefab from a scene GameObject.

ParameterTypeRequiredDescription
namestringNo*Source object name
instanceIdintNo*Instance ID (preferred)
pathstringNo*Object path
savePathstringYesPrefab save path

*At least one source identifier required.

Returns: {success, prefabPath, name}

prefab_instantiate

Instantiate a prefab into the scene.

ParameterTypeRequiredDefaultDescription
prefabPathstringYes-Prefab asset path
namestringNoprefab nameInstance name
x, y, zfloatNo0Local position (relative to parent if set)
parentEntityIdstringNonullParent entity ID (Unity 6000.4+, preferred)
parentNamestringNonullParent object name
parentInstanceIdintNo0Parent instance ID
parentPathstringNonullParent hierarchy path

Returns: {success, name, entityId, instanceId, path}

prefab_instantiate_batch

Instantiate multiple prefabs in one call.

ParameterTypeRequiredDescription
itemsarrayYesArray 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}]}

python
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"}
])

prefab_apply

Apply instance changes back to the prefab asset.

ParameterTypeRequiredDescription
namestringNo*Prefab instance name
instanceIdintNo*Instance ID (preferred)
pathstringNo*Object path

*At least one identifier required.

Returns: {success, appliedTo} (appliedTo is the prefab asset path)

prefab_unpack

Unpack a prefab instance (break prefab connection).

ParameterTypeRequiredDefaultDescription
namestringNo*-Prefab instance name
instanceIdintNo*-Instance ID (preferred)
pathstringNo*-Object path
completelyboolNofalseUnpack all nested prefabs

*At least one identifier required.

Returns: {success, unpacked} (unpacked is the instance's GameObject name)

prefab_get_overrides

Get a summary of property overrides on a prefab instance (counts, not the individual override list).

ParameterTypeRequiredDescription
namestringNo*Prefab instance name
instanceIdintNo*Instance ID

Returns: {success, prefabPath, propertyOverrides, addedComponents, removedComponents, addedGameObjects, hasOverrides}propertyOverrides/addedComponents/removedComponents/addedGameObjects are counts (int), not arrays; hasOverrides is true when any of those counts is non-zero.

prefab_revert_overrides

Revert all overrides on a prefab instance back to prefab values.

ParameterTypeRequiredDescription
namestringNo*Prefab instance name
instanceIdintNo*Instance ID

Returns: {success, reverted} (reverted is the prefab root's GameObject name)

prefab_apply_overrides

Apply all overrides from instance to source prefab asset.

ParameterTypeRequiredDescription
namestringNo*Prefab instance name
instanceIdintNo*Instance ID

Returns: {success, appliedTo} (appliedTo is the prefab asset path)

prefab_create_variant

Create a prefab variant from an existing prefab.

ParameterTypeRequiredDefaultDescription
sourcePrefabPathstringYes-Path to the source prefab asset
variantPathstringYes-Save path for the new variant

Returns: { success, sourcePath, variantPath, name }

prefab_find_instances

Find all instances of a prefab in the current scene.

ParameterTypeRequiredDefaultDescription
prefabPathstringYes-Prefab asset path to search for
limitintNo50Maximum number of instances to return

Returns: { success, prefabPath, count, instances: [{ name, path, entityId, instanceId }] }

prefab_set_property

Set a property on a component inside a Prefab asset file (without instantiating it). Supports basic types, vectors, colors, enums, and asset references.

ParameterTypeRequiredDefaultDescription
prefabPathstringYes-Path to the prefab asset
componentTypestringYes-Component type name
propertyNamestringYes-Serialized property name
valuestringCond.nullValue for basic types (int/float/bool/string/enum/vector/color/quaternion)
assetReferencePathstringCond.nullAsset path for Object reference fields (Material, Texture, AudioClip, ScriptableObject, etc.)
gameObjectNamestringNonullChild object name inside prefab (defaults to root)

Provide either value (basic types) or assetReferencePath (asset references).

value covers Integer, Float, Boolean, String, Enum, Color, Vector2/3/4, Vector2Int/3Int, Quaternion, Rect, Bounds and LayerMask. A quaternion (localRotation) accepts 3 components as euler degrees ("0,90,0") or 4 as raw x,y,z,w. Any other serialized type answers SEMANTIC_INVALID naming the type — that is the signal to use assetReferencePath, not to reformat value.

Returns: { success, prefabPath, gameObject, component, property, valueSet }

python
# Set a float property on prefab root
unity_skills.call_skill("prefab_set_property",
    prefabPath="Assets/Prefabs/Enemy.prefab",
    componentType="EnemyStats",
    propertyName="maxHealth",
    value="100"
)

# Assign an asset reference to a prefab component
unity_skills.call_skill("prefab_set_property",
    prefabPath="Assets/Prefabs/Enemy.prefab",
    componentType="AudioSource",
    propertyName="m_audioClip",
    assetReferencePath="Assets/Audio/hit.wav"
)

# Edit a child object inside a prefab
unity_skills.call_skill("prefab_set_property",
    prefabPath="Assets/Prefabs/Player.prefab",
    componentType="MeshRenderer",
    propertyName="m_Materials.Array.data[0]",
    assetReferencePath="Assets/Materials/PlayerSkin.mat",
    gameObjectName="Body"
)

Example: Efficient Enemy Spawning

python
import unity_skills

# BAD: 10 API calls for 10 enemies
for i in range(10):
    unity_skills.call_skill("prefab_instantiate",
        prefabPath="Assets/Prefabs/Enemy.prefab",
        name=f"Enemy_{i}",
        x=i * 2
    )

# GOOD: 1 API call for 10 enemies
unity_skills.call_skill("prefab_instantiate_batch", items=[
    {"prefabPath": "Assets/Prefabs/Enemy.prefab", "name": f"Enemy_{i}", "x": i * 2}
    for i in range(10)
])

Best Practices

  1. Organize prefabs in dedicated folders
  2. Use prefabs for repeated objects
  3. Apply changes to update all instances
  4. Unpack only when unique modifications needed
  5. Use batch instantiation for level generation

Exact Signatures

Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file.

Common Errors

Full transport-level codes (COMPILING/RATE_LIMIT etc.) → ../../references/protocol-error-codes.md

ErrorTriggerFix
TARGET_NOT_FOUNDThe prefab asset, source prefab, child GameObject inside a prefab, component, or asset reference could not be found.Confirm the prefab path with asset_find / prefab_find_instances, check child/component names, and retry with exact identifiers.
MISSING_PARAMA required parameter is missing, such as savePath, prefabPath, sourcePrefabPath, componentType, or propertyName.Provide the missing parameter; use mode=dryRun to inspect the full schema.
SEMANTIC_INVALIDThe target is not a prefab instance, the property is not an Object reference field, or a serialized value could not be parsed.Ensure the object is a prefab instance (prefab_get_overrides can verify), match the property type, and retry with a valid value.
SKILL_ERRORA low-level operation failed, such as Failed to instantiate prefab or Failed to set value ... (type: ...).Resolve the underlying cause named in the message (e.g., prefab corruption, type mismatch) and retry.

Frequently asked questions

What does the Unity Prefab AI skill do?

Manage Prefabs and variants

Why use Unity Prefab on TypingMind?

Because you install it once and use it with any model. Unity Prefab is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Unity Prefab in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Besty0728/Unity-Skills/tree/main/SkillsForUnity/unity-skills~/skills/prefab. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Unity Prefab?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Unity Prefab?

As many as you like. As long as a model supports skills, you can use Unity Prefab with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Unity Prefab AI skill free?

Yes. It is published on GitHub by Besty0728 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇