← 返回 Skills 市场
397
总下载
0
收藏
3
当前安装
1
版本数
在 OpenClaw 中安装
/install batch-rename
功能描述
Rename image datasets and annotations with custom patterns, prefixes, suffixes, and sequential numbering, including preview and undo support.
使用说明 (SKILL.md)
Batch Rename
Batch rename images and corresponding annotation files with customizable patterns. Use when user needs to rename image datasets with sequential numbers, prefixes, or custom patterns.
Features
- Sequential Numbering: Add sequential numbers to filenames
- Custom Prefix/Suffix: Add prefix or suffix to filenames
- Annotation Aware: Rename corresponding annotation files together
- Handle Missing: Gracefully handle images without annotation files
- Preview Mode: Preview changes before applying
- Undo Support: Restore original filenames
Usage
# Rename with sequential numbers
python scripts/rename.py rename /path/to/images/ --pattern "img_{:04d}"
# Rename with prefix
python scripts/rename.py rename /path/to/images/ --prefix "dataset1_"
# Rename images and annotations together
python scripts/rename.py rename /path/to/images/ --pattern "img_{:04d}" --annotations /path/to/labels/
# Preview first
python scripts/rename.py rename /path/to/images/ --pattern "img_{:04d}" --preview
Examples
$ python scripts/rename.py rename ./images --pattern "img_{:04d}" --annotations ./labels
Found 100 images
Preview (first 10):
image1.jpg -> img_0001.jpg
image2.jpg -> img_0002.jpg
image3.jpg -> img_0003.jpg
...
Apply changes? (y/n): y
✓ Renamed 100 images
✓ Renamed 95 annotation files
Pattern Options
{:04d}- Sequential number with leading zeros{date}- Current date (YYYYMMDD){original}- Original filename without extension
Installation
No additional installation required.
Options
--pattern: Output filename pattern--prefix: Add prefix to filename--suffix: Add suffix to filename--start: Starting number for sequential renaming--annotations: Path to annotation files (will be renamed together)--preview: Preview changes without applying--force: Overwrite existing files
安全使用建议
This skill appears to implement local batch renaming and doesn't request secrets or network access, but there are important mismatches you should address before using it on real data: (1) The README promises undo support, but the rename command never creates the .rename_backup.json file the restore command would need — so you cannot rely on the built-in undo. (2) Patterns are applied with pattern.format(positional_number) then string replacement for {original}/{date}; if your pattern doesn't include the numeric placeholder (e.g., you use only {original}) the script will likely raise a formatting error. Practical steps: (a) run the script in --preview mode and test on a small copy of your dataset first; (b) keep manual backups (copy the directory) before applying changes; (c) if you need true undo, modify the rename command to write a .rename_backup.json mapping before renaming (or ask the author to fix it); (d) stick to patterns like 'img_{:04d}{original}' that include the numeric placeholder, or review/adjust the code to support named placeholders safely. If the author updates the code to reliably write backups and to clearly document supported pattern syntax, the inconsistencies would be resolved and my assessment would become benign.
功能分析
Type: OpenClaw Skill
Name: batch-rename
Version: 1.0.0
The skill is a standard utility for batch renaming image datasets and associated annotation files. The script (scripts/rename.py) uses safe pathlib operations for file manipulation and lacks any network connectivity, credential access, or code execution capabilities. While the 'restore' command references a backup file that the 'rename' command currently fails to generate (a functional bug), there is no evidence of malicious intent, data exfiltration, or prompt injection.
能力评估
Purpose & Capability
Name/description match the provided code and SKILL.md: the Python script implements batch rename of images and (optionally) annotation files with preview and overwrite options. No unrelated binaries, env vars, or network access are requested.
Instruction Scope
SKILL.md advertises 'Undo Support' and a restore workflow. The script includes a restore command that reads .rename_backup.json, but the rename implementation never writes that backup file — so 'undo' is not actually implemented. Additionally, SKILL.md documents pattern placeholders like {original} and {date}, but the script first calls pattern.format(...) with a positional numeric argument then applies string replacements for {original}/{date}; patterns lacking a numeric placeholder (e.g., using only {original}) will raise a formatting error. These are functional inconsistencies between the instructions and code.
Install Mechanism
Instruction-only skill with an included Python script; no install spec or downloads. No files are fetched from external URLs and nothing is written to system locations by an installer.
Credentials
No environment variables, credentials, or config paths are requested. The script performs only local filesystem operations in the provided directories.
Persistence & Privilege
The skill does not request permanent presence (always is false) and does not modify other skills or global agent settings. It only operates on user-supplied directories when invoked.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install batch-rename - 安装完成后,直接呼叫该 Skill 的名称或使用
/batch-rename触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of batch-rename skill.
- Batch rename images with sequential numbering, prefixes, or custom patterns.
- Supports renaming corresponding annotation files together.
- Handles images without annotation files gracefully.
- Includes preview mode to review changes before applying.
- Undo support added to restore original filenames.
元数据
常见问题
Batch Rename 是什么?
Rename image datasets and annotations with custom patterns, prefixes, suffixes, and sequential numbering, including preview and undo support. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 397 次。
如何安装 Batch Rename?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install batch-rename」即可一键安装,无需额外配置。
Batch Rename 是免费的吗?
是的,Batch Rename 完全免费(开源免费),可自由下载、安装和使用。
Batch Rename 支持哪些平台?
Batch Rename 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Batch Rename?
由 Mingo_318(@mingo-318)开发并维护,当前版本 v1.0.0。
推荐 Skills