Snapshot Cleanup
# User-invoked prompt · snapshot-cleanup (v1.8.2 · Obsidian-style) > Replaces `tools/lib/cortex/snapshot.py:should_archive()` / `should_delete()` > retention logic, deleted in Option A pivot. ROUTER reads this when user > asks for SOUL snapshot cleanup, otherwise snapshots accumulate forever. > > **v1.8.2 HARD RULE #11**: Cleanup report renders in Obsidian. Apply > `references/obsidian-style.md` — `> [!info]` for retention plan, > `> [!success]` for cleanup result, nested tags. ## Trigger keywords - `清理 SOUL snapshots` / `snapshot cleanup` - `归档旧 snapshot` / `archive old snapshots` - `meta/snapshots/soul/ 太多了` ## Goal Apply 30/90 day retention policy to `meta/snapshots/soul/`: - 30+ days old → move to `meta/snapshots/soul/_archive/` - 90+ days old → delete ## Steps 1. `Glob meta/snapshots/soul/*.md` (exclude `_archive/`) 2. For each file, parse `captured_at` from frontmatter (ISO8601) OR fall back to filename `YYYY-MM-DD-HHMM` parsing 3. Compute age in days from current UTC date 4. Bucket: - `age < 30` → leave (active) - `30 <= age < 90` → move to `meta/snapshots/soul/_archive/{file}` (use `Bash: mv` or Read+Write+Delete) - `age >= 90` → delete (`Bash: rm`) 5. Repeat the bucket pass on `meta/snapshots/soul/_archive/` to delete files that are now > 90 days old (they were archived previously) ## Report to user
fill the variables
This prompt has 1 variable. Pro fills them into a ready-to-paste prompt for you — no manual find-and-replace.
{file}
Unlock with Pro →when to use it
Community prompt sourced from the open-source GitHub repo jasonhnd/life_OS (NOASSERTION). A "Snapshot Cleanup" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
roleplaycommunitygeneral
source
jasonhnd/life_OS · NOASSERTION