AI Agent Hub
Back to skills
Automatic File Sorting and Organization icon

Automatic File Sorting and Organization

IT Ops & Security Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please install @user_07cf52b5/jingmao-jk2-zjk-103 according to https://skillhub.cn/install/skillhub.md.

About this skill

Problem

Engineers often end up with a mixed top-level directory after delivery, backup, or migration: requirements, screenshots, source code, archives, and videos sit side by side. Manually sorting by extension is easy to miss and can clutter the original layout. This skill targets folder cleanup where files should be scanned, moved into category folders, and kept as originals.

How It Works

It treats the target directory as the top-level workspace and classifies files by extension using deterministic rules:
- Documents: .doc, .docx, .pdf, .txt, .md
- Images: .jpg, .png, .gif, .svg, .webp, .jpeg
- Code: .js, .py, .html, .css, .ts, .java, .c, .cpp
- Archives: .zip, .rar, .7z, .tar, .gz
- Videos: .mp4, .avi, .mov, .mkv, .flv
- Others: extensions not listed above

During execution, it reads files in the specified folder and ignores subfolders themselves, creates the corresponding subdirectories for each category, then batch-moves files while skipping existing folders to avoid duplicate work. After completion, it outputs a report with total scanned files, counts per category, and final paths.

Boundaries

This is useful for one-off cleanup of temporary, delivery, or backup folders, but it is not intended for content parsing, broken-file repair, renaming standards, or recursive subfolder cleanup. Because routing is extension-based, check case-sensitive extensions, hidden files, special permissions, and symbolic links before running it.

Use Cases

  • Move delivery-folder docs, images, code, and archives into subfolders and report counts
  • Organize backup folders with mixed images, videos, and source files by moving, not deleting
  • Classify a temp task folder's Markdown, PDF, source code, and archives into type folders
  • Separate vendor-delivered videos, images, docs, and unknown files into distinct folders

Best For

  • Engineering lead who must verify vendor deliverables by sorting mixed folders by file type
  • Ops engineer who needs to archive new docs, images, and videos from backup directories into fixed subfolders
  • Delivery specialist who must separate client PDFs, images, source code, and archives without deleting originals
  • Project assistant who needs to create extension-based category folders during project migration