A Claude Code skill for generating and editing Unity .prefab files using the Claude Code Opus model. The skill provides comprehensive YAML reference knowledge — document structure, component wiring, nested prefabs, UI recipes, and more — so Claude can author and modify prefabs directly without opening the Unity Editor.
cp unity-prefabs.md <your-project>/.claude/commands/unity-prefabs.mdcp unity-prefabs.md ~/.claude/commands/unity-prefabs.md/unity-prefabs
Then ask Claude to modify a prefab file. The skill primes Claude with the full YAML reference so it produces correct, serialization-safe edits.
/unity-prefabsthen "Add a TMP_Dropdown to MyCanvas.prefab under the SettingsPanel GameObject"
Claude will generate all 12 required GameObjects (Dropdown, Label, Arrow, Template, Viewport, Content, Item, Item Background, Item Checkmark, Item Label, Scrollbar, Sliding Area, Handle) with correct cross-references.
/unity-prefabsthen "Wire the PlayButton nested prefab's onClick to call OnPlayTapped on the GameStartPanel script"
Claude will create the stripped entries, clear the Unity Button's m_OnClick, and configure the custom wrapper's onClick via PrefabInstance property modifications.
- Prefab YAML document structure and fileID rules
- GameObject + Component wiring patterns (3D and UI)
- Built-in component GUIDs (Image, TMP, Button, Dropdown, Toggle, ScrollRect, etc.)
- Standard Unity sprite references
- Nested prefab handling (PrefabInstance, stripped entries, SerializeField wiring)
- Event callback wiring and retargeting for nested prefabs
- Full TMP_Dropdown hierarchy recipe (12 GameObjects)
- Modification checklist to avoid common mistakes
- Claude Code CLI
- Claude Opus model (recommended for best results with complex prefab generation)
- Unity 6+ project
MIT


