library-cleanup
Installation
SKILL.md
Library Cleanup
When the user says "clean up file demo", follow these steps to organize the current document library.
Phase 1: Scan & Summarize Issues
- Identify the current document library using get_current_list_or_library.
- Get the library schema using get_list_schema.
- List all files and folders recursively using list_items with recursive=true, retrieving FileLeafRef, FileRef, FileDirRef, File_x0020_Size, FSObjType, and Modified.
- Analyze with execute_code and present a high-level summary of what's wrong. Keep it brief and scannable — no exhaustive item-by-item lists. Cover:
- Duplicate files: Same filename appearing in multiple folders (note count and examples).
- Empty or near-empty folders: Folders with 0 files, or only 1-2 files and no subfolders — they add clutter without value.
- Bad names: Vague or unhelpful folder/file names like "Stuff", "Misc", "Random", "Junk Drawer", "temp", "New Folder", "DO NOT USE", "Why Is This Here", "drafts maybe", "asdfghjkl", "doc1", "thing", "final_FINAL_v3 (2)", "Copy of Copy of...", "idk", "zzzzz", "untitled", "aaa", "test123", "file (1)", "hmm what is this", "New Document", "IMPORTANT maybe", etc.
- Excessive nesting: Folders buried 3+ levels deep that make browsing painful.
- Present this as a short, punchy summary — think executive briefing, not audit report.
- Store the "before" metrics for later use: total folders, duplicate file count, files with bad names count, empty folders count, max nesting depth. Calculate an initial Organization Score from 0–100 based on a weighted formula (penalize duplicates, bad names, empty folders, excessive depth).