SkilVaultSign inStart free

Catalogue / file-cleanup-organizer

file-cleanup-organizer

Older skill: source not recordedSignedBrings order to messy folders: inventories what is there, groups files by type, purpose or date, finds true duplicates by content hash, and presents an exact move/rename/archive plan for approval before touching anything. Use when the user says "my Downloads folder is a mess", "find duplicate files"…
---
name: file-cleanup-organizer
description: >-
  Brings order to messy folders: inventories what is there, groups files by
  type, purpose or date, finds true duplicates by content hash, and presents an
  exact move/rename/archive plan for approval before touching anything. Use
  when the user says "my Downloads folder is a mess", "find duplicate files",
  "organize my photos by month", "clean up my Desktop", or "restructure my
  Projects folder". Not for deleting files just because they look old, merging
  projects with similar names, or mass-managing a whole machine unprompted.
---

Folder Cleanup Playbook

A four-beat method — inventory, group, verify duplicates, propose — that keeps every irreversible step behind the user's explicit yes.

1. Scope the job

Ask before listing anything beyond the obvious:

  • Which directory? Downloads, Documents, one project — start small; a whole

home folder is a bigger commitment than a first pass.

  • What hurts most? Can't find things, duplicates eating space, no structure.
  • Off-limits? Active projects, client data, anything sensitive.
  • How aggressive? Conservative (sort only) vs. comprehensive (dedupe +

archive + rename).

2. Inventory before proposing

Read-only survey commands:

ls -la Downloads/                                   # top-level overview
find Downloads/ -type f | sed 's/.*\.//' | sort | uniq -c | sort -rn   # type census
du -sh Downloads/* | sort -rh | head -20            # biggest items
find Downloads/ -type f -mtime +90 | wc -l          # how much is stale

Summarize: total files, type breakdown, size distribution, date range, and the two or three visible structural problems. This summary drives every later decision, so share it with the user.

3. Choose a grouping that fits the content

| Situation | Grouping that usually works | |---|---| | Downloads | By type, plus Installers/ and a ToSort/ for undecided items | | Documents | Work vs. Personal, then by project or topic | | Projects | Active/ vs. Archive/<year>/, plus Templates/ | | Photos | Year → month, from EXIF capture date; fall back to modification date, clearly labeled, with an Unsorted/ bucket | | Shared team folders | By team/function first, then project |

Naming conventions that keep the result maintainable:

  • Folders: descriptive and specific (client-proposals, not docs); hyphens

over spaces; ordering prefixes like 01-current, 02-archive where order matters.

  • Files: leading dates (2026-09-14-quarterly-review.md); strip download

artifacts (report-final-v2 (1).pdf → report.pdf) only when the duplicate check confirms which copy is canonical.

  • Prefer archiving over deleting anything the user hesitates on.

4. Duplicates: candidates, then proof

Same filename or similar size is a candidate, not a verdict. Hash contents and group independently of names:

from pathlib import Path
import hashlib

def duplicate_sets(root: Path) -> list[list[Path]]:
    groups: dict[tuple[int, str], list[Path]] = {}
    for path in root.rglob("*"):
        if path.is_symlink() or not path.is_file():
            continue
        h = hashlib.sha256()
        with path.open("rb") as fh:
            for block in iter(lambda: fh.read(1 << 20), b""):
                h.update(block)
        groups.setdefault((path.stat().st_size, h.hexdigest()), []).append(path)
    return [paths for paths in groups.values() if len(paths) > 1]

For each confirmed set, present it like this and let the user choose:

## Duplicate set: "proposal.pdf" (2.3 MB × 3)

- ~/Documents/proposal.pdf          — modified 2026-03-15
- ~/Documents/old/proposal.pdf      — modified 2026-03-15
- ~/Desktop/proposal.pdf            — modified 2026-03-10

Recommend keeping ~/Documents/proposal.pdf (correct location, newest).
Delete the other two copies?

"Newest wins" is a default suggestion, not a rule — the copy in the right project folder may matter more than the timestamp. Never merge similarly named project folders without checking they really are versions of the same thing.

5. Present the plan, wait for approval

Show a complete manifest before executing anything:

# Plan for ~/Downloads

## Proposed structure
Downloads/
├── Work/
├── Personal/
├── Installers/
├── Archive/
└── ToSort/

## Changes
1. Create 5 folders
2. Move 180 PDFs → Work/ or Personal/ (list attached)
3. Rename 12 files to YYYY-MM-DD pattern
4. Archive 64 files older than 3 months
5. DELETE 8 duplicate files (sets listed above) — needs your yes

## Your call
- receipt-scan-0042.jpg: invoice or personal? I can't tell.

Deletion is always its own explicit approval, per set — never bundled into a general "organize it" yes.

6. Execute carefully

  • mkdir -p for the tree, then move file-by-file with a log of old → new paths.
  • Never overwrite on a name collision — rename or stop and ask.
  • Preserve original modification timestamps (a plain mv does).
  • Watch filesystem boundaries when moving across volumes.
  • On anything unexpected — an undecipherable file, a hidden second copy of a

project — stop and report rather than improvising.

7. Report, then set up upkeep

Afterward, verify against the manifest and report: folders created, files moved/renamed/archived, duplicates actually deleted and real bytes freed (not estimated), unresolved items, and the resulting tree. Explain how to undo via the action log.

Suggest a cadence the user can keep: weekly Downloads sort, monthly project review, quarterly duplicate sweep, yearly archive pass. "Older than N months" is a review trigger, not a disposal rule.

Never

  • Delete anything — duplicates, old files, "junk" — without the user approving that exact set.
  • Overwrite a file on name collision instead of renaming or asking.
  • Merge folders that merely share a name prefix without verifying they hold the same project.
  • Treat modification date as proof of importance or last use.
  • Scan into sensitive or out-of-scope directories (or follow symlinks out of the target tree) without permission.