Prefab architecture

From TheArcForge/UniClaude · View interactive version

Prefab architecture is an AI agent skill from the GitHub repository TheArcForge/UniClaude. Use when you need detailed decision frameworks for prefab vs variant vs ScriptableObject, nested prefab design, override strategies, and prefab editing workflows.

How to use this skill

Skill file

Prefab Architecture — Full Decision Framework

Use this when unity-architect's condensed prefab section needs more depth.

DECISION: Prefab vs Variant vs ScriptableObject Config

When this applies: Creating a family of related objects (weapons, enemies, pickups, vehicles).

Options:

  1. Separate prefabs — each variant is an independent prefab asset.
  1. Prefab variants — base prefab + variants that override specific values.
  1. ScriptableObject config + single prefab — one prefab, multiple SO data assets.

Decision tree:

Do variants differ in components or children?
├── YES → Separate prefabs (or variant if additive only)
└── NO → Data-only differences?
    ├── YES → How many variants?
    │   ├── < 10 → Prefab variants (visual editor preview)
    │   └── >= 10 → ScriptableObject config (scalable)
    └── MIXED → Base prefab variant + SO for data portions

Questions to ask the user:

DECISION: Nested Prefab Structure

When this applies: A prefab has children that are themselves reusable.

Rule: Nest when children are independently reusable. Flatten when they are internal implementation.

Examples:

Depth limit: Never deeper than Base → Nested. Two levels of nesting (Base → Nested → Nested) causes override resolution conflicts in Unity.

DECISION: Override Strategy

When this applies: Deciding how to manage changes between base and variants.

Rules:

MCP workflow:

  1. To create a variant: prefab_create_variant from base.
  2. To edit a variant: prefab_open_editing → make changes → prefab_save_editing.
  3. To propagate base changes: edit the base; variants auto-inherit unless overridden.
  4. To check what's overridden: prefab_get_contents on the variant asset.

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.