agentleFS
jholhewresjholhewres/devclaw-skills/skills/filesystem/SKILL.md

filesystem

Skill4 starsChanged 9 months agoMITView on GitHub

File system operations — advanced file manipulation, search, and management

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use find ... -exec ... + for better performance

    line 199
  2. Very specific:

    Use rsync -n (dry-run) before real sync

    line 200
  3. Very specific:

    Use shred for secure file deletion

    line 201
  4. Very specific:

    Use lsof to find open files

    line 202
  5. Very specific:

    Use fuser to find processes using files

    line 203

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Filesystem

Advanced file system operations and management.

Search Files

# Find by name
find . -name "*.txt"

# Find by extension
find . -type f -name "*.py"

# Case insensitive
find . -iname "*.TXT"

# Find directories
find . -type d -name "node_modules"

# Find by size
find . -size +100M           # Larger than 100MB
find . -size -1k             # Smaller than 1KB

# Find by time
find . -mtime -7             # Modified in last 7 days
find . -mtime +30            # Not modified in 30+ days
find . -atime -1             # Accessed in last 24h
find . -newer file.txt       # Newer than file.txt

# Find and execute
find . -name "*.log" -delete
find . -name "*.tmp" -exec rm {} \;
find . -name "*.py" -exec wc -l {} +

# Find with permissions
find . -perm 755
find . -executable -type f

Search Content (ripgrep/grep)

# Search in files
grep -r "pattern" .

# With ripgrep (faster)
rg "pattern" .

# Search specific files
rg "pattern" -g "*.py"

# Show context
rg "pattern" -C 3           # 3 lines before and after
rg "pattern" -A 2           # 2 lines after
rg "pattern" -B 2           # 2 lines before

# Count matches
rg -c "pattern" .

# Files with matches only
rg -l "pattern" .

# Case insensitive
rg -i "pattern" .

Copy & Sync

# Sync directories with rsync
rsync -av source/ destination/

# Sync with progress
rsync -av --progress source/ destination/

# Sync with exclude
rsync -av --exclude 'node_modules' --exclude '.git' source/ destination/

# Sync to remote
rsync -avz -e ssh source/ user@host:/path/

# Delete files not in source
rsync -av --delete source/ destination/

# Dry run
rsync -av --dry-run source/ destination/

Disk Usage

# Directory sizes
du -sh *

# Sort by size
du -sh * | sort -h

# Find largest files
du -ah /path | sort -rh | head -20

# Disk free space
df -h

# Inode usage
df -i

File Operations

# Create directory tree
mkdir -p path/to/deep/directory

# Copy with progress
cp -r source/ destination/ & progress -p $!

# Move with overwrite prompt
mv -i source dest

# Remove empty directories
find . -type d -empty -delete

# Remove files older than X days
find . -name "*.log" -mtime +30 -delete

# Batch rename
rename 's/.txt/.md/' *.txt

# Create tarball
tar -czvf archive.tar.gz directory/

# Extract tarball
tar -xzvf archive.tar.gz

File Permissions

# Change permissions
chmod 755 script.sh
chmod -R 644 *.txt

# Change ownership
chown user:group file.txt
chown -R user:group directory/

# Make executable
chmod +x script.sh

# Find world-writable files
find . -perm -0002 -type f

# Find files without owner
find . -nouser -o -nogroup

Symbolic Links

# Create symlink
ln -s /path/to/target linkname

# Hard link
ln target linkname

# Remove symlink
rm linkname

# Find broken symlinks
find . -type l -! -exec test -e {} \; -print

# View link target
readlink -f linkname

Watch for Changes

# Watch directory changes
inotifywait -m -r /path/to/watch

# Watch with incron (like cron for filesystem)
incrontab -e
# /path/to/watch IN_CLOSE_WRITE /script.sh $@/$#

Tips

  • Use find ... -exec ... + for better performance
  • Use rsync -n (dry-run) before real sync
  • Use shred for secure file deletion
  • Use lsof to find open files
  • Use fuser to find processes using files

Triggers

filesystem, find files, search files, file operations, rsync, disk usage, file management, file search

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.