downloads-tidier
Tidy the user's Downloads folder into category folders (Books, CourtLegal, ResearchNotes, Installers, Archives, Documents), quarantining duplicate downloads into _Duplicates and logging every move. Use when the user says "tidy my downloads", "clean the downloads folder", or on the daily scheduled run.
Source: .opencode/skills/downloads-tidier/SKILL.md — site rebuilt 2026-09-05.
Downloads Tidier¶
Tidy C:\Users\antho\Downloads once a day (or on request): file loose downloads into category folders, quarantine duplicates, never delete anything, and append a log of every action.
Scope and hard rules¶
- Target folder only:
C:\Users\antho\Downloads. Never look at, read, or move anything outside it except the log file inC:\Users\antho\AppData\Local\downloads-tidier\logs\. - NEVER delete anything.
Remove-Item,del,rmare denied — you cannot delete even if you try. Do not try. - Do not move, rename, or reorganise anything already inside a category folder,
_Archive,_Duplicates, or the log folder. Files already filed stay put (idempotent runs). - Never rename a file while moving it — exact names only.
- One
Move-Item -LiteralPath <src> -Destination <folder>per file. Never batch several files into one command. - If a command is denied or fails, skip that action, log it under ERRORS, and continue.
- If you cannot classify a file with reasonable confidence, leave it in the Downloads root and log it under UNMATCHED.
- Never guess file contents from the web; classify by filename, extension, size and date only.
Category folders (create on demand inside Downloads)¶
| Folder | Rules |
|---|---|
Books |
Ebooks and their text companions: filenames with the -- separator and isbn13 or Anna (Anna's Archive downloads), .epub/.mobi, book .txt/.pdf companions matching an Anna-style name (OUP, SAGE, John Benjamins, Cambridge, Routledge, etc.), any long-title academic book pdf (linguistics, law, counselling). |
CourtLegal |
Court documents, legal correspondence, contracts, invoices: names containing inventory, productions, rule, note, PAI, terms, conditions, invoice, complaint, rebuttal, recommendation, or a 5-digit matter reference (e.g. 44003 ...), NEC4/JCT/contract files. |
ResearchNotes |
.md files: case-law research, notes, analysis, draft outputs. |
Installers |
.exe, .msi, .bat installers and setup files. |
Archives |
.zip, .rar, .7z, .tar, .gz, plus extracted folders whose name matches a sibling archive (e.g. 01-BACP-20260809T193207Z-1-001 from 01-BACP-20260809T193207Z-1-001.zip). |
Documents |
Everything else that is clearly a work file: .docx, .doc, .xlsx, .xls, .pptx, .ipynb, .csv, .txt (unless a book companion), .pdf not covered by CourtLegal/Books, and other recognisable office/code files. |
Anything not covered (odd extensions, ambiguous names, temp-scratch-looking items) → leave in root, log under UNMATCHED.
Duplicates first¶
Run the dedupe pass before the category pass.
- Detect by name: same base name differing only by
(1),(2), … before the extension. - Detect by content: files with identical size and identical
Get-FileHash(MD5). - Keep the newest (LatestWriteTime) — or for content-identical files with different names, keep the simplest name.
- Move every other copy to
C:\Users\antho\Downloads\_Duplicates(flat — no subfolders; create it withNew-Item -ItemType Directory -Force). Never move the only copy of a file.
Procedure¶
- List the root once:
Get-ChildItem -LiteralPath "C:\Users\antho\Downloads" -Forceand filter outdesktop.ini,_Archive,_Duplicatesand the log folder before classifying. Do not recurse. - Dedupe pass (hash identical names/sizes), then category pass.
- Create needed category folders (and
_Duplicates) withNew-Item -ItemType Directory -Force. - Move files one
Move-Item -LiteralPathat a time. - Append the daily log at
C:\Users\antho\AppData\Local\downloads-tidier\logs\<yyyy-MM-dd>.mdwithAdd-Content(append only — never overwrite an existing log): sections MOVED (src → dest), DUPLICATES QUARANTINED, UNMATCHED, ERRORS. If the log file does not exist, create it with a title line first (Out-File with the first line is fine for creation only).
Report¶
Close with a one-line summary: N moved, M duplicates quarantined, K unmatched, E errors.