360 Secure SkillHub
360 安全技能中心

File Organizer Skill

通过 python3 脚本把指定目录中的文件按扩展名(默认)或日期(年/月)移动分组到子文件夹,遇同名冲突自动重命名,支持 Dry-Run 预演、递归扫描,并依据 organize_history.json 撤销操作;可修改 get_default_mapping() 添加自定义扩展名。

1999azzar
1999azzar
热度 99.50
最近更新 2026-05-17 11:56:07
分类:效率依赖:代码执行 / 读写文件应用场景:工作流 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add file-organizer-skill
Metadata
name
file-organizer-skill
description
Organize files in directories by grouping them into folders based on their extensions or date. Includes Dry-Run, Recursive, and Undo capabilities.

File Organizer (Gold Standard)

Features

  • Smart Sorting: Group by Extension (Default) or Date (Year/Month).
  • Safety: Conflict resolution (auto-rename), Dry Run mode, and Undo capability.
  • Deep Clean: Recursive scanning option.
  • Audit: Generates organize_history.json for tracking.

Usage

Basic Sort (by Extension)

python3 scripts/organize.py /path/to/folder

Date Sort (Year/Month)

Great for photos or archives.

python3 scripts/organize.py /path/to/folder --date

Dry Run (Simulate)

See what would happen without moving anything.

python3 scripts/organize.py /path/to/folder --dry-run

Undo

Revert changes using the history file.

python3 scripts/organize.py --undo /path/to/folder/organize_history.json

Config

Modify scripts/organize.py get_default_mapping() to add custom extensions.