| name | filesystem |
| description | Direct filesystem operations (read, write, edit, list, search files). Use for any file manipulation tasks. |
Filesystem Skill
Overview
Direct filesystem operations without external dependencies. Read, write, edit, list, copy, move, and search files.
Usage
Use the available builtin tools to perform file operations directly. Commonly used tools for this skill are: list_dir, read_file, file_create, edit_file_by_lines, grep, and bash.
When the task requires programmatic/structured processing (e.g., parsing complex formats or batch transformations), python_repl can be used as an advanced fallback.
- Paths can be absolute or relative to working_dir
- Parent directories are created automatically for write operations
- For complex file operations not covered by builtin tools, use
bash
Common Recipes
JSON
import json
with open('data.json', 'r', encoding='utf-8') as f:
data = json.load(f)
with open('output.json', 'w', encoding='utf-8') as f:
json.dump(data, f, indent=2, ensure_ascii=False)
CSV
import csv
with open('data.csv', 'r', encoding='utf-8') as f:
reader = csv.DictReader(f)
for row in reader:
print(row)
with open('output.csv', 'w', newline='', encoding='utf-8') as f:
writer = csv.DictWriter(f, fieldnames=['name', 'value'])
writer.writeheader()
writer.writerows([{'name': 'a', 'value': 1}])
YAML
import yaml
with open('config.yaml', 'r') as f:
data = yaml.safe_load(f)
with open('output.yaml', 'w') as f:
yaml.dump(data, f, default_flow_style=False, allow_unicode=True)
Directory Operations
find . -type f -name "*.py"
du -sh /path/to/dir
cp -r src/ dst/
mv old_name.txt new_name.txt
File Search
grep -r "search_term" --include="*.py" .
find . -name "*.log" -mtime -7
wc -l *.py
Text Processing
sort file.txt | uniq > sorted.txt
cut -d',' -f1,3 data.csv
sed -i '' 's/old/new/g' file.txt
sed -i 's/old/new/g' file.txt