agentleFS
dmzoneilldmzoneill/skills/memory-cleanup/SKILL.md

memory-cleanup

Skill2 starsChanged 19 days agoApache-2.0View on GitHub

Clean up stale entries - closed issues, merged MRs, expired ephemeral namespaces, old session logs. Use when user says "clean memory", "memory cleanup", or "remove stale entries".

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Remove stale active_issues from current_work

    line 46
  2. Distinctive:

    Remove stale open_mrs from current_work

    line 47
  3. Distinctive:

    Remove expired ephemeral_namespaces from environments

    line 48
  4. Distinctive:

    Always default to dry_run for safety

    line 88

≈ “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.

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

Memory Cleanup - Remove Stale Entries

Removes closed issues, merged MRs, expired namespaces, and archives old sessions. Default: dry run.

Inputs

InputTypeDefaultPurpose
dry_runbooltruePreview without applying
daysint7Remove sessions older than N days

Workflow

1. Load Memory

  • memory_read("state/current_work")
  • memory_read("state/environments")

2. Analyze Stale Entries

  • active_issues: status in [done, closed, resolved, complete]
  • open_mrs: pipeline_status in [merged, closed]
  • ephemeral_namespaces: deployed_at older than cutoff
  • session_logs: files in memory/sessions/ older than days

3. Report Analysis (always)

Output table:

CategoryCount
Active Issues (closed)N
Open MRs (merged/closed)N
Ephemeral Namespaces (expired)N
TotalN

List details for each stale item.

4. Perform Cleanup (if not dry_run and total > 0)

  • Remove stale active_issues from current_work
  • Remove stale open_mrs from current_work
  • Remove expired ephemeral_namespaces from environments
  • Archive sessions older than 90 days: gzip and move to archive/

5. Session Archival

  • For session files older than 90 days: compress to .gz, move to memory/sessions/archive/, delete original
  • Report: "Archived N session logs"

6. Log Cleanup

  • memory_session_log("Memory cleanup", "Removed N stale entries")

7. Output Format

## 🧹 Memory Cleanup (Dry Run)

### Stale Entries Found

| Category | Count |
...

### Details

- Issue AAP-X is done
- MR !123 is merged

### Session Log Archival

📦 Would archive / Archived N session logs

---

_This was a dry run. Run with `dry_run: false` to apply changes._

Key Details

  • Chains to: memory_view (verify results)
  • Provides context for: beer, coffee (fresh state after cleanup)
  • Always default to dry_run for safety

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.

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.