artifact-retention
Skill115 starsChanged 2 months agoMITView on GitHub
After a build is delivered, delete its intermediate copies and old versions — keep exactly the version that runs and one previous for rollback — and report the space freed as measured by `df`, never `du`. Covers local build output, mobile build caches, container images, release dirs and stale browser-session copies, with a never-delete list (volumes, databases, installed SDKs, simulator runtimes, the rollback version). Use after any release or image build, before heavy builds when free disk is low, and when disk space drops fast ("диск кончается", "почисти старые сборки", "ENOSPC"). Loaded by release-manager, devops.
In this repository39 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- aesthetic-instrumentSkill
- anti-patternsSkill
- anydesignSkill
- archetype-review-baseSkill
- brainstormingSkill
- build-speedSkill
- codex-hostSkill
- committed-aestheticSkill
- cost-modelSkill
- crystallizeSkill
- decision-evalSkill
- deploy-landedSkill
- discoverySkill
- done-blockedSkill
- great_ctoSkill
- lifecycle-messagingSkill
- migration-ready-schemaSkill
- mobile-releaseSkill
- observability-baselineSkill
- opportunity-solution-treeSkill
- outcome-roadmapSkill
- pm-planningSkill
- pre-mortemSkill
- product-economicsSkill
- prose-styleSkill
- quant-validationSkill
- reference-lockSkill
- secrets-rotationSkill
- signing-preflightSkill
- skeptical-triageSkill
- stack-baselineSkill
- test-strategySkill
- ui-ux-pro-maxSkill
- vertical-onboardingSkill
- verticalsSkill
- web-releaseSkill
- well-architectedSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 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.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 43
Never by glob over temp roots, never docker system prune, never docker image prune -a.
- Very specific: line 62
Remove one directory at a time, after asking.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
artifact-retention — keep what runs and one rollback, measure what you freed
Build machines fill up from copies that already did their job: agent work trees, old
DerivedData, Gradle outputs, image tags, browser profiles. A full disk breaks the next
build, other people's builds, and even command output. Cleaning is part of "released".
What to keep
| Kind | Keep | Delete |
Web build output (dist/, .next/, out/, .vercel/output) | current release | older release outputs |
Mobile artifacts (.ipa, .aab, .apk, .xcarchive) | the shipped one + one previous | older archives |
Mobile caches (DerivedData/<project>-*, android/app/build, .gradle project dir) | — (rebuildable) | after delivery |
Container images <app>:<tag> | the image a container uses (running or stopped) + the rollback tag | older tags of that app |
Release dirs *-<sha> | active + one previous | older |
| Hosted deployments (Vercel, Pages, Workers versions) | live + previous | leave to the host's retention unless asked |
Never delete
- Volumes, databases, backups,
pg_wal, data files — even when a tool calls them "reclaimable". - The rollback version, even when it is old.
- Installed tools, not copies: Xcode, simulator runtimes, Android SDK and system images,
~/.gradle/caches,node_modules, installed browsers (ms-playwright), the user's Chrome profile and/Applications. - Anything another session or process uses. Check:
lsof +D <dir>empty, no running build (pgrep -fl 'xcodebuild|gradle|docker build|buildx'), work tree merged and clean (git merge-base --is-ancestor <head> origin/<main>and no tracked changes). - Never by glob over temp roots, never
docker system prune, neverdocker image prune -a.
How
- Before:
df -k /(and on APFSdiskutil apfs list | grep -E 'Capacity (Consumed|In Use)'). - List exact paths and tags, each with why it is old and that nothing uses it.
- Ask the operator first for anything that is not your own rebuildable build output (other sessions' copies, browser clones, images you did not build). Your own intermediate output of the release you just shipped needs no extra question.
- Remove one exact path or tag at a time.
- After:
df -k /again. Report thedfdifference.ducounts APFS clones and shared image layers as full copies — a "67 GB" folder freed 2 GB. Never promise adunumber.
Stale browser-session copies (macOS)
Chrome copies itself to $(getconf DARWIN_USER_TEMP_DIR)/../X/com.google.Chrome.code_sign_clone/
on launch; Playwright leaves playwright* profiles in the temp dir. Each copy is stale
when lsof +D <that dir> is empty and no running Chrome uses it as --user-data-dir.
Remove one directory at a time, after asking. If copies keep appearing, find the launcher
(ps -axo pid,ppid,lstart,command) instead of cleaning again.
Report — one line
cleanup: removed <n> items (<list>), df freed <X> GB, kept <current> + <rollback>
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.

