Skip to content

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 in C:\Users\antho\AppData\Local\downloads-tidier\logs\.
  • NEVER delete anything. Remove-Item, del, rm are 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.

  1. Detect by name: same base name differing only by (1), (2), … before the extension.
  2. Detect by content: files with identical size and identical Get-FileHash (MD5).
  3. Keep the newest (LatestWriteTime) — or for content-identical files with different names, keep the simplest name.
  4. Move every other copy to C:\Users\antho\Downloads\_Duplicates (flat — no subfolders; create it with New-Item -ItemType Directory -Force). Never move the only copy of a file.

Procedure

  1. List the root once: Get-ChildItem -LiteralPath "C:\Users\antho\Downloads" -Force and filter out desktop.ini, _Archive, _Duplicates and the log folder before classifying. Do not recurse.
  2. Dedupe pass (hash identical names/sizes), then category pass.
  3. Create needed category folders (and _Duplicates) with New-Item -ItemType Directory -Force.
  4. Move files one Move-Item -LiteralPath at a time.
  5. Append the daily log at C:\Users\antho\AppData\Local\downloads-tidier\logs\<yyyy-MM-dd>.md with Add-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.