gamedev-unity/skills/unity-skills/skills/asset/SKILL.md
Manage the Unity AssetDatabase — import, delete, move/rename, duplicate, find, get info, and create assets. Use when organizing project assets, importing or relocating files, querying asset metadata, or scripting AssetDatabase operations, even if the user just says "资源" or "资产". 管理 Unity AssetDatabase(导入、删除、移动/重命名、复制、查找、获取信息、创建资源);当用户要整理工程资源、导入或移动文件、查询资源元数据时使用。
npx skillsauth add bernatmv/ai-rules unity-assetInstall 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.
BATCH-FIRST: Use
*_batchskills when operating on 2+ assets.
asset_find / asset_get_info / asset_get_labels 标 SkillMode.SemiAuto,可直接执行;写类 skill (asset_move / asset_move_batch / asset_duplicate / asset_create_folder / asset_refresh / asset_reimport* / asset_set_labels) 走默认 SkillMode.FullAuto,需 grant。asset_import (标 RiskLevel = "high" —— 写入项目);asset_delete / asset_delete_batch (Operation.Delete)。这些在 Approval/Auto 下返 MODE_FORBIDDEN,仅 Bypass 或 Allowlist 命中可调。DO NOT (common hallucinations):
asset_create does not exist → use asset_create_folder (folders), material_create (materials), script_create (scripts)asset_rename does not exist → use asset_move with new pathasset_search does not exist → use asset_find with searchFilter syntax (e.g. t:Texture2D player)asset_copy does not exist → use asset_duplicateRouting:
importer module (SkillMode.FullAuto)material module (SkillMode.FullAuto)script module| Single Object | Batch Version | Use Batch When |
|---------------|---------------|----------------|
| asset_import | asset_import_batch | Importing 2+ files |
| asset_delete | asset_delete_batch | Deleting 2+ assets |
| asset_move | asset_move_batch | Moving 2+ assets |
No batch needed:
asset_duplicate - Duplicate single assetasset_find - Search assets (returns list)asset_create_folder - Create folderasset_refresh - Refresh AssetDatabaseasset_get_info - Get asset informationasset_reimport - Force reimport assetasset_reimport_batch - Reimport multiple assetsImport an external file into the project.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| sourcePath | string | Yes | External file path |
| destinationPath | string | Yes | Project destination |
Import multiple external files.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| items | json string | Yes | - | JSON array of per-item objects (see example below) |
items currently expects a JSON string, not a native array.
Returns: {success, totalItems, successCount, failCount, results: [{success, sourcePath, destinationPath}]}
import json
unity_skills.call_skill("asset_import_batch", items=json.dumps([
{"sourcePath": "C:/Downloads/tex1.png", "destinationPath": "Assets/Textures/tex1.png"},
{"sourcePath": "C:/Downloads/tex2.png", "destinationPath": "Assets/Textures/tex2.png"}
]))
Delete an asset from the project.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| assetPath | string | Yes | Asset path to delete |
Delete multiple assets.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| items | json string | Yes | - | JSON array of per-item objects (see example below) |
items currently expects a JSON string, not a native array.
Returns: {success, totalItems, successCount, failCount, results: [{success, path}]}
import json
unity_skills.call_skill("asset_delete_batch", items=json.dumps([
{"path": "Assets/Textures/old1.png"},
{"path": "Assets/Textures/old2.png"}
]))
Move or rename an asset.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| sourcePath | string | Yes | Current asset path |
| destinationPath | string | Yes | New path/name |
Move multiple assets.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| items | json string | Yes | - | JSON array of per-item objects (see example below) |
items currently expects a JSON string, not a native array.
Returns: {success, totalItems, successCount, failCount, results: [{success, sourcePath, destinationPath}]}
import json
unity_skills.call_skill("asset_move_batch", items=json.dumps([
{"sourcePath": "Assets/Old/mat1.mat", "destinationPath": "Assets/New/mat1.mat"},
{"sourcePath": "Assets/Old/mat2.mat", "destinationPath": "Assets/New/mat2.mat"}
]))
Duplicate an asset.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| assetPath | string | Yes | Asset to duplicate |
Find assets by search filter.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| searchFilter | string | Yes | - | Search query |
| limit | int | No | 50 | Max results to return |
Search Filter Syntax:
| Filter | Example | Description |
|--------|---------|-------------|
| t:Type | t:Texture2D | By type |
| l:Label | l:Architecture | By label |
| name | player | By name |
| Combined | t:Material player | Multiple filters |
Returns: {count, totalFound, assets: [{path, name, type}]}
Create a folder in the project.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| folderPath | string | Yes | Full folder path |
Refresh the AssetDatabase after external changes.
No parameters.
Get information about an asset.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| assetPath | string | Yes | Asset path |
Force reimport of an asset.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| assetPath | string | Yes | Asset path to reimport |
Reimport multiple assets matching a pattern.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| searchFilter | string | No | AssetDatabase search filter (default *) |
| folder | string | No | Folder root to search (default Assets) |
| limit | int | No | Max assets to reimport (default 100) |
Set labels on an asset (overwrites existing labels).
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| assetPath | string | Yes | Asset path |
| labels | string | Yes | Comma-separated labels (e.g. "ui,icon,hud"). Empty entries are dropped |
Returns: {success, assetPath, labels: [...]}
Get the labels currently attached to an asset.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| assetPath | string | Yes | Asset path |
Returns: {success, assetPath, labels: [...]}
import unity_skills
# GOOD: 1 API call instead of 4
unity_skills.call_skill("asset_move_batch", items=[
{"sourcePath": "Assets/tex1.png", "destinationPath": "Assets/Textures/tex1.png"},
{"sourcePath": "Assets/tex2.png", "destinationPath": "Assets/Textures/tex2.png"},
{"sourcePath": "Assets/tex3.png", "destinationPath": "Assets/Textures/tex3.png"},
{"sourcePath": "Assets/tex4.png", "destinationPath": "Assets/Textures/tex4.png"}
])
Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file.
development
Keyword research and validation with real search-demand data — never ship keywords from intuition alone. Probes Google Autocomplete per language (free, no account) to prove demand and discover the exact phrasing people type, checks SERPs for winnability, and uses Keyword Planner/Ahrefs/Semrush exports when the user has access. Activates when: choosing or reviewing SEO keywords, meta keywords, page titles, article topics or slugs, landing page copy targeting search, App Store/ASO keyword fields, multilingual keyword sets, 'what should we rank for', 'keyword analysis', or auditing why a page doesn't rank. Also invoke it as a validation pass whenever another skill or task produces a keyword list.
development
Automate YooAsset hot-update and asset bundles — build bundles, run Editor simulate builds, manage Collector groups, analyze BuildReport, and validate runtime. Use when building or simulating YooAsset bundles, configuring collectors, or validating hot-update assets, even if the user just says "热更" or "打AB包". 自动化 YooAsset 热更新与资源包(构建 bundle、编辑器模拟构建、管理 Collector 分组、分析 BuildReport、运行时校验);当用户要构建或模拟 YooAsset 资源包、配置 collector、或校验热更资源时使用。
development
Source-anchored design rules for YooAsset v2.3.18 — initialization, default-package shortcuts, play modes, asset handles, loading, updates, filesystem, build, and pitfalls. Use when writing or reviewing YooAsset code, initializing packages, loading assets via handles, setting up hot-update/download, or choosing a play mode, even if the user just says "热更" or "资源包". 为 YooAsset v2.3.18 提供源码锚定的设计规则(初始化、默认包快捷方式、运行模式、资源句柄、加载、更新、文件系统、构建、陷阱);当用户要编写或审查 YooAsset 代码、初始化 package、用句柄加载资源、配置热更/下载、或选择运行模式时使用。
data-ai
Last-resort guidance for safely hand-editing Unity serialized YAML (.unity/.prefab/.asset/.meta/ProjectSettings) — reference/fileID repair, GUID safety, and merge-conflict fixes. Use when REST cannot reach the change and YAML must be hand-edited — fixing m_Script GUIDs, broken fileID references, .meta files, or merge conflicts, even if the user just says "场景文件打不开" or "引用丢了". 安全手编 Unity 序列化 YAML(.unity/.prefab/.asset/.meta/ProjectSettings)的最后手段(引用/fileID 修复、GUID 安全、合并冲突修复);当 REST 无法触达、必须手编 YAML 时使用——修复 m_Script GUID、断裂 fileID 引用、.meta 文件或合并冲突。