agentleFS
kendrickkendrick/skills/memory-consolidate/SKILL.md

memory-consolidate

Skill1 starsChanged 2 months agoMITView on GitHub

Run `ltm doctor` over a memory scope's `_memory/` and write its findings as a report of memory candidates for review. Use when the user says \"consolidate memory\", \"check memory health\", \"find stale records\", or \"what's gone stale in _memory\", or after a batch of records lands and the bank wants a health pass. Writes one report note and never writes or edits records: to resolve what it finds, use inbox-to-memory's Phase 5.

5 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

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 1

    Distinctive

    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:

    Read REPORT and show the user every candidate line, in the order the file holds them.

    line 44

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “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-consolidate

ltm doctor already knows what a sick bank looks like: stale records, long supersession chains, orphans, and whatever checks the kit adds later. This skill turns its findings into a note that inbox-to-memory can drain, so a finding gets the same per-candidate review a groomed note's candidates get. scripts/consolidate.py does the mechanical part; this file decides when to run it, what to show the user, and where the user goes next.

The report is a proposal list. This skill writes the report file and nothing else, and every change to a record happens later, through Phase 5, on the user's say-so.

Resolve once per invocation:

  • SCRIPT: scripts/consolidate.py, resolved against this skill's own directory. Run it with python3.
  • SCOPE_ROOT: the directory holding the scope's _memory/ and memory-bank.yaml. Take it from the user, or from the working directory when that directory holds both. Ask when neither does.
  • REPORT: SCOPE_ROOT/notes/reports/YYYY-MM-DD-consolidation.md, dated from LTM_TODAY when that variable is set, else today.
ExitMeaning
0the report was written
1the script refused to overwrite REPORT, with stderr starting consolidate: refusing to overwrite; or ltm doctor failed, couldn't run (ltm not on PATH), or printed something other than an array of {file, check} objects, and stderr quotes it
2usage error from argparse, such as a missing --scope
3SCOPE_ROOT isn't a readable directory, the --json file is unreadable, or LTM_TODAY isn't exactly YYYY-MM-DD

Step 1 handles the refusal. On any other nonzero exit, report stderr verbatim and stop. The skill never falls back to reading records itself, since a report that doctor didn't produce can't be traced to a doctor finding.

Step 1 — Run the Pass

python3 SCRIPT --scope SCOPE_ROOT

The script runs ltm doctor --bank SCOPE_ROOT --json and writes REPORT. Doctor reads its thresholds from the scope's memory-bank.yaml doctor: block, so to change what counts as stale or orphaned, the user edits that block. The skill passes no thresholds of its own.

--json <file> reads doctor output saved earlier instead of running ltm. Use it when the user hands you a saved ltm doctor --json file, or when ltm isn't on PATH and they can produce that file elsewhere.

The same day maps to the same REPORT path. When REPORT already holds a line Phase 5 resolved, the script leaves it untouched, exits 1, and prints a stderr line starting consolidate: refusing to overwrite. A resolved line either starts with [[, because approving a candidate rewrites its prefix to a wiki link, or is an update-existing line carrying | dismissed:. A rewrite would throw either decision away. On the refusal, read REPORT and show the user its resolved lines. When stderr says the script can't read REPORT, tell the user that instead. Then ask whether to replace REPORT, and on a yes rerun the same command with --force added. On a no, stop.

Done when: the script exited 0 and REPORT exists; or it refused, the user declined, and the skill stopped; or the user confirmed and the --force run exited 0; or a run exited nonzero for any reason other than the refusal and its stderr was reported verbatim.

Step 2 — Present the Report

Read REPORT and show the user every candidate line, in the order the file holds them. Each line is one doctor finding:

[memory candidate: update existing [[<record stem>|<record title>]]] <check>: <message> related: [[<stem>]], ...

The related: tail appears only when doctor named related files, such as the other records in a chain. Present each line's check name and message as doctor wrote them. A check name you don't recognize is a finding like any other, so show it with the rest; the kit adds checks over time and the report carries them unchanged.

Give the count from REPORT's unpromoted_candidates frontmatter. When it is 0, tell the user doctor found nothing and stop here.

Done when: the user has seen every candidate line in REPORT and the count, or has been told the bank is clean.

Step 3 — Hand Off to Phase 5

Stop after presenting. Resolving a finding is inbox-to-memory's job: point the user to its Phase 5 (Propose and Crystallize), which treats REPORT like any groomed note. Approving a line takes Phase 5's update-existing path: it amends the target record, adds REPORT's id to that record's source_refs, and rewrites the line to [[<target>|memory — updated]], so the report doubles as the record of what was approved. Declining a line takes Phase 5's dismissal: it appends | dismissed: <reason, and who decided> after any related: tail and leaves the prefix in place, the same suffix it gives a dismissed contradiction. A dismissed line drops out of unpromoted_candidates and stays in REPORT as the record of the decision. A line the user neither approves nor dismisses keeps its candidate prefix and stays counted.

For a stale-confirmed finding, the usual fix is a command rather than an edit. A record's id is the nanoid that ends its stem. Have the user re-read the record (ltm show <id>), then:

  • ltm confirm <id> when it is still true, which sets last_confirmed to today.
  • ltm deprecate <id> when it no longer holds, which sets its status to deprecated.

For any other check, the kit's docs/doctor.md gives a dismissal paragraph per check.

Done when: the user has been pointed to Phase 5 for the report, and given the ltm confirm/ltm deprecate commands for each stale-confirmed line, if any, with no record touched by this skill.

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.