AgentSkillsCN

fileclean

为孤立文件赋予具有描述性的名称与日期,让文件命名更加清晰明了。将文件重命名为“描述性名称.月日年.扩展名”的格式,且绝不删除文件。可通过“/fileclean”指令调用。

SKILL.md
--- frontmatter
name: fileclean
description: >
  Organize orphaned files with descriptive names and dates.
  Renames files to descriptive-name.MMDDYYYY.ext format. Never deletes.
  Invoke with /fileclean.

File Clean

Commands

  • /fileclean <directory> — Scan and rename files in specified directory
  • /fileclean ~/Downloads — Common use: clean up Downloads folder
  • /fileclean --dry-run <directory> — Show rename plan without executing

Procedure

Phase 1: Scan

  1. List all files in target directory
  2. Identify files with unhelpful names (IMG_, Screenshot, Document*, unnamed*, random hashes)
  3. Read file metadata (creation date, type, size)
  4. For text/doc files, read first few lines to understand content

Phase 2: Plan

Generate rename plan:

  • Current name -> Proposed name
  • Format: descriptive-name.MMDDYYYY.ext
  • The descriptive name comes from file content, type, or context
  • The date is the file's creation or modification date
  • Preserve original extension

Phase 3: Present

Show the full rename plan as a table:

CurrentProposedReason
IMG_4521.pngoffice-whiteboard-notes.02142026.pngPhoto of whiteboard
Document (3).pdfmastercard-sow-draft.02102026.pdfSOW document content

Phase 4: Confirm

Wait for user approval. Allow user to:

  • Accept all
  • Modify specific renames
  • Skip specific files
  • Cancel entirely

Phase 5: Execute

Rename files using safe operations (copy then verify then remove original). Report results.

Safety Rules

  • NEVER delete any files — rename only
  • NEVER overwrite existing files — add suffix if name collision
  • Always show plan and get confirmation first
  • Preserve file extensions exactly
  • Keep original permissions and metadata