docker-space-optimizer
Skill5 starsChanged 2 days agoMITView on GitHub
Trigger: docker ocupa mucho, liberar espacio docker, build cache, prune, docker disk usage. Diagnose and reclaim Kiri Docker space safely.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- alvaroofernaandez/dotfilesword for word, first seen Nov 29, 2026
Other versions1 project uses a version of this.
Word for word · 1
- alvaroofernaandez/dotfiles★ 5100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository36 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- aval-architectureSkill
- aval-docsSkill
- aval-release-notesSkill
- aval-releaseSkill
- aval-testingSkill
- accessibilitySkill
- ai-sdk-5Skill
- architecture-evidenceSkill
- branch-prSkill
- chained-prSkill
- cognitive-doc-designSkill
- design-pipelineSkill
- design-refactorSkill
- docker-build-optimizedSkill
- herdrSkill
- issue-creation-proSkill
- kiri-dockerSkill
- kiri-healthSkill
- laws-of-uxSkill
- lightpanda-browserSkill
- mac-disk-cleanupSkill
- pdf-reportSkill
- plan-deckSkill
- prs-proSkill
- react-19Skill
- readme-guardianSkill
- readme-portalSkill
- repo-prepSkill
- skill-creatorSkill
- strict-tddSkill
- tailwind-4Skill
- typescriptSkill
- work-unit-commitsSkill
- zod-4Skill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
Run aval docker cleanup (add --dry-run to only list the commands.
- Distinctive: line 37
If more space is needed, present destructive candidates as a table and wait for approval.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.
Files
Activation Contract
Load when Docker images, build cache, volumes or Kiri's disk use too much space, after large builds, or when free space on / is low.
Hard Rules
- Kiri is the only runtime. Act only when
docker context showiskiri; refuse any other context (the script exits non-zero). - Measure BEFORE and AFTER, and report the difference.
- Safe cleanup needs no confirmation:
docker container prune -f,docker image prune -f,docker builder prune -af,docker buildx prune --builder multiarch -af. - Destructive cleanup (
docker system prune -af --volumes,docker volume rm/prune,docker image prune -a,docker rmi) runs ONLY after listing exactly what will be removed, with sizes, and getting explicit approval. - Measure Kiri's real usage with
du -sh ~/Library/Application\ Support/Kiribefore and after, and report the measured number. - Kiri's
vm/data.imgdoes NOT shrink by itself after deletes.aval docker cleanupends withfstrimon the VM's ext4 through a throwaway volume (kiri-fstrim-probe), which returns freed blocks to macOS (verified 2026-11-19: 49.4 → 25.2 GB real). Never mount/dev/vdadirectly. Report the measureddu -h vm/data.imgbefore/after, never an assumed number. - Manual trim without pruning:
docker volume create kiri-fstrim-probe && docker run --rm --privileged -v kiri-fstrim-probe:/v alpine:3 fstrim -v /v; docker volume rm kiri-fstrim-probe.
Decision Gates
| Finding | Action |
| Build cache large | Safe cleanup (script) |
| Dangling images / stopped containers | Safe cleanup (script) |
| Unused tagged images | List repo:tag, size, age → ask |
| Unused volumes | List name, size, owning compose project → ask; never prune DB volumes silently |
| Context ≠ kiri | Stop; load kiri-health |
Execution Steps
- Diagnose:
df -h /,docker system df,docker system df -v,du -sh ~/Library/Application\ Support/Kiri. - Run
aval docker cleanup(add--dry-runto only list the commands; checks context, safe prunes incl. themultiarchbuilder cache, before/after report). - If more space is needed, present destructive candidates as a table and wait for approval.
- Re-measure with step 1 commands.
Output Contract
Return a table: free space on / before/after, Kiri data size before/after (measured), total reclaimed, what was removed, what was kept and why.
References
aval docker cleanup— safe cleanup with before/after report.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

