t1k:unity:base:asset-import
| Field | Value |
|---|---|
| Module | base |
| Version | 2.2.2 |
| Effort | medium |
| Tools | — |
Keywords: asset import, asset naming check, asset pipeline, import assets, incoming assets, promote assets, validate assets
How to invoke
Section titled “How to invoke”/t1k:unity:base:asset-importUnity Asset Import — Manifest-Driven Triage & Promotion
Section titled “Unity Asset Import — Manifest-Driven Triage & Promotion”Triggers
Section titled “Triggers”- “import assets”, “promote assets”, “validate assets”
- “asset import”, “incoming assets”, “_Incoming”
- “asset naming check”, “asset pipeline”, “rename suggestion”
Purpose
Section titled “Purpose”Process raw assets dropped into Assets/_Game/<GameName>/_Incoming/ by artists or AI: detect type, validate naming + size + import-settings, triage into ACCEPTED-CLEAN / ACCEPTED-WITH-WARNING / REJECTED-ERROR, emit a report, and (with --apply) move accepted files to canonical folders + set Addressables groups + labels via Unity MCP.
Report-only by default. Mutations are gated behind explicit --apply.
Two-Layer Manifest Model
Section titled “Two-Layer Manifest Model”| Layer | File | Owner | Purpose |
|---|---|---|---|
| Kit defaults | references/default-manifest-schema.md (inline JSON) | theonekit-unity | Prefix table, budgets, folder map, Addressable label families |
| Project override | .claude/asset-pipeline.json (project root) | consumer project | Overrides + additions (new prefixes, project-specific realms, custom folders) |
Deep merge with project keys winning — for any key path that exists in both, project value replaces kit value. New keys from the project are additive.
If .claude/asset-pipeline.json is missing, the skill uses kit defaults only. If present but malformed, ERROR (do not silently fall back).
See references/project-override-pattern.md for a worked example.
Workflow
Section titled “Workflow”- Scan —
scripts/scan-incoming.cjswalks<incomingRoot>(defaultAssets/_Game/<GameName>/_Incoming). Emits JSON{ files: [{path, name, ext, sizeBytes}] }. - Load manifest — read kit defaults, deep-merge
.claude/asset-pipeline.jsonover them. - Validate per file —
scripts/validate-naming.cjs— for each file: detect prefix, attempt regex match, check size budget, resolve target folder viafolderMap. - Triage — assign ACCEPTED-CLEAN, ACCEPTED-WITH-WARNING, or REJECTED-ERROR per
references/triage-rules.md. - Report — emit markdown table per
references/report-format.md. STOP here unless--apply. - AskUserQuestion — gate the apply phase (options: apply / fix-then-rescan / abort).
- Apply (gated) —
scripts/promote-assets.cjs --apply:- For ACCEPTED files: invoke
mcp__UnityMCP__manage_asset(action="move", source, destination). - Set Addressables group + labels via
mcp__UnityMCP__manage_addressables. - For REJECTED files: leave in place. Re-emit AI rename suggestion if possible.
- For ACCEPTED files: invoke
Follows rules/preview-first-batch.md — smoke 5 files first if total >10.
Full step-by-step: references/workflow.md.
Triage Levels
Section titled “Triage Levels”| Level | Trigger | Action |
|---|---|---|
| ACCEPTED-CLEAN | Prefix detected, regex passes, size within budget, target folder resolved | Move + apply labels |
| ACCEPTED-WITH-WARNING | Regex passes but size > warn-threshold OR unknown extension AND warnOnUnknownExtension: true | Move + apply labels + flag in report |
| REJECTED-ERROR | Regex fails, size > err-threshold, OR no prefix detected | Leave in _Incoming/. Emit AI rename suggestion. |
See references/triage-rules.md for the full decision tree.
Rename Suggestion Logic (AI)
Section titled “Rename Suggestion Logic (AI)”When regex fails on a recognizable prefix:
- Tokenize the source filename (e.g.
bonewarden_skull_diff_1024.png→ tokensbonewarden,skull,diff). - If manifest declares
contentKeys(e.g.ScriptableObjects/SO_Weapon_*.asset), grep those SO names for fuzzy matches to the longest token. - Match found (
SO_Weapon_PrimalBoneSkullCap.asset→PrimalBoneSkullCap) → proposeT_PrimalBoneSkullCap_Helmet_D.pngper theT_regex. - No match → propose a regex-conforming PascalCase name from the tokens; flag as
[ai-guess].
Always present rename suggestions in the report; never auto-rename on --apply.
Addressables Group + Label Assignment
Section titled “Addressables Group + Label Assignment”After resolving the target folder, look up folderMap[targetFolder] for { group, labels }.
Labels follow three families (see manifest addressables.labelFamilies):
kind_*— always assigned from folder type (kind_art,kind_audio,kind_vfx,kind_scene,kind_data).realm_*— assigned viarealmAutoDetectregex against filename suffix (_Primal→realm_primal).tier_*— defaulttier_baseunless filename matches_expansion_N/_liveopspatterns.
Per-Asset-Type Validators
Section titled “Per-Asset-Type Validators”| Type | Checks |
|---|---|
texture | Max dimension (manifest budgets.texture.maxSize), sRGB ON for albedo (_D suffix), mip maps OFF for UI sprites |
texture.atlas | Higher maxSize budget; warn if not in an Addressable sprite atlas group |
audio.sfx | Mono, ADPCM/Vorbis, load-type DecompressOnLoad, < 1 MB |
audio.bgm | Stereo, Vorbis, load-type Streaming, < 5 MB |
animation.clip | Root motion OFF unless under Cinematic/; duration < 30s |
sprite | PPU = 100, filter mode = Bilinear, no mip maps |
Import-setting checks are advisory in v1.0 (read from .meta if it exists); v1.1 will apply them via MCP.
Constraints
Section titled “Constraints”- NEVER mutate without
--apply— default mode is report-only. - NEVER auto-rename rejected files — only suggest, leave for human/AI confirmation.
- ALWAYS gate
--applyviaAskUserQuestion— even on clean reports (perpreview-first-batch.md). - NEVER skip the manifest — missing kit defaults = bug; missing project manifest = use kit defaults; malformed project manifest = ERROR.
- NEVER process files matching
*.meta— those are Unity’s import sidecars; mirror them on move. - Idempotent moves only — if target file exists at destination, REJECT with
target-collision; do not overwrite.
Gotchas
Section titled “Gotchas”- Unity
.metafiles — every asset move must move the.metafile in lockstep, or Unity loses the GUID.manage_asset(action="move")handles this; rawmvdoes NOT. - Realm auto-detect is suffix-only — files without a realm tag get no
realm_*label. That is intentional; over-tagging is worse than under-tagging. - Project override deep-merge is by-key, not by-element —
prefixesis merged key-by-key (project can addLoc_without touchingT_); butlabelFamilies.realmis replaced entirely if the project sets it (arrays don’t merge). _Incoming/is gitignored by convention — never commit raw incoming files. The skill assumes incoming is ephemeral.- Addressables group must exist —
manage_addressablesdoes NOT create groups on demand. Pre-create viat1k-unity-base-addressablesskill.
References
Section titled “References”references/default-manifest-schema.md— full schema + inline examplereferences/workflow.md— step-by-stepreferences/triage-rules.md— decision treereferences/report-format.md— markdown report templatereferences/project-override-pattern.md— deep-merge worked example
Scripts
Section titled “Scripts”scripts/scan-incoming.cjs— list files under<incomingRoot>scripts/validate-naming.cjs— apply regex + size checks per filescripts/promote-assets.cjs— move via Unity MCP (gated by--apply)
Related Skills
Section titled “Related Skills”t1k-unity-base-addressables— group + label registrationt1k-unity-base-code-conventions— naming conventions (seeproject-folder-structure.md)t1k-unity-base-mcp-skill— Unity MCP wrapper used bypromote-assets.cjs