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):- Create in the specified directory
characters/、props/、scenes/and self-containedlibrary.json; - Persist the path to global configuration
~/.handraw-style/config.jsonand workspace disaster recovery configuration; - If it is an existing directory, automatically scan existing WebP assets and complete seamless mounting;
- Trigger gallery rebuild, generate and refresh
skills/handdraw-style-prompter/gallery/assets.html。
- Create in the specified directory
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):- Calculate the next sequential number (character
CH-002..., propPR-001..., sceneSCN-001...); - Automatically convert to high-quality WebP format via PIL and store in
<tuku_dir>/<category>/<ID>.webp; - Synchronously mirror to offline preview directory
images/custom/<category>/<ID>.webp; - Write to external image library's
library.json; - Automatically refresh gallery.
- Calculate the next sequential number (character
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):- Keep the original number and metadata unchanged;
- Convert the new image to WebP and overwrite
<tuku_dir>/<category>/<ID>.webpand mirror cache; - Update external
library.jsonofupdated_attimestamp; - 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=...):- Update external
library.jsoncorresponding asset attribute; - Automatically refresh the gallery, and the front-end cards immediately sync and update the display.
- Update external
5. Safe Delete
- User trigger words:
删除角色库中的 CH-002从自建图库删除道具 PR-001清理角色:傲娇粉团
- Execution logic:
Call
delete_asset(asset_id):- official preset safety interception: If the target is an official preset (such as
CH-001Black Cat Waiter), resolutely refuse deletion and inform that it is protected by the official; - Physically delete the corresponding file from the external gallery directory;
- Physically delete the cache file from the mirror preview directory;
- Remove the entry from the external
library.jsonasset manifest; - Automatically rebuild the gallery, and the card synchronously disappears from the gallery.
- official preset safety interception: If the target is an official preset (such as
6. List / Inspect Assets
- User trigger words:
查看我的自建角色当前自建图库有哪些资产
- Execution logic:
Call
load_custom_assets()andget_asset(id), clearly list the quantity, ID, and name of the current gallery directory, characters, props, and scenes.
Safety Rules and Hard Constraints
- 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 bydelete_assetorreplace_asset_image. - 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. - 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.htmland the local disk data. - 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.htmlandtutorials.html), ensuring 100% zero leakage of user private assets.