Skill~/aibridge-prefab-patch/SKILL.md
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
npx skillsauth add liyingsong99/aibridge aibridge-prefab-patchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use prefab patch when one Prefab edit needs multiple operations in one load/save cycle. For single-field or small batched edits, prefer inspector set_property or inspector set_properties. For scene objects, prefer gameobject, transform, and inspector. 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
--ops <file> for multi-step edits, nested JSON, arrays, references, or anything run from PowerShell--ops-json <json> only for one or two very small operations.aibridge/patch_ops/--dryRun true before writing the prefabasset find/search --format pathsprefab get_hierarchy --prefabPath "<prefab>".aibridge/patch_ops/<task>.json$CLI prefab patch --prefabPath "Assets/Prefabs/Player.prefab" --ops ".aibridge/patch_ops/player_hp_patch.json" --dryRun true
--dryRun truecompile unity and get_logs --logType Error[
{ "op": "ensure_child", "path": "Player/HP" },
{ "op": "ensure_component", "path": "Player/HP", "typeName": "Animator" },
{
"op": "set_property",
"target": { "path": "Player/HP", "componentName": "Animator" },
"propertyName": "m_Enabled",
"value": true
},
{
"op": "set_array",
"target": { "path": "Player", "componentName": "YourComponent" },
"propertyName": "items",
"items": [
{ "key": "HP", "value": { "$gameObject": "Player/HP" } },
{
"key": "HPAnimator",
"value": {
"$component": { "path": "Player/HP", "typeName": "Animator" }
}
}
]
}
]
ensure_child: Ensure a GameObject path exists. Optional fields: active, tag, layer.ensure_component: Ensure a component exists on path. Use typeName.set_property: Set one SerializedProperty on a GameObject/component/asset target.set_properties: Set multiple SerializedProperties on one target.set_array: Replace an array property.append_array: Append items to an array property.clear_array: Clear an array property.prefab patch currently does not cover every Unity serialized structure. Use unity-yaml-editing when the task needs unsupported operations such as:
.unity object creation or structure edits not exposed by scene/gameobject/transform/inspector commands..meta, root object, child hierarchy, and component documents..asset creation or structural edits that cannot be represented by Inspector SerializedProperty writes..mat, .controller, .anim, etc.) requiring direct document/fileID/GUID changes.Use these object reference values inside value or array items:
{ "$gameObject": "Player/HP" }
{ "$component": { "path": "Player/HP", "typeName": "Animator" } }
{ "$asset": "Assets/Materials/HPMat.mat" }
{ "$guid": "asset-guid" }
null
unity-yaml-editing.GameObject.m_Component, Transform.m_Children, Transform.m_Father, and component m_GameObject reference, then re-import and inspect.Root/Child and Child can work when unambiguous.componentIndex when needed..aibridge/patch_ops/; do not put it under Assets/ or commit it.references/prefab-reference.md: generated CLI reference for general prefab commandstools
AIBridge workflow and multi-agent orchestration guidance. Use when Codex needs to design, review, or execute a multi-agent workflow plan, split Unity work into parallel or pipeline agent roles, define structured workflow artifacts, choose between batch/multi automation and agent orchestration, run adversarial verification, investigate Runtime debug evidence, sweep multiple Runtime targets, or prepare AIBridge workflow recipes
development
Optional read-only AIBridge Code Index semantic lookup for Unity C# code search and source navigation. Use when this Skill is installed, Code Index is enabled, and Codex needs to find C# symbols, definitions, references, implementations, derived types, callers, or diagnostics, including code lookup during development tasks. Do not use for literal text, config, asset, scene, prefab, or non-C# searches; use rg, host file reads, or regular AIBridge commands instead
development
Unity YAML text serialization editing workflow. Use when Codex needs to directly inspect, modify, create, or repair Unity serialized YAML files such as .unity scenes, .prefab assets, .asset ScriptableObject/config files, .mat, .controller, or other text-serialized Unity assets, especially when AIBridge inspector/prefab/scene APIs do not support the requested Prefab, Scene, ScriptableObjectTable, or custom asset operation
development
AIBridge/Unity 多分支开发工作流入口。Use when a task requires code or Unity asset changes, persistent AGENTS/Skill/workflow rule changes, root-cause debugging, Runtime/log evidence, risk review, validation verdicts, or workflow recipes. Do not use for pure Q&A, simple explanation, simple search/display, or read-only analysis with no changes and no verdict