Downloads organizer

From spamsch/son-of-simon · View interactive version

Downloads organizer is an AI agent skill from the GitHub repository spamsch/son-of-simon. Organize the ~/Downloads folder by categorizing files and subdirectories into subfolders using AI-driven analysis.

How to use this skill

Skill file

Behavior Notes

Four-Phase Workflow: Survey, Propose, Execute, Organize Subdirectories

Always follow this four-phase approach when organizing Downloads.

Phase 1: Survey

  1. Start with list_directory(summary=True) to get an overview of the folder.
  2. Present the summary to the user (file counts by type, by age, existing subfolders).
  3. If the folder is empty, say "Your Downloads folder is already clean!" and stop.
  4. If the folder has fewer than 10 files, skip to Phase 3 (list them all and propose moves directly).

Phase 2: Propose

Based on the summary, propose folder categories. Only suggest folders for types that are actually present:

Important rules:

Phase 3: Execute (batch by batch)

  1. Create approved folders: run_shell_command(command="mkdir -p ~/Downloads/Category")
  2. Process files type-by-type using list_directory(filter_type="images", limit=50) to get the list.
  3. Move files with run_shell_command(command="mv ~/Downloads/file.png ~/Downloads/Images/").
  4. Handle name conflicts safely: Before moving, check if the target exists. If so, append a number suffix (e.g., report (2).pdf). Use this pattern:

```

dest="~/Downloads/Documents/report.pdf"

if [ -f "$dest" ]; then

base="${dest%.}" ext="${dest##.}"

n=2; while [ -f "${base} (${n}).${ext}" ]; do n=$((n+1)); done

dest="${base} (${n}).${ext}"

fi

mv "source" "$dest"

```

  1. Report progress after each batch: "Moved 23 images to Images/"
  2. If the directory has more files than the limit, paginate with offset to process the next batch.
  3. Report a final summary when done: total files moved, folders created.

Phase 4: Organize Subdirectories

After files are organized, handle leftover subdirectories sitting at the top level of ~/Downloads.

  1. Run list_directory(dirs_only=True, summary=True) to check if there are uncategorized subdirectories.
  2. If there are none (or very few), skip this phase.
  3. Run list_directory(dirs_only=True, limit=50) to get subdirectory details (name, size, item count, contents breakdown).
  4. Use the folder name and Contents: line to guess the best category for each:
  1. Present the proposed moves to the user in a clear table before executing:

```

Proposed subdirectory moves:

```

  1. Wait for user approval before moving anything.
  2. Move with run_shell_command(command="mv ~/Downloads/folder ~/Downloads/Category/").
  3. Handle name conflicts: if ~/Downloads/Category/folder already exists, append a number suffix to the folder name.
  4. If there are more than 50 subdirectories, paginate with offset to process the next batch.

Safety Rules

Edge Cases

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.