This skill provides file and folder management capabilities.
Core Features
1. File Operations
- Create files
- Copy/move files
- Rename files
- Delete files
2. Folder Operations
- Create folders
- List directory contents
- Delete folders (recursive)
- Copy folders
3. Batch Processing
- Classify by type
- Batch rename
- Find duplicate files
- Organize the Downloads folder
Safety Rules
Prohibited Operations
- System directories (/System, /usr, /bin, etc.)
- Other users' files
- Delete operations without explicit confirmation
Requires Confirmation
- List the contents to be deleted before deleting files
- Warn before overwriting existing files
- Show a preview before batch operations
Common Operation Examples
Organize the Downloads folder
# 1. 创建分类目录
mkdir -p ~/Downloads/{Documents,Images,Videos,Archives,Others}
# 2. 按扩展名移动
mv ~/Downloads/*.pdf ~/Downloads/Documents/
mv ~/Downloads/*.{jpg,png,gif} ~/Downloads/Images/
mv ~/Downloads/*.{mp4,mov,avi} ~/Downloads/Videos/
mv ~/Downloads/*.{zip,rar,7z} ~/Downloads/Archives/
Batch rename
import os
from pathlib import Path
def batch_rename(directory, pattern, replacement):
for file in Path(directory).iterdir():
if pattern in file.name:
new_name = file.name.replace(pattern, replacement)
file.rename(file.parent / new_name)
Output Format
Show a preview before the operation:
即将执行以下操作:
- 移动 15 个 PDF 文件到 Documents/
- 移动 23 个图片文件到 Images/
- 跳过 3 个未知类型文件
确认执行?
Show the result after the operation:
✓ 操作完成
- 移动: 38 个文件
- 跳过: 3 个文件
- 错误: 0 个