| name | file-organizer |
|---|---|
| description | Use when user wants to organize files, move files, clean up downloads, categorize files, add tags, rename files, or detect duplicates - provides file organization with YAML-based rules |
| allowed-tools | Bash, Glob, Read, AskUserQuestion |
Helps you organize file systems with YAML-based rules for automated operations.
- File Moving: Move files by type/source/pattern to designated directories
- File Renaming: Remove garbled characters, unify formats, standardize naming
- Mac Tags: Add color tags and custom text labels to files
- Duplicate Detection: Find duplicate files by content/name and process by rules
- AI Insights: Analyze directories and intelligently recommend organization rules
Use the tag command-line tool for tag operations.
| Color |
|---|
| gray |
| green |
| purple |
| blue |
| yellow |
| red |
| orange |
# Add tag (color + text)
# Format: tag --add "label"$'\n'"color_code" file
# Color codes: 1=gray, 2=green, 3=purple, 4=blue, 5=yellow, 6=red, 7=orange
# Example: Red "To Delete" tag
tag --add "To Delete"$'\n'"6" /Users/alien/Downloads/README.md
# Example: Blue "Invoice" tag
tag --add "Invoice"$'\n'"4" file.pdf
# List tags on a file
tag --list file
# List all used tags
tag --usageWhen executing tag operations, use the tag command:
tag --add "label"$'\n'"color_code" <file_path>Automatically triggers when you say:
- "整理下载目录" (organize downloads)
- "整理桌面" (organize desktop)
- "移动文件" (move files)
- "清理重复文件" (clean duplicates)
- "给文件打标签" (tag files)
- "分析一下我的下载目录" (analyze my downloads)
/file-organizer- Manual skill invocation
1. Skill starts → 2. Check rules → 3. Rules exist? Execute : Guide to create → 4. Preview → 5. Confirm execution
The skill automatically checks ~/.file-organizer/rules/ for valid rules on startup.
If no rules exist, the skill will:
- Ask which directory you want to organize
- Use AI to analyze directory contents
- Provide rule suggestions
- Save rules and execute after your confirmation
- Python 3.8+
- macOS
tagcommand-line tool (required for Mac Tag functionality)
brew install tagPre-first-use check:
Before first use, check if tag command is installed:
which tag || brew install tagThe skill will automatically create config directories:
~/.file-organizer/rules/- Rule files~/.file-organizer/logs/- Operation logs~/.file-organizer/config.yaml- Configuration file
Location: ~/.file-organizer/config.yaml
# Preview mode (true=preview, false=execute)
dry_run: true
# Scan directories
scan_paths:
- ~/Downloads
- ~/Documents
- ~/Desktop
# Log level
log_level: inforules:
- name: "WeChat PDF Organization"
condition:
path: "~/Downloads"
extension: ["pdf", "doc", "docx"]
pattern: "WeChat|微信"
action:
move: "~/Documents/WeChat"
create_if_missing: true
tag:
color: "blue"
label: "WeChat"condition options:
path: Source directory path (supports ~ shorthand)extension: Array of file extensions, e.g.,["xlsx", "xls"]pattern: Regex or keyword pattern for filename matchingsize_gt: Greater than specified size, e.g.,100MB
action options:
move: Target directory pathcreate_if_missing: Whether to create target directorytag.color: Mac tag color (gray, red, orange, yellow, green, blue, purple)tag.label: Tag text label
rules:
- name: "Remove duplicate parentheses"
condition:
pattern: "((\\d+))|\\((\\d+)\\)"
action:
replace: "-"
prefix: ""
suffix: ""
separator: "-"rules:
- name: "Large file tag"
condition:
size_gt: 100MB
action:
tag:
color: "red"
label: "Large File"rules:
- name: "Duplicate handling"
check_by: "content" # content or name
action:
keep: "newest" # newest, oldest, first
tag_duplicates: true
duplicate_label: "Duplicate""帮我整理下载目录" (Help me organize downloads)
→ Scan ~/Downloads
→ Apply rules, show preview
→ You say "执行" (execute) → Execute operations
"分析一下我的下载目录有什么" (Analyze what's in my downloads)
→ AI analyzes directory contents
→ Provides rule suggestions
→ Save and execute after your confirmation
"把微信的 PDF 移到 Documents" (Move WeChat PDFs to Documents)
→ Scan ~/Downloads
→ Match PDF + WeChat
→ Preview operations
→ Execute
"重命名所有包含 (1) 的文件" (Rename all files containing (1))
→ Scan matching files
→ Preview rename results
→ Execute
"检查下载目录的重复文件" (Check duplicates in downloads)
→ Detect by content/name
→ Show duplicate file list
→ You choose which to keep
- Scan source directory
- Apply rules
- Show operation summary
- Wait for you to say "执行" (execute) or "确认" (confirm)
After you say "执行", "确认":
- Execute operations one by one
- Show execution results
- Log to file
- Check if match rules are correctly configured in SKILL.md
- Try manual invocation with
/file-organizer
- Check YAML syntax is correct
- Confirm rule files are in
~/.file-organizer/rules/directory - Use
--verbosefor detailed information
- Confirm running on macOS
- Check if AppleScript is available
- Check if target directory has write permissions
- Confirm sufficient disk space