Qwen Vision Rename Skill
Use this skill for:
- - understanding image content (single image)
- batch generating content-based filenames for local image folders
- direct batch rename with rollback support
- naming pattern
类型-主题 (example: 邀请函-万人大会主视觉)
Runtime behavior (strict)
- -
qwen-vision-rename is a skill name, not a built-in tool name. - First use the
read tool to open this SKILL.md, then run the Python command below. - Never emit a tool call named
qwen-vision-rename. - Always execute the script. Do not fabricate recognition results.
- For rename requests, default to direct execution: run
rename-dir --apply. - If the user explicitly says "预览/试运行/dry-run/先看方案", run without
--apply. - Do not call
qwen-image for rename tasks. - Requests like "整理图片/按内容分类整理" still map to this skill. This skill renames by content first; if the user explicitly asks to move files into folders, explain that separately.
- If user does not provide a folder path, run
rename-dir without --dir and let script auto-select default image directory. - Filename style should be
类型-主题 first, not only plain title. - If
--apply is used, return both plan_file and rollback_file. - If command fails, explain failure in 2 short Chinese sentences and provide next fix.
Setup
Install dependencies:
CODEBLOCK0
Set API key:
CODEBLOCK1
Optional model and endpoint:
CODEBLOCK2
Commands
Describe one image:
CODEBLOCK3
Batch dry-run plan (recommended first step):
CODEBLOCK4
Batch apply rename:
CODEBLOCK5
Auto directory (no explicit --dir, script picks default image directory):
CODEBLOCK6
Rollback by rollback file:
CODEBLOCK7
Notes
- - Supported image extensions: jpg, jpeg, png, webp, bmp, gif, tif, tiff, heic, heif.
- Default naming style:
类型-主题 (for example 邀请函-活动主视觉.jpg). - Duplicate names auto-suffix with
-02, -03 ... - INLINECODE20 writes a JSON plan file every run.
- INLINECODE21 creates rollback JSON for reverse operation.
- If
--dir is omitted, script tries OPENCLAW_RENAME_DEFAULT_DIR, then ~/图片, then ~/Pictures. - On API failure for a single image, the default behavior is skip that file and continue.
Qwen视觉重命名技能
使用此技能进行:
- - 理解图像内容(单张图片)
- 基于内容批量生成本地图像文件夹的文件名
- 支持回滚的直接批量重命名
- 命名模式 类型-主题(示例:邀请函-万人大会主视觉)
运行时行为(严格)
- - qwen-vision-rename 是技能名称,不是内置工具名称。
- 首先使用 read 工具打开此 SKILL.md,然后运行下面的 Python 命令。
- 切勿发出名为 qwen-vision-rename 的工具调用。
- 始终执行脚本。不要伪造识别结果。
- 对于重命名请求,默认直接执行:运行 rename-dir --apply。
- 如果用户明确说预览/试运行/dry-run/先看方案,则运行时不加 --apply。
- 不要为重命名任务调用 qwen-image。
- 类似整理图片/按内容分类整理的请求仍映射到此技能。此技能首先按内容重命名;如果用户明确要求将文件移动到文件夹中,则单独说明。
- 如果用户未提供文件夹路径,运行 rename-dir 时不加 --dir,让脚本自动选择默认图像目录。
- 文件名样式应优先为 类型-主题,而不仅仅是纯标题。
- 如果使用了 --apply,同时返回 planfile 和 rollbackfile。
- 如果命令失败,用两句简短的中文句子解释失败原因并提供下一步修复方案。
设置
安装依赖:
bash
pip3 install -r {baseDir}/requirements.txt
设置 API 密钥:
bash
export DASHSCOPEAPIKEY=yourapikey
可选模型和端点:
bash
export DASHSCOPEBASEURL=https://dashscope.aliyuncs.com/compatible-mode/v1
export DASHSCOPEVISIONMODEL=qwen-vl-max-latest
命令
描述单张图片:
bash
python3 {baseDir}/scripts/vision_rename.py describe \
--image /path/to/image.jpg
批量预演方案(推荐第一步):
bash
python3 {baseDir}/scripts/vision_rename.py rename-dir \
--dir /path/to/images
批量应用重命名:
bash
python3 {baseDir}/scripts/vision_rename.py rename-dir \
--dir /path/to/images \
--apply
自动目录(不指定 --dir,脚本选择默认图像目录):
bash
python3 {baseDir}/scripts/vision_rename.py rename-dir --apply
通过回滚文件回滚:
bash
python3 {baseDir}/scripts/vision_rename.py rollback \
--rollback-file /path/to/rename-rollback-YYYYMMDD-HHMMSS.json
备注
- - 支持的图像扩展名:jpg, jpeg, png, webp, bmp, gif, tif, tiff, heic, heif。
- 默认命名样式:类型-主题(例如 邀请函-活动主视觉.jpg)。
- 重复名称自动添加后缀 -02、-03...
- rename-dir 每次运行都会写入一个 JSON 方案文件。
- --apply 会创建用于反向操作的回滚 JSON。
- 如果省略 --dir,脚本会依次尝试 OPENCLAWRENAMEDEFAULT_DIR、~/图片、~/Pictures。
- 单张图片 API 失败时,默认行为是跳过该文件并继续。