Skills

Aibridge Prefab Patch

Unity Prefab asset patch workflow for AIBridge.

Install

npx skills add FlameskyDexive/Legends-Of-Heroes --skill aibridge-prefab-patch -g -a claude-code -y
Category
Engineering
Updated
1mo ago
License
MIT
Context cost
Lightabout 1,145 tokens
Runs scripts
No, instructions only

What it does

Unity Prefab asset patch workflow for AIBridge. Use when modifying complex prefab assets with prefab patch operations, child or component creation, SerializedProperty writes, array edits, internal GameObject/component references, dry-run validation, or when deciding between prefab patch, inspector set_property, scene object commands, and direct Unity YAML fallback.

AIBridge Prefab Patch

Use prefab patch for complex Prefab asset edits that need multiple operations in one load/save cycle. Use inspector set_property for a single simple serialized field, and inspector set_properties for small batched field edits. Use gameobject、transform、inspector for scene objects. If the requested Prefab/Scene/custom .asset operation is not supported by AIBridge, load unity-yaml-editing and follow its direct UnityYAML rules.

$CLI means the platform-appropriate AIBridge CLI invocation, usually ./.aibridge/cli/AIBridgeCLI.exe on Windows.

参数选择

  • Prefer --ops <file> for multi-step edits, nested JSON, arrays, references, or anything run from PowerShell.
  • Use --ops-json <json> only for one or two very small operations.
  • Put temporary operation files under .aibridge/patch_ops/.
  • Always run --dryRun true before writing the prefab.

标准流程

  1. Find the target prefab with asset find/search --format paths.
  2. Inspect structure with prefab get_hierarchy --prefabPath "<prefab>".
  3. Create .aibridge/patch_ops/<task>.json.
  4. Run dry-run:
$CLI prefab patch --prefabPath "Assets/Prefabs/Player.prefab" --ops ".aibridge/patch_ops/player_hp_patch.json" --dryRun true
  1. If dry-run succeeds, run the same command without --dryRun true.
  2. Re-check hierarchy/properties, then run compile unity and get_logs --logType Error.

操作示例

Read the whole SKILL.md on GitHub

More in Engineering