Agent SkillsBesty0728/Unity-Skills › unity-asset

unity-asset

GitHub

管理Unity项目资源,支持导入、移动、删除、查询元数据及批量操作。提供安全模式控制,区分半自动与全自动执行,并明确高危操作的权限限制,防止误删或非法写入。

SkillsForUnity/unity-skills~/skills/asset/SKILL.md Besty0728/Unity-Skills

Trigger Scenarios

整理工程资源 导入或移动文件 查询资源元数据 脚本化AssetDatabase操作

Install

npx skills add Besty0728/Unity-Skills --skill unity-asset -g -y
More Options

Non-standard path

npx skills add https://github.com/Besty0728/Unity-Skills/tree/main/SkillsForUnity/unity-skills~/skills/asset -g -y

Use without installing

npx skills use Besty0728/Unity-Skills@unity-asset

指定 Agent (Claude Code)

npx skills add Besty0728/Unity-Skills --skill unity-asset -a claude-code -g -y

安装 repo 全部 skill

npx skills add Besty0728/Unity-Skills --all -g -y

预览 repo 内 skill

npx skills add Besty0728/Unity-Skills --list

SKILL.md

Frontmatter
{
    "name": "unity-asset",
    "description": "Manage Unity AssetDatabase operations"
}

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

  • Organizing project assets
  • Importing or relocating files
  • Querying asset metadata
  • Scripting AssetDatabase operations
  • 整理工程资源、导入或移动文件、查询资源元数据、脚本化 AssetDatabase 操作

Unity Asset Skills

BATCH-FIRST: Use *_batch skills when operating on 2+ assets.

Operating Mode

  • Approval:本模块 Mixed —— asset_find / asset_get_info / asset_get_labelsSkillMode.SemiAuto,可直接执行;写类 skill (asset_move / asset_move_batch / asset_duplicate / asset_create_folder / asset_refresh / asset_reimport* / asset_set_labels) 走默认 SkillMode.FullAuto,需 grant。
  • Auto / Bypass:FullAuto 直接执行。
  • 含 NeverInSemi 高危 skillasset_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 path
  • asset_search does not exist → use asset_find with searchFilter syntax (e.g. t:Texture2D player)
  • asset_copy does not exist → use asset_duplicate

Routing:

  • For texture/model/audio import settings → use importer module (SkillMode.FullAuto)
  • For material creation → use material module (SkillMode.FullAuto)
  • For script creation → use script module

Skills Overview

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 asset
  • asset_find - Search assets (returns list)
  • asset_create_folder - Create folder
  • asset_refresh - Refresh AssetDatabase
  • asset_get_info - Get asset information
  • asset_reimport - Force reimport asset
  • asset_reimport_batch - Reimport multiple assets

Skills

asset_import

Import an external file into the project.

Parameter Type Required Description
sourcePath string Yes External file path
destinationPath string Yes Project destination

asset_import_batch

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"}
]))

asset_delete

Delete an asset from the project.

Parameter Type Required Description
assetPath string Yes Asset path to delete

asset_delete_batch

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"}
]))

asset_move

Move or rename an asset.

Parameter Type Required Description
sourcePath string Yes Current asset path
destinationPath string Yes New path/name

asset_move_batch

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"}
]))

asset_duplicate

Duplicate an asset.

Parameter Type Required Description
assetPath string Yes Asset to duplicate

asset_find

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}]}

asset_create_folder

Create a folder in the project.

Parameter Type Required Description
folderPath string Yes Full folder path

asset_refresh

Refresh the AssetDatabase after external changes.

No parameters.

asset_get_info

Get information about an asset.

Parameter Type Required Description
assetPath string Yes Asset path

asset_reimport

Force reimport of an asset.

Parameter Type Required Description
assetPath string Yes Asset path to reimport

asset_reimport_batch

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)

asset_set_labels

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: [...]}

asset_get_labels

Get the labels currently attached to an asset.

Parameter Type Required Description
assetPath string Yes Asset path

Returns: {success, assetPath, labels: [...]}


Minimal Example

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"}
])

Best Practices

  1. Organize assets in logical folders
  2. Use consistent naming conventions
  3. Refresh after external file changes
  4. Use search filters for efficiency
  5. Backup before bulk delete operations

Exact Signatures

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

Common Errors

Full transport-level codes (COMPILING/RATE_LIMIT etc.) → ../../references/protocol-error-codes.md

