Skip to content

@tank/folder-organizer

1.0.0
Skill

Description

Scan directories, categorize files by type/date/project, propose organization plans with user confirmation, then move files into clean folder structures. Handles Downloads, Desktops, developer workspaces.

Triggered by

organize foldersort filesclean up downloadstidy filescategorize filesdeclutter
Download
Verified
tank install @tank/folder-organizer

Folder Organizer

Core Philosophy

  1. Never move without confirmation — Present the full plan, get explicit approval. One wrong move can lose hours of search time.
  2. Respect existing structure — Scan for existing subfolders before proposing new ones. Use the user's folder names, not yours.
  3. Extension is the fast path, AI is the slow path — 90% of files categorize instantly by extension. Use judgment only for ambiguous cases like data.json vs package.json.
  4. Always log for undo — Write every move to an undo log before executing. The user must be able to reverse any organization.
  5. Suggest, never auto-delete — Flag cleanup candidates (temp files, duplicates, old downloads) but let the user decide.

Quick-Start: Common Problems

"Organize my Downloads folder"

  1. Scan ~/Downloads for all files (non-recursive)
  2. Detect existing subfolders to avoid conflicts
  3. Filter out system files (.DS_Store, Thumbs.db)
  4. Flag cleanup candidates (incomplete downloads, duplicates, old files)
  5. Categorize remaining files by extension -> See references/file-categories.md
  6. Select the downloads strategy (aggressive cleanup mode) -> See references/organization-strategies.md
  7. Present plan with categories, file counts, and cleanup candidates
  8. Get user confirmation (approve / edit / cancel)
  9. Execute moves with undo log -> See references/workflow-guide.md

"Sort these files by date"

  1. Scan target directory
  2. Collect modification dates for all files
  3. Apply by-date strategy: YYYY/MM-MonthName/ structure
  4. For photos, prefer EXIF date over filesystem date if available
  5. Present plan, confirm, execute -> See references/organization-strategies.md

"Group files by project"

  1. Scan target directory
  2. Detect shared prefixes in filenames (split on -, _, spaces)
  3. Group files with common prefixes (3+ chars, 2+ files)
  4. Present detected groups, ask user to name ambiguous ones
  5. Unmatched files fall back to by-type categorization -> See references/organization-strategies.md

"Undo the last organization"

  1. Find latest undo log in ~/.folder-organizer/undo/
  2. Show what will be reversed (file count, original locations)
  3. Confirm with user
  4. Move files back to original locations
  5. Remove empty category folders -> See references/workflow-guide.md

The Five-Phase Workflow

Every organization follows this sequence. Never skip Phase 4 (Confirm).

PhaseActionKey output
1. ScanCollect file metadata from targetFile list with names, sizes, dates
2. AnalyzeCategorize, detect patterns, flag issuesCategory assignments, cleanup candidates
3. ProposePresent organization planFormatted plan with counts per category
4. ConfirmGet user approval with edit optionsApproved plan (possibly modified)
5. ExecuteMove files, log operationsMoved files + undo log path

-> See references/workflow-guide.md for detailed procedures.

Decision Trees

Strategy Selection

SignalStrategy
User says "by type" or no preferenceby-type — flat category folders
User says "by date" or folder is mostly photosby-date — YYYY/MM/ structure
User says "by project" or files share name prefixesby-project — group by detected projects
Target is ~/Downloadsdownloads — aggressive with cleanup
User says "keep my structure"merge — only file loose files
Lots of code files detecteddeveloper — language-aware grouping

Conflict Resolution

SituationDefault action
Same filename exists at destinationAdd numeric suffix: file (1).pdf
User says "don't overwrite"Skip the file
User says "overwrite"Replace (per-file confirmation)
Filename too long for filesystemTruncate name, preserve extension

File Ambiguity

ExtensionIf filename matches...Category
.mdREADME, CHANGELOG, CONTRIBUTINGCode
.mdEverything elseDocuments
.jsonpackage.json, tsconfig.json, etc.Code
.jsonexport.json, backup.json, etc.Data
.csvNear code files (package.json nearby)Code
.csvStandaloneSpreadsheets

When uncertain, ask the user rather than guessing.

Safety Rules

  • Write undo log BEFORE starting any moves
  • Never auto-delete files — only suggest cleanup
  • Verify source files still exist before each move
  • Check disk space before cross-volume moves
  • Report skipped files with reasons after completion
  • Show undo log path in completion message

Reference Index

FileContents
references/file-categories.mdExtension-to-category mapping, MIME fallbacks, ambiguous files, ignore lists
references/organization-strategies.mdStrategy selection, presets (by-type, by-date, by-project, developer, downloads, merge)
references/workflow-guide.mdFive-phase workflow details, conflict resolution, undo support, batch processing

Command Palette

Search packages, docs, and navigate Tank