moonlight-lupin/agent-skills

disk-cleanup

Use when df says disk is above 80% full or the user wants to reclaim storage space on a VM.

Vedi sorgente
Documento Skill originale

Contenuto dal repository con titoli, esempi, codice, tabelle, link e immagini preservati.

Disk Cleanup

Reclaim disk space on a Linux VM. The skill runs a triage — survey every space consumer, split targets into safe vs ask, execute the approved set, then verify the delta.

When to Use

  • User says "disk cleanup", "free up space", "clean up the VM"
  • Disk usage above 80%
  • After large builds, git operations, or Docker image accumulation

Procedure

1. Baseline

bash
df -h

Done: used and available numbers recorded for all mounts for the before/after comparison.

2. Survey

Requires root for apt, journalctl, and /var/log operations. Non-root users can survey but cannot clean system paths.

Build a ranked list of every consumer over ~50M. Survey all mounts, not just /.

bash
# All mounts (not just /)
df -h
df -i                           # inode exhaustion — "No space left on device" with free blocks

# Deleted-but-open files (canonical "df says full, du says empty" case)
lsof +L1 2>/dev/null | head -20

# Hermes data + user caches + tmp (stay on one filesystem, don't cross mounts)
du -xsh ~/.hermes/*/ 2>/dev/null | sort -rh | head -20
du -xsh ~/.hermes/projects/*/ 2>/dev/null | sort -rh | head -20
du -xsh ~/.cache/*/ 2>/dev/null | sort -rh | head -15
du -xsh /tmp/* 2>/dev/null | sort -rh | head -15

# Memory store (if Mnemosyne is installed)
du -xsh ~/.hermes/mnemosyne/data/* 2>/dev/null | sort -rh

# Session checkpoints (if present)
du -xsh ~/.hermes/checkpoints/store/ 2>/dev/null

# Docker
docker system df                # shows build cache separately from images
docker images --format "{{.Size}}\t{{.Repository}}:{{.Tag}}" | sort -rh | head -25
docker ps -a --filter "status=exited" --format "{{.Image}}" | sort -u

# System
du -xsh /var/cache/apt /var/log ~/.cache/pip ~/.cache/uv 2>/dev/null
journalctl --disk-usage
find /var/log \( -name "*.gz" -o -name "*.1" -o -name "*.old" \) 2>/dev/null

# Bloated git repos (orphaned tmp_pack files from interrupted operations)
find ~/.hermes/projects -name ".git" -type d -exec sh -c 'du -sh "$1" 2>/dev/null' _ {} \; | sort -rh | head -10

Done: every consumer over 50M identified with its size. All mounts surveyed. Inode exhaustion and deleted-but-open files checked.

3. Triage

Split every found target into two buckets. Present the table to the user before executing.

Safe — execute without asking:

TargetCommandReclaims
uv cacheuv cache pruneUp to full cache size
pip cachepip cache purgeUp to full cache size
apt cacheapt autoclean~100M typical
Journal logsjournalctl --vacuum-size=50MDown to 50M
Rotated logsfind /var/log \( -name "*.gz" -o -name "*.1" -o -name "*.old" \) -delete~20M typical
Browser automation cachesrm -rf ~/.cache/puppeteer ~/.cache/ms-playwright~650M; re-downloads if needed
Dangling Docker imagesdocker image prune -fVaries
Docker build cachedocker builder prune -f --filter until=168h --reserved-space 10GBOften multi-GB; bounded: skips cache younger than 7 days, always keeps 10GB

Ask first — user must confirm:

TargetRiskCommand
git gc aggressiveDestroys recoverable objects (dropped stashes, orphaned commits after bad reset). Aggressive repack temporarily grows disk use.cd /repo && git gc --aggressive --prune=now
apt autoremoveMay remove wanted packages. Review the list before confirming.apt autoremove (without -y)
Old DB backupsConfirm current DB is healthy first. Use explicit paths, not globs.rm /path/to/specific-backup.bak
Stale /tmp dirsDirectory mtime does not track activity inside. List before deleting.`find /tmp -maxdepth 1 -mtime +3 -type d -name "_" \xargs ls -ld` then confirm
Docker images for stopped containersMay want to restart laterdocker rmi <image>
Session checkpoint storesMay contain recoverable state
Large skill references (PDFs, maps, RAG indexes)User data
Large project uploadsUser data
Docker images for running servicesDisruptive

Done: table presented with safe-only total and with-ask total. User has approved a set.

4. Execute

Run the commands from the Safe table for each approved target. Capture before/after size for each.

For Docker stopped containers + images (requires two steps):

bash
docker rm $(docker ps -a --filter "status=exited" --filter "ancestor=IMAGE" -q)
docker rmi IMAGE

Done: every approved target cleaned. Before/after size captured for each.

5. Verify

bash
df -h

Compare per-mount against baseline from step 1.

Done: total reclaimed reported per mount. Used/free compared against baseline.

Pitfalls

ProblemCauseFix
df shows free blocks but writes fail with ENOSPCInode exhaustion — millions of small files. Check df -i.Locate with `find <mount> -xdev -type f \head -100000 \wc -l` per directory, then clear the offending cache/spool. Disk-size cleanup will not help.
df says full but du shows nothingA process holds a deleted file open. Check lsof +L1.Identify the holding process with lsof +L1, restart it (or truncate via cat /dev/null > /proc/<pid>/fd/<n>). No file deletion reclaims this.
git gc reclaims nothingNo orphaned objects — just large historyAccept the size or run git repack -ad for marginal compression
tmp\_pack files persist after gcGit process still running or lock filefuser .git/objects/pack/*.pack to find the process, retry after it ends
Docker rmi fails "image is in use"Stopped container still references itdocker rm the container first, then docker rmi
apt autoremove lists wanted packagesAuto-removable deps flagged incorrectlyReview the list before confirming; skip with apt-mark manual <pkg>
journalctl --vacuum-size failsJournald service issuesystemctl restart systemd-journald then retry
uv cache prune failsuv not in PATHUse python -m uv cache prune
dallo stesso repository

Altri Skills

Tutti gli Skills
moonlight-lupin
Community

claude-plugin-converter

Convert Claude Code plugins into self-contained Hermes plugins — discovery analysis then full conversion

installazioni
1
GitHub Stars
62
Aggiornato
7 set
moonlight-lupin
Community

clips-studio

Use when the user wants to "make a video/clip", "generate a video from text", "animate this image/photo", "create a marketing reel / social video / teaser", "do a 3D / parallax move", "pan/zoom/orbit a shot", or mentions fal.ai, Kling, Veo or Seedance for video. Staged fal.ai workflow — brainstorm, draft cheaply, produce the final at quality. Three modes: text-to-video, animate (still to motion), camera-move (push-in/pan/orbit). Not for still images (image-studio), slide decks, or charts. Honesty discipline: never depict real identifiable subjects via text-to-video.

installazioni
1
GitHub Stars
62
Aggiornato
7 set
moonlight-lupin
Community

decision-log

ADR-style decision journal for agents and teams. Create numbered decision records, track superseding chains, schedule periodic reviews, and search past decisions to avoid re-litigating settled questions.

installazioni
1
GitHub Stars
62
Aggiornato
7 set
moonlight-lupin
Community

deep-research

Autonomous multi-step deep research engine implementing an iterative Think → Search → Extract → Synthesize → Stop loop. The LLM drives every decision: what to search, what's relevant, what's missing, and when to stop. Produces a cited, magazine-quality report with inline citations, category- specific formatting, and research stats. Trigger when the user asks for "deep research", "research report on", "comprehensive analysis of", "look into X in depth", "write a report on X", or any question needing multi-source synthesis beyond a single search. For entity vetting/dossiers use entity-research; for news digests use news-monitoring; for source-grounded Q&A use notebooklm-mode.

installazioni
1
GitHub Stars
62
Aggiornato
7 set