Error Trigger Fix
TARGET_NOT_FOUND The source file, asset path, or target asset could not be found. Verify the path with asset_find / asset_get_info, ensure the file exists, and retry with the exact project-relative path.
MISSING_PARAM A required path parameter is empty or not provided (caught by path validation). Provide the required assetPath, sourcePath, destinationPath, or folderPath.
SEMANTIC_INVALID The path is invalid (e.g., contains .., does not start with Assets//Packages/, or the folder already exists). Use a normalized project-relative path under Assets/ or Packages/; choose a different folder name if it already exists.
SKILL_ERROR A low-level AssetDatabase or filesystem operation failed, such as Failed to delete asset, AssetDatabase.MoveAsset returned an error, or folder creation failed. Resolve the issue described in the message (e.g., close locked files, fix parent path) and retry.

Version History

  • 5ee8388 Current 2026-08-17 04:09

    文档精简至6.2KB,协议细节移至参考文件;新增指南模式文档及手动模块建议;更新版本锚点至2.6.0并添加变更日志。

  • 25d511e 2026-08-13 09:13

    压缩描述至约5191字符,并将路由说明移至Triggers部分。

  • ec9f870 2026-07-05 14:39

Same Skill Collection

SkillsForUnity/unity-skills~/skills/addressables-design/SKILL.md
SkillsForUnity/unity-skills~/skills/adr/SKILL.md
SkillsForUnity/unity-skills~/skills/animator/SKILL.md
SkillsForUnity/unity-skills~/skills/behavior/SKILL.md
SkillsForUnity/unity-skills~/skills/blueprints/SKILL.md
SkillsForUnity/unity-skills~/skills/event/SKILL.md
SkillsForUnity/unity-skills~/skills/graphics/SKILL.md
SkillsForUnity/unity-skills~/skills/history/SKILL.md
SkillsForUnity/unity-skills~/skills/manual-component/SKILL.md
SkillsForUnity/unity-skills~/skills/manual-gameobject/SKILL.md
SkillsForUnity/unity-skills~/skills/manual-material/SKILL.md
SkillsForUnity/unity-skills~/skills/manual-scene/SKILL.md
SkillsForUnity/unity-skills~/skills/material/SKILL.md
SkillsForUnity/unity-skills~/skills/netcode-design/SKILL.md
SkillsForUnity/unity-skills~/skills/netcode/SKILL.md
SkillsForUnity/unity-skills~/skills/perception/SKILL.md
SkillsForUnity/unity-skills~/skills/pico-design/SKILL.md
SkillsForUnity/unity-skills~/skills/primetween/SKILL.md
SkillsForUnity/unity-skills~/skills/probuilder/SKILL.md
SkillsForUnity/unity-skills~/skills/profiler/SKILL.md
SkillsForUnity/unity-skills~/skills/project-scout/SKILL.md
SkillsForUnity/unity-skills~/skills/sample/SKILL.md
SkillsForUnity/unity-skills~/skills/shadergraph-design/SKILL.md
SkillsForUnity/unity-skills~/skills/SKILL.md
SkillsForUnity/unity-skills~/skills/smart/SKILL.md
SkillsForUnity/unity-skills~/skills/unity-cli/SKILL.md
SkillsForUnity/unity-skills~/skills/yaml-editing/SKILL.md
SkillsForUnity/unity-skills~/SKILL.md
SkillsForUnity/unity-skills~/skills/architecture/SKILL.md
SkillsForUnity/unity-skills~/skills/asmdef/SKILL.md
SkillsForUnity/unity-skills~/skills/async/SKILL.md
SkillsForUnity/unity-skills~/skills/batch/SKILL.md
SkillsForUnity/unity-skills~/skills/bookmark/SKILL.md
SkillsForUnity/unity-skills~/skills/camera/SKILL.md
SkillsForUnity/unity-skills~/skills/cinemachine/SKILL.md
SkillsForUnity/unity-skills~/skills/cleaner/SKILL.md
SkillsForUnity/unity-skills~/skills/component/SKILL.md
SkillsForUnity/unity-skills~/skills/console/SKILL.md
SkillsForUnity/unity-skills~/skills/debug/SKILL.md
SkillsForUnity/unity-skills~/skills/decal/SKILL.md
SkillsForUnity/unity-skills~/skills/dotween-design/SKILL.md
SkillsForUnity/unity-skills~/skills/dotween/SKILL.md
SkillsForUnity/unity-skills~/skills/editor/SKILL.md
SkillsForUnity/unity-skills~/skills/gameobject/SKILL.md
SkillsForUnity/unity-skills~/skills/hybridclr/SKILL.md
SkillsForUnity/unity-skills~/skills/importer/SKILL.md
SkillsForUnity/unity-skills~/skills/inspector/SKILL.md
SkillsForUnity/unity-skills~/skills/light/SKILL.md
SkillsForUnity/unity-skills~/skills/navmesh/SKILL.md

Metadata

Files
0
Version
5ee8388
Hash
aee2a49d
Indexed
2026-07-05 14:39

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-17 18:33
浙ICP备14020137号-1 $Гость$