file-organizer

majiayu000's avatarfrom majiayu000

Organises files and folders by understanding context, finding duplicates, suggesting structures, and automating cleanup. Use when user mentions messy Downloads, can't find files, duplicate files, folder structure problems, cleanup tasks, or asks to organise/sort/tidy files and directories.

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 5, 2026

When & Why to Use This Skill

The File Organizer skill is an intelligent agent designed to automate local file system management and digital decluttering. It leverages advanced context-awareness to analyze directory structures, identify duplicate files via hash-based verification, and implement logical organization patterns based on file types, dates, or project relevance. By transforming chaotic folders into structured environments, it helps users reclaim storage space and significantly improve information retrieval efficiency while maintaining strict data safety protocols.

Use Cases

  • Automated Downloads Cleanup: Quickly sort a bloated Downloads folder by categorizing files into logical sub-folders like Documents, Images, and Installers while archiving or removing outdated setup files.
  • Secure Duplicate Removal: Identify and eliminate identical files across multiple directories using hash-based detection to ensure 100% accuracy before reclaiming disk space.
  • Project Directory Restructuring: Reorganize messy project folders into consistent hierarchies (e.g., Active vs. Archive) to improve workflow focus and team collaboration.
  • Chronological Media Sorting: Automatically organize large collections of photos and videos into a structured Year/Month folder system based on metadata or file creation dates.
  • Storage Optimization: Detect and summarize large or ancient files that haven't been accessed in months, providing a clear plan for archiving or deletion to free up system resources.
namefile-organizer
descriptionOrganises files and folders by understanding context, finding duplicates, suggesting structures, and automating cleanup. Use when user mentions messy Downloads, can't find files, duplicate files, folder structure problems, cleanup tasks, or asks to organise/sort/tidy files and directories.

File Organizer

Helps maintain clean, logical file structures without manual overhead.

Workflow

1. Scope the Task

Ask if unclear:

  • Which directory? (Downloads, Documents, specific path?)
  • Main problem? (Chaos, duplicates, no structure, can't find things?)
  • Anything to avoid? (Active projects, sensitive folders?)
  • How aggressive? (Conservative vs comprehensive?)

2. Analyse Current State

Use Desktop Commander to survey:

# Overview
Get-ChildItem -Path $targetPath -Recurse | Measure-Object

# File types breakdown
Get-ChildItem -Path $targetPath -Recurse -File | Group-Object Extension | Sort-Object Count -Descending

# Largest files
Get-ChildItem -Path $targetPath -Recurse -File | Sort-Object Length -Descending | Select-Object -First 20 FullName, @{N='SizeMB';E={[math]::Round($_.Length/1MB,2)}}

# Old files (not modified in 6 months)
Get-ChildItem -Path $targetPath -Recurse -File | Where-Object { $_.LastWriteTime -lt (Get-Date).AddMonths(-6) }

Summarise: total files, type breakdown, size distribution, obvious issues.

3. Identify Organisation Patterns

Group by what makes sense for the content:

By Type: Documents, Images, Videos, Archives, Code, Spreadsheets, Installers By Purpose: Work/Personal, Active/Archive, Project-specific, Reference, Temporary By Date: Current year, Previous years, Ancient (archive candidates)

4. Find Duplicates (when requested)

# Find by identical hash
Get-ChildItem -Path $targetPath -Recurse -File | Get-FileHash | Group-Object Hash | Where-Object { $_.Count -gt 1 }

# Find by name
Get-ChildItem -Path $targetPath -Recurse -File | Group-Object Name | Where-Object { $_.Count -gt 1 }

For each duplicate set: show paths, sizes, dates, recommend which to keep. Always confirm before deleting.

5. Propose Organisation Plan

Present before making changes:

## Current State
- X files across Y folders
- [Size] total
- Issues: [list]

## Proposed Structure
[Show folder tree]

## Changes
1. Create folders: [list]
2. Move files: [summary by category]
3. Archive: [old files]
4. Delete: [duplicates - with confirmation]

## Needs Your Decision
- [Ambiguous files]

Ready to proceed?

6. Execute

After approval:

  • Create folder structure first
  • Move files systematically
  • Log all operations
  • Confirm before any deletion
  • Stop and ask if anything unexpected

7. Summarise

## Complete

- Created X folders
- Organised Y files  
- Freed Z GB (duplicates)
- Archived W old files

## New Structure
[Folder tree]

## Maintenance Tips
- Weekly: Sort new downloads
- Monthly: Review completed projects
- Quarterly: Check for duplicates

Common Patterns

Downloads Cleanup: Sort by type (docs→Documents, images→Pictures, installers→separate), archive old files.

Project Organisation: Separate Active from Archive, consolidate duplicates, consistent naming.

Duplicate Removal: Hash-based detection, keep newest/best-named, confirm each deletion.

Photo Organisation: By EXIF date or file date into Year/Month structure.

Key Rules

  1. Never delete without confirmation - even obvious duplicates
  2. Preserve modification dates when moving
  3. Stop on unexpected situations - don't assume
  4. Log operations for potential undo
  5. Archive before delete when in doubt