SuperAPI AI Directory

custom-asset-manager

General & other

View repository

Updated 10-16 15:13

About this skill

Custom Asset Manager

Exclusively forhand-drawn style and layout pattern librarydesigned dedicated asset management skill. Responsible for managing the full lifecycle asset maintenance of user-built image libraries (character library, prop library, scene library), includingdirectory initialization and mounting、adding archives、replacing benchmark images、modifying attributes、safe deletionas well asasset querying, and ensuring complete decoupling from official presets and permanent conflict-free Git updates.


Core Responsibility Division

Business Intent Responsible Skill Description
Asset maintenance (add/delete/modify/replace/query) custom-asset-manager Focus on managing local physical files, multi-level configuration and manifest indexing, strictly maintaining asset status
Image generation and prompt assembly handdraw-style-prompter Focus on style activation, pattern layout assembly, reference image citation and image generation design, read-only assets

Supported Core Commands and Operation Specifications

Underlying unified call to Python engine:skills/handdraw-style-prompter/scripts/custom_library_manager.py

1. Initialize or Mount Image Library Directory (Init / Attach)

  • User trigger words:
    • 请帮我初始化图库目录:d:\path\to\tuku
    • 切换图库目录:d:\path\to\my_assets
  • Execution logic: Call init_or_attach_library(target_path):
    1. Create in the specified directory characters/、props/、scenes/ and self-contained library.json;
    2. Persist the path to global configuration ~/.handraw-style/config.json and workspace disaster recovery configuration;
    3. If it is an existing directory, automatically scan existing WebP assets and complete seamless mounting;
    4. Trigger gallery rebuild, generate and refresh skills/handdraw-style-prompter/gallery/assets.html。

2. Add Archived Asset (Add / Archive)

  • User trigger words:
    • 保存图片到角色库,名称:xxx
    • 保存图片到道具库,名称:xxx
    • 保存图片到场景库,名称:xxx
    • 请添加到角色库(If no name is specified, AI assigns an appropriate name and prompts the user that it can be modified)
  • Execution logic: Call save_asset(category, name, source_image, tags):
    1. Calculate the next sequential number (character CH-002..., prop PR-001..., scene SCN-001...);
    2. Automatically convert to high-quality WebP format via PIL and store in <tuku_dir>/<category>/<ID>.webp;
    3. Synchronously mirror to offline preview directory images/custom/<category>/<ID>.webp;
    4. Write to external image library's library.json;
    5. Automatically refresh gallery.

3. Replace Benchmark Image (Replace Benchmark Image)

  • User trigger words:
    • 用这张图片替换角色 CH-002
    • 替换 CH-002 的基准图
    • 更新道具 PR-001 的图片
  • Execution logic: Call replace_asset_image(asset_id, new_source_image):
    1. Keep the original number and metadata unchanged;
    2. Convert the new image to WebP and overwrite <tuku_dir>/<category>/<ID>.webp and mirror cache;
    3. Update external library.json of updated_at timestamp;
    4. Automatically refresh the gallery, and use the brand-new benchmark image as the reference image immediately when generating images.

4. Update Attributes and Tags (Update Metadata)

  • User trigger words:
    • 把 CH-002 名称修改为:粉扑兔
    • 修改 CH-002 标签为:可爱, 萌系, 毛绒
    • 将 CH-002 英文名改为:Cute Pink Bunny
  • Execution logic: Call update_asset_metadata(asset_id, name=..., name_en=..., tags=...):
    1. Update external library.json corresponding asset attribute;
    2. Automatically refresh the gallery, and the front-end cards immediately sync and update the display.

5. Safe Delete

  • User trigger words:
    • 删除角色库中的 CH-002
    • 从自建图库删除道具 PR-001
    • 清理角色:傲娇粉团
  • Execution logic: Call delete_asset(asset_id):
    1. official preset safety interception: If the target is an official preset (such as CH-001 Black Cat Waiter), resolutely refuse deletion and inform that it is protected by the official;
    2. Physically delete the corresponding file from the external gallery directory;
    3. Physically delete the cache file from the mirror preview directory;
    4. Remove the entry from the external library.json asset manifest;
    5. Automatically rebuild the gallery, and the card synchronously disappears from the gallery.

6. List / Inspect Assets

  • User trigger words:
    • 查看我的自建角色
    • 当前自建图库有哪些资产
  • Execution logic: Call load_custom_assets() and get_asset(id), clearly list the quantity, ID, and name of the current gallery directory, characters, props, and scenes.

Safety Rules and Hard Constraints

  1. Official presets are sacred and read-only: Official presets (CH-001 , etc.) are core assets of the public repository and are strictly prohibited from being altered or deleted by delete_asset or replace_asset_image .
  2. Zero hardcoded paths: It is strictly prohibited to hardcode the user's external physical paths into Git-tracked code or documentation. All configuration is automatically addressed via ~/.handraw-style/config.json .
  3. The gallery must be refreshed after operations: After any add, delete, modify, or replace operation is executed, it must be ensured that a gallery rebuild is triggered, guaranteeing 100% strong consistency between the front-end assets.html and the local disk data.
  4. Self-built asset index strictly isolated from Git: Self-built asset IDs and metadata are uniformly exported to a local gitignored index file (images/custom/custom_assets.js), dynamically rendered and loaded by the browser side, and must never be baked into Git-tracked static HTML files (assets.html and tutorials.html), ensuring 100% zero leakage of user private assets.