Unity Project Hygiene
ASecurityUse before changing a Unity project's files outside the editor (renaming, moving, copying or deleting scripts and assets, or editing .meta, .prefab, .unity or .asset files), when references turn into "Missing Script" or point at the wrong asset after a pull or merge, when scenes won't merge, and when setting up or auditing a Unity repo. Checks without opening Unity for assets without .meta files, orphan .meta files, duplicate or malformed GUIDs, binary scenes and prefabs, wrong Asset Serializ...
- 3 stars
- 0 votes
- 0 copies
- 1 view
- Added November 6, 2026
Security analysis
100/100Pro scans all 2 files and shows the line behind each finding
npx -y skills add flxnsee/gamedev-toolkit --skill unity-project-hygiene --agent claude-codeAre you the author of Unity Project Hygiene?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/flxnsee-unity-project-hygiene)---
name: unity-project-hygiene
description: Use before changing a Unity project's files outside the editor (renaming, moving, copying or deleting scripts and assets, or editing .meta, .prefab, .unity or .asset files), when references turn into "Missing Script" or point at the wrong asset after a pull or merge, when scenes won't merge, and when setting up or auditing a Unity repo. Checks without opening Unity for assets without .meta files, orphan .meta files, duplicate or malformed GUIDs, binary scenes and prefabs, wrong Asset Serialization mode, hidden meta files, a bad .gitignore and tracked Library/ folders, and gives safe rules for editing Unity files by hand or as an AI agent.
license: MIT
compatibility: Python 3.10+, standard library only. Unity itself is not required. Optional git for tracked-file checks.
metadata:
author: gamedev-toolkit
version: "0.1.0"
---
# Unity project hygiene
Unity identifies every asset by the GUID in its `.meta` file, not by path. Almost every
"Missing (Mono Script)", "references disappeared after pull" or "prefab points to the
wrong texture" bug is a `.meta` problem.
## Run the checker
`${CLAUDE_SKILL_DIR}` is this skill's folder, where its scripts are. Run the commands from the
project folder as shown, without searching for the script. If the variable was not filled
in, use the base directory shown when the skill loaded.
```bash
python "${CLAUDE_SKILL_DIR}/scripts/unity_meta_check.py" path/to/UnityProject
python "${CLAUDE_SKILL_DIR}/scripts/unity_meta_check.py" . --json
```
Exit code `0` = clean, `1` = errors, `2` = not a Unity project (needs `Assets/` and
`ProjectSettings/`). Each finding names the file and says how to fix it. What the messages
don't say:
- **`duplicate-guid`**: before deleting the copy's `.meta`, check which file other assets
reference (`git grep <guid> -- Assets`); that one keeps the GUID.
- **`missing-meta`**: if a teammate already has the asset, get *their* `.meta` instead of
letting Unity make a new one, or references break.
- **`orphan-meta`**: the asset was deleted, or never committed. Ask which before deleting.
- Unity gives no `.meta` to names that start with `.`, end with `~` or `.tmp`, or are named
`cvs`. Folders like `Documentation~` are a valid way to keep files out of the import.
## Rules for agents editing a Unity project
1. **Never delete or regenerate a `.meta` file to "fix" something** unless the checker found
a duplicate GUID. A new GUID silently breaks every reference to that asset.
2. **Moving or renaming assets**: do it in the Unity Editor, or move the `.meta` together
with the asset (`git mv Foo.cs Bar.cs` and `git mv Foo.cs.meta Bar.cs.meta`). For a
`MonoBehaviour`, the class name must match the new file name.
3. **New C# script files**: create them freely. Unity generates the `.meta` on next focus.
Remind the user to commit the generated `.meta`.
4. **Don't hand-edit `.unity` / `.prefab` YAML** unless the change is trivial and you know
the `fileID`/`guid` structure. Prefer editor scripts or have the user do it in the editor.
5. **Never edit files under `Library/`**. It's a cache that Unity rebuilds.
6. After big changes, a reimport can take a long time. Tell the user before suggesting
`Assets → Reimport All`.
## Reference
- [references/smart-merge.md](references/smart-merge.md): setting up Unity's Smart Merge for
Git so scene and prefab conflicts can be merged. Read it when the user has merge conflicts
in `.unity` or `.prefab` files.
Files in this skill
- SKILL.md
- scripts/unity_meta_check.py
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.