Unity Cleaner logo

Unity Cleaner

CommunityPopular
Besty0728
unity-cleaner

Clean up and audit a Unity project

Overview

PublisherBesty0728
RepositoryUnity-Skills
Skill nameunity-cleaner
Stars
1.8K
Forks
164
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by Besty0728 on GitHub. Read the source before you install it.

Installation

Install the Unity Cleaner AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.

Use it in TypingMind

Enable Unity Cleaner in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Unity Cleaner on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Unity Cleaner is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Before calling any skill in this module: if you are about to call a skill with parameters guessed from its name or description, STOP — read this file (or fetch its schema via GET /skills/recommend?includeSchema=true) first. If you already have the parameter definitions from recommend/schema, you may proceed straight to dryRun.

Triggers

  • Reducing project bloat
  • Hunting duplicate or orphaned assets
  • Auditing before a release
  • 给项目瘦身、排查重复或孤立资源、发布前审计

Unity Cleaner Skills

Safety: cleaner_delete_assets uses a two-step confirmToken handshake. Call without confirmToken to preview; call again with the returned token (5-minute TTL) to actually delete. There is no dryRun parameter.

Guardrails

Operating Mode (v1.9 three-tier):

  • Approval (default): all analyze/query skills (cleaner_find_unused_assets, cleaner_find_duplicates, cleaner_find_missing_references, cleaner_get_asset_usage, cleaner_find_empty_folders, cleaner_find_large_assets, cleaner_get_dependency_tree) are SemiAuto — run directly.
  • Auto / Bypass: SemiAuto and FullAuto run directly.
  • Auto-forbidden in this module: cleaner_delete_assets, cleaner_delete_empty_folders (both carry SkillOperation.Delete). In Approval/Auto these return MODE_FORBIDDEN — they are reachable only under Bypass mode or via a user-managed Allowlist entry; the grant flow does not unlock them.
  • cleaner_fix_missing_scripts is an Execute | Modify operation (it replaces missing component references with null in place, no asset deletion), so it does not trigger the NeverInSemi gate. In Auto / Bypass it runs directly; in Approval it still requires the standard grant handshake before execution.
  • cleaner_delete_assets additionally uses a two-step confirmToken handshake even when the mode gate allows it — preview first (no token), then confirm with the returned token (5-minute TTL).

DO NOT (common hallucinations):

  • cleaner_delete / cleaner_remove do not exist → cleaner skills only find/report; use asset_delete to actually remove
  • cleaner_fix does not exist → use cleaner_fix_missing_scripts specifically for missing script references
  • cleaner_scan / cleaner_find_unused do not exist → use specific skills: cleaner_find_unused_assets, cleaner_find_duplicates, cleaner_find_missing_references, cleaner_find_empty_folders, cleaner_find_large_assets

Routing:

  • To delete found assets → use asset module's asset_delete / asset_delete_batch
  • For project validation → use validation module

Skills Overview

SkillDescription
cleaner_find_unused_assetsFind assets not referenced by others
cleaner_find_duplicatesFind duplicate files by content hash
cleaner_find_missing_referencesFind missing scripts/asset references
cleaner_delete_assetsDelete assets via two-step confirmToken (preview → confirm)
cleaner_get_asset_usageFind what references a specific asset
cleaner_find_empty_foldersFind empty folders in the project
cleaner_find_large_assetsFind largest assets by file size
cleaner_delete_empty_foldersDelete all empty folders
cleaner_fix_missing_scriptsRemove missing script components from GameObjects
cleaner_get_dependency_treeGet dependency tree for an asset

Skills

cleaner_find_unused_assets

Find potentially unused assets of a specific type.

ParameterTypeRequiredDefaultDescription
assetTypestringNo"Material"Asset type filter
searchPathstringNo"Assets"Search path
limitintNo100Max results

Returns: {success, assetType, potentiallyUnusedCount, assets: [{path, name, type, sizeBytes}]}

python
# Find unused materials
result = call_skill("cleaner_find_unused_assets", assetType="Material")

# Find unused textures in a specific folder
result = call_skill("cleaner_find_unused_assets", 
    assetType="Texture2D", searchPath="Assets/Textures")

cleaner_find_duplicates

Find duplicate files by MD5 hash.

ParameterTypeRequiredDefaultDescription
assetTypestringNo"Texture2D"Asset type
searchPathstringNo"Assets"Search path
limitintNo50Max groups

Returns: {success, duplicateGroupCount, totalWastedBytes, totalWastedMB, groups: [{count, sizeBytes, wastedBytes, files}]}

python
# Find duplicate textures
result = call_skill("cleaner_find_duplicates", assetType="Texture2D")
print(f"Wasted space: {result['totalWastedMB']:.2f} MB")

cleaner_find_missing_references

Find components with missing scripts or null references.

ParameterTypeRequiredDefaultDescription
includeInactiveboolNotrueInclude inactive objects

Returns: {success, issueCount, missingScripts, missingReferences, issues: [{type, gameObject, path, ...}]}

python
# Scan for all missing references
result = call_skill("cleaner_find_missing_references")
print(f"Missing scripts: {result['missingScripts']}")
print(f"Missing references: {result['missingReferences']}")

cleaner_delete_assets

Delete specified assets with two-step confirmation.

⚠️ Safety First: Deletion requires TWO calls - first preview, then confirm.

Step 1 - Preview (no confirmToken):

ParameterTypeRequiredDescription
pathsstring[]YesAsset paths to delete

Returns: {action: "preview", confirmToken, assetsToDelete, message}

Step 2 - Confirm (with confirmToken):

ParameterTypeRequiredDescription
confirmTokenstringYesToken from preview step

Returns: {action: "deleted", deletedCount, results}

python
# Step 1: Preview what will be deleted
preview = call_skill("cleaner_delete_assets", 
    paths=["Assets/Unused/mat1.mat", "Assets/Unused/mat2.mat"])
print(preview['message'])  # Shows: "⚠️ PREVIEW ONLY - 2 assets will be deleted..."
print(preview['assetsToDelete'])  # Full list with sizes

# Step 2: Confirm deletion using token (expires in 5 minutes)
if input("Proceed? (y/n): ") == 'y':
    result = call_skill("cleaner_delete_assets", 
        confirmToken=preview['confirmToken'])
    print(result['message'])  # "Successfully deleted 2 assets"

cleaner_get_asset_usage

Find what objects reference a specific asset.

ParameterTypeRequiredDescription
assetPathstringYesAsset path
limitintNoMax results (default 50)

Returns: {success, asset, usedByCount, usedBy: [{path, name, type}]}

python
# Check what uses a texture
result = call_skill("cleaner_get_asset_usage",
    assetPath="Assets/Textures/player.png")

cleaner_find_empty_folders

Find empty folders in the project.

ParameterTypeRequiredDefaultDescription
searchPathstringNo"Assets"Search path

Returns: { success, count, folders }

python
# Find empty folders
result = call_skill("cleaner_find_empty_folders")
print(f"Found {result['count']} empty folders")

cleaner_find_large_assets

Find largest assets by file size.

ParameterTypeRequiredDefaultDescription
searchPathstringNo"Assets"Search path
limitintNo20Max results
minSizeByteslongNo0Minimum file size in bytes

Returns: { success, count, assets: [{ path, sizeBytes, sizeMB }] }

python
# Find top 10 largest assets over 1 MB
result = call_skill("cleaner_find_large_assets", limit=10, minSizeBytes=1048576)
for a in result['assets']:
    print(f"{a['sizeMB']:.2f} MB - {a['path']}")

cleaner_delete_empty_folders

Delete all empty folders.

ParameterTypeRequiredDefaultDescription
searchPathstringNo"Assets"Search path

Returns: { success, deleted, total }

python
# Delete all empty folders
result = call_skill("cleaner_delete_empty_folders")
print(f"Deleted {result['deleted']} of {result['total']} empty folders")

cleaner_fix_missing_scripts

Remove missing script components from GameObjects.

ParameterTypeRequiredDefaultDescription
includeInactiveboolNotrueInclude inactive objects

Returns: { success, removedComponents }

python
# Remove all missing script components
result = call_skill("cleaner_fix_missing_scripts")
print(f"Removed {result['removedComponents']} missing script components")

cleaner_get_dependency_tree

Get dependency tree for an asset.

ParameterTypeRequiredDefaultDescription
assetPathstringYes-Asset path
recursiveboolNotrueRecursively resolve dependencies

Returns: { success, assetPath, dependencyCount, dependencies: [{ path, type }] }

python
# Get full dependency tree for a prefab
result = call_skill("cleaner_get_dependency_tree",
    assetPath="Assets/Prefabs/Player.prefab")
print(f"Dependencies: {result['dependencyCount']}")

Example Workflow: Clean Project

python
import unity_skills

# 1. Find all missing references and fix them
missing = unity_skills.call_skill("cleaner_find_missing_references")
for issue in missing['issues']:
    if issue['type'] == 'MissingScript':
        print(f"⚠️ Missing script on: {issue['path']}")

# 2. Find duplicate textures
dupes = unity_skills.call_skill("cleaner_find_duplicates", assetType="Texture2D")
if dupes['totalWastedMB'] > 10:
    print(f"🗑️ {dupes['totalWastedMB']:.1f} MB wasted on duplicates")

# 3. Find unused materials
unused = unity_skills.call_skill("cleaner_find_unused_assets", assetType="Material")
print(f"📦 {unused['potentiallyUnusedCount']} potentially unused materials")

# 4. Preview cleanup
paths_to_delete = [a['path'] for a in unused['assets'][:5]]
preview = unity_skills.call_skill("cleaner_delete_assets", 
    paths=paths_to_delete)
print(f"Would free: {preview['totalMB']:.2f} MB")
# To actually delete, call again with preview['confirmToken'] within 5 minutes.

Exact Signatures

Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file.

Frequently asked questions

What does the Unity Cleaner AI skill do?

Clean up and audit a Unity project

Why use Unity Cleaner on TypingMind?

Because you install it once and use it with any model. Unity Cleaner is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Unity Cleaner in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Besty0728/Unity-Skills/tree/main/SkillsForUnity/unity-skills~/skills/cleaner. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Unity Cleaner?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Unity Cleaner?

As many as you like. As long as a model supports skills, you can use Unity Cleaner with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Unity Cleaner AI skill free?

Yes. It is published on GitHub by Besty0728 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