/rdf:r-util-mem-compactfrom RDF: rfxn Development Framework
Archives stale MEMORY.md entries by detecting staleness, identifying completed work, and proposing compaction. Preview mode by default; only modifies files on explicit confirmation.
Ships in RDF: rfxn Development Framework. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Archive stale MEMORY.md entries. Detects staleness, identifies completed work ready for archival, and proposes compaction. Preview mode by default — only modifies files when user explicitly confirms.
$ARGUMENTS — optional: --apply to execute changes (default: preview only)Read .rdf/governance/index.md to identify the current project. Then
locate its MEMORY.md:
Read the target MEMORY.md. Report:
Cross-reference factual claims against live state:
git rev-parse HEAD?grep -rc '@test' tests/*.bats | awk -F: '{s+=$2} END {print s}'?git branch --show-current?Report each stale fact with current vs recorded values.
Identify sections describing completed work that meet ALL criteria:
Protected sections (NEVER archive):
Archival candidates are typically:
For each archival candidate, propose:
memory/archive-v<version>.mdAlso propose:
# Memory Compaction: <project> MEMORY.md
Current: <N> lines (<STATUS>)
Target: <M> lines (after compaction)
Reduction: <N-M> lines
## Stale Facts (<count>)
| Fact | Recorded | Current |
|------|----------|---------|
## Archival Candidates (<count> sections, <lines> lines)
1. "Section name" (NN lines) → 2-line summary
...
## Archive File
memory/archive-v<version>.md (<total archived lines> lines)
If $ARGUMENTS contains --apply:
memory/archive-v<version>.md with archived sectionsIf --apply not specified, end with:
"Run /rdf:r-util-mem-compact --apply to execute these changes."
Runs when $ARGUMENTS contains --lessons, or automatically when invoked
with no MEMORY target and ~/.rdf/lessons-learned.md is within 5 of its
50-entry cap.
Run the deterministic scanner (read-only — never mutates the lessons file).
If ~/.rdf/state/rdf-lessons.sh is absent (helpers not yet bootstrapped —
fresh plugin install before its first session restart), skip this
consolidation step — MEMORY.md compaction still works; restart the session
(plugin) or run rdf deploy claude-code (checkout) to deliver them.
bash ~/.rdf/state/rdf-lessons.sh scan ~/.rdf/lessons-learned.md
Parse the JSON: duplicates (token-Jaccard >=50% pairs, each with a
jaccard score) and contradictions (opposing-polarity pairs, 25-49%
overlap).
Present each candidate under the existing y/n/auto gate (the same
approve control used by /rdf:r-save §8):
y merges; n skips; auto applies
all remaining safe duplicate merges.auto NEVER resolves a contradiction — it requires an explicit y
every time, and auto is ignored for these candidates. This is the
anti-crystallization rule: automatically dropping one side of a
contradiction can reinforce the wrong lesson.Apply only gate-approved changes to ~/.rdf/lessons-learned.md, then
rebuild the index (single writer): bash ~/.rdf/state/rdf-lessons.sh index.
Repeat the duplicate pass for ~/.rdf/insights.jsonl (exact-text and
token-Jaccard >=50% duplicates only; no contradiction pass on insights).
yWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub rfxn/rdf --plugin rdf38 skills in this plugin
/r-auditUse when you want a full codebase audit: dispatches parallel reviewer and QA passes across the tree.
/r-audit-slopAI slop audit. Finds dead code, orphan helpers, noop functions,
/r-buildUse when a plan exists and you want it built: dispatches the plan-execution orchestrator (engineer/QA/review gates) per phase at the right tier.
/r-context-auditMeasure, score, and report on Claude Code context overhead for this
Other plugins' skills for the same job