Agent skill

Unity Prefab

by Besty0728 in Besty0728/Unity-Skills

“Manage Prefabs and variants”

— description from SKILL.md by Besty0728
MITAuto-check passedGame Development

Install Unity Prefab

skills CLI
$ npx skills add Besty0728/Unity-Skills --skill unity-prefab -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Besty0728/Unity-Skills unity-prefab --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Besty0728/Unity-Skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/'SkillsForUnity/unity-skills~/skills/prefab' .claude/skills/unity-prefab && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
unity-prefab
GitHub stars
1.8k
Token cost
~3.3k tokens
SKILL.md length
1,300 words
Files
1
Skills in repo
82
Repo updated
First seen
Licence
MIT

At a glance

  • Works in 5 steps: Organize prefabs in dedicated folders → Use prefabs for repeated objects → Apply changes to update all instances → …
  • SKILL.md covers Triggers, Operating Mode, Skills Overview and Skills, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

About this skill

Unity Prefab is a skill in Besty0728/Unity-Skills (1.8k stars). Its SKILL.md is about 3.3k tokens. Licence: MIT.

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  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

What it can do on your machine

Read from SKILL.md and the folder at commit 15a1925. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Unity Prefab loads about 3.3k tokens when it runs. Until then it costs about 10 tokens; SKILL.md has 1,300 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~10
When it runs · the whole SKILL.md, loaded when a task matches
~3.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Besty0728/Unity-Skills at commit 15a1925, republished under its MIT licence (© Besty0728). 1,300 words, ~3,344 tokens.

Download SKILL.mdSave it as .claude/skills/unity-prefab/SKILL.md (or your agent's skills folder).
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.

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; .prefab is appended when missing

*At least one source identifier required.

Returns: {success, prefabPath, name, connected}: prefabPath is the saved asset's path, connected whether the scene object is now an instance of it. A save Unity refuses is an error, not a success.

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
itemsjsonstringYesArray of instantiation configs

Item properties: prefabPath, name, x, y, z (local position, relative to the parent if set), rotX, rotY, rotZ, scaleX, scaleY, scaleZ, parentEntityId, parentName, parentInstanceId, parentPath

Returns: {success, totalItems, successCount, failCount, results: [{success, name, entityId, instanceId, position, localPosition}]}: position is the world position read back, localPosition the local one. All-or-nothing: one failed item removes every instance the call created (rolledBack: true).

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, isVariant }: variantPath is the saved asset's path (.prefab appended when missing), isVariant whether Unity stored it as a variant of the source.

Show full SKILL.md (502 more words)Show less
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. A bool is true/false/1/0/yes/no/on/off (anything else is rejected). An enum takes a name, display name, A,B for flags, or a number with the same rules as component_set_serialized_property (0..n-1 = member index, warned when the member's value differs; undeclared bits rejected). 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, valueRequested?, warnings? }: component / property are the resolved type name and serialized path; valueSet is read back from the asset after saving (serialized form: an enum reads as its index, a quaternion as x,y,z,w; for assetReferencePath the referenced asset's path); valueRequested appears only when the stored value differs from what was written (clamped by the component, or a reference of the wrong type not stored).

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.

© Besty0728, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in SkillsForUnity/unity-skills~/skills/prefab of Besty0728/Unity-Skills.

Open the folder on GitHubat commit 15a1925

Compare with similar skills

Unity Prefab next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Unity Prefab compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Unity Prefab this skillBesty0728/Unity-Skills1.8k—~3.3kAutomated safety check: PassMIT
Image to Three.js Modelimg2threejs/img2threejs18k1 repos~8.2kAutomated safety check: PassApache-2.0
Web CloneJane-xiaoer/claude-skill-web-clone1k1 repos~2.7kAutomated safety check: PassMIT
Threejs Game Directormajidmanzarpour/threejs-game-skills2.5k—~2.2kAutomated safety check: PassMIT
Game Asset Generatorhtdt/godogen7.1k—~2.8kAutomated safety check: PassMIT
Threejs Gameplay Systemsvalkor-ai/loom1.2k1 repos~1.4kAutomated safety check: PassApache-2.0

Similar skills

  • Image to Three.js Model

    img2threejs/img2threejs

    Rebuilds the object in a reference image as a procedural, animation-ready Three.js model written entirely in code, using staged sculpting with quality checks.

    18k GitHub starsUsed in 1 repo~8.2k tokens
    Game DevelopmentAuto-check passed
  • Web Clone

    Jane-xiaoer/claude-skill-web-clone

    网站复刻 / 克隆方法论。USE WHEN 用户说 复刻网站、克隆网站、clone website、抄个站、仿站、 照着这个站做一个、reproduce site、还原某个网页效果、把这个站搬下来改成我的、 复刻某个交互/WebGL/Canvas/Three.js 效果。提供「先拿真源码 → 判路径 → 逆向拆解 → 搭工程 → 替换内容」的可移植决策树,覆盖静态站 /…

    1k GitHub starsUsed in 1 repo~2.7k tokens
    Game DevelopmentAuto-check passed
  • Threejs Game Director

    majidmanzarpour/threejs-game-skills

    Entrypoint for building, upgrading, and finishing Three.js browser games.

    2.5k GitHub stars~2.2k tokensUpdated 11 days ago
    Game DevelopmentAuto-check passed
  • Generates game art from text prompts: PNG images, GLB 3D models, rigged characters, animations and sprites, with background removal.

    7.1k GitHub stars~2.8k tokensUpdated 8 days ago
    Game DevelopmentAuto-check passed
  • Build and iterate playable Three.js game systems: starter scaffold, architecture, design briefs, core loops, level and encounter design, entities, input, camera, collision and physics, scoring…

    1.2k GitHub starsUsed in 1 repo~1.4k tokens
    Game DevelopmentAuto-check passed
  • Uloop Execute Dynamic Code

    CyberAgentGameEntertainment/NovaShader

    Execute C with Unity APIs when existing uloop tools cannot inspect or edit enough.

    1.6k GitHub starsUsed in 1 repo~1.9k tokens
    Game DevelopmentAuto-check passed

More from Besty0728/Unity-Skills

All 82 skills in this repo
  • Unity Skills

    Besty0728/Unity-Skills

    Automate the Unity Editor through a local REST API — scripts, scenes, prefabs, assets, materials, lighting, tests and hundreds of other Editor operations.

    1.8k GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • Unity Animator

    Besty0728/Unity-Skills

    Edit Unity Animator Controllers and drive runtime parameters

    1.8k GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed
  • Unity Architecture

    Besty0728/Unity-Skills

    Advise on Unity gameplay and system architecture. An agent skill from Besty0728/Unity-Skills.

    1.8k GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed
  • Unity Batch

    Besty0728/Unity-Skills

    Unified batch and async-job orchestration. An agent skill from Besty0728/Unity-Skills.

    1.8k GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • Unity Behavior

    Besty0728/Unity-Skills

    Drive Unity Behavior behavior graphs and blackboard variables

    1.8k GitHub stars~3k tokensUpdated yesterday
    Auto-check passed
  • Unity Console

    Besty0728/Unity-Skills

    Capture and query the Unity Editor console. An agent skill from Besty0728/Unity-Skills.

    1.8k GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed

Questions about Unity Prefab

How do I install Unity Prefab in Claude Code?

Run `npx skills add Besty0728/Unity-Skills --skill unity-prefab -a claude-code`. Or copy the skill folder (SkillsForUnity/unity-skills~/skills/prefab in Besty0728/Unity-Skills) into .claude/skills/unity-prefab in your project. Claude Code loads it when a task matches its description.

How do I install Unity Prefab in Codex?

Run `npx skills add Besty0728/Unity-Skills --skill unity-prefab -a codex`. Or copy the skill folder (SkillsForUnity/unity-skills~/skills/prefab in Besty0728/Unity-Skills) into .agents/skills/unity-prefab in your project. Codex loads it when a task matches its description.

Can I use Unity Prefab in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Besty0728/Unity-Skills --skill unity-prefab -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/unity-prefab, .gemini/skills/unity-prefab, .github/skills/unity-prefab and .opencode/skills/unity-prefab in your project.

What does Unity Prefab need to run?

SKILL.md names no scripts, command-line tools or credentials: Unity Prefab is instructions for the agent only.

Does Unity Prefab access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Unity Prefab safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Unity Prefab use?

Unity Prefab is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Unity Prefab use?

About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Unity Prefab?

Skills that share tags, products or a category with Unity Prefab: Image to Three.js Model (img2threejs/img2threejs, 18k stars), Web Clone (Jane-xiaoer/claude-skill-web-clone, 1k stars), Threejs Game Director (majidmanzarpour/threejs-game-skills, 2.5k stars) and Game Asset Generator (htdt/godogen, 7.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Unity Prefab?

Besty0728 (a GitHub user) maintains it in Besty0728/Unity-Skills, which has 1,819 GitHub stars. The repository holds 82 skills in this directory. The repository was last updated on October 8, 2026.

Source: Besty0728/Unity-Skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.