aim-lore-hygiene
БесплатноЗапускает вложенные скриптыНе проверенEnforce hygiene on per-operator sanctum files (LORE/MEMORY compaction, PERSONA Evolution-Log section-cap, CREED/BOND cap-check) — line-cap enforcement…
от Hidden-History★ 41 звезда на GitHubОб этом скилле
aim-lore-hygiene — Per-Operator Lore File Hygiene
Compacts always-injected sanctum files (LORE.md, MEMORY.md) under the BP-159
~200-line cap so rules don't "get lost in the noise" and adherence stays high.
FILE-content compaction only — NOT Qdrant-point purging by age (that is
aim-purge, a different domain — PLAN-028 P0-3).
The deterministic mechanics (line-counting, marker classification, structural
compaction, archiving) live in scripts/lore_hygiene.py, invoked by path.
This file decides when to run, which files, and how to read the plan.
When to use
- A sanctum file crosses ~80% of its cap (160/200 lines — the compaction trigger).
- A scheduled hygiene pass (session-stop hook or cron).
- The operator asks to prune or compact lore, or flags a stale/wrong entry.
Steps
Resolve the sanctum path:
{project-root}/_ai-memory/sanctum/{agent_id}/. The scan governs every present class —LORE.md/MEMORY.md(compact),PERSONA.md(Evolution-Log section-cap),CREED.md/BOND.md(cap-check only).Dry-run audit (DEFAULT — never mutates):
python3 scripts/lore_hygiene.py <sanctum-path>Reports per file: line count, % of cap, and the proposed prune / archive / dedup actions with a projected post-compaction line count.Review the plan — the verifiable intermediate output. Confirm prunes are genuinely superseded/contradicted, archives are stale-but-meaningful, and the projected count lands at or under cap. If the plan reports a residual over-cap, a manual/LLM semantic-summarization pass is needed (the script will not auto-truncate recall-value content).
Apply only after review:
python3 scripts/lore_hygiene.py <sanctum-path> --applyEach mutated file gets a timestamped.baksidecar first; archived entries move toreferences/lore-archive/<FILE>.archive.mdwith a one-line pointer left in the hot file. Add--qdrant --group-id <project>to also push archived entries to the Qdrant cold tier (best-effort, opt-in).Verify: re-run the dry-run audit. Every file should be ≤ cap (or carry an explicit residual flag), and each archived entry should have a one-line pointer in the hot file. A second
--applyon an already-clean file is a no-op.
What the script acts on (structure-aware, keep-when-uncertain)
The script acts only on genuine content entries — bullets, paragraphs, and table content rows. It is structure-aware: every structural or ambiguous construct is opaque passthrough, copied byte-for-byte and never classified, deduped, split, or rewritten:
- Code fences — the entire block (
```/~~~, including the info string and everything between the delimiters) is one opaque unit. A marker token inside a fence is example text, never an entry; an unterminated fence keeps its remainder opaque. - Tables — the header row and its
|---|separator are structural (a tagged header is never classified, so a separator is never orphaned). Only the content rows below them are classified. - Thematic breaks (
---,***,___) and other delimiters — structural, never deduped. - Anything else not confidently structural-or-content (blockquotes, indented code,
raw HTML, odd constructs) — kept opaque. A raw-HTML block is gathered from its
start line to the blank-line terminator (inner lines need not start with
<), so a multi-line<div>…</div>stays whole. This is the keep-when-uncertain posture: because the skill mutates the operator's own memory, when it cannot confidently classify a block it keeps it intact rather than risk corrupting it.
How entries are classified
Within genuine content entries, the script is marker-driven (it never guesses an entry is low-utility):
- Prune (delete):
[superseded],[contradicted],[wrong],[obsolete],[prune], a[expired:YYYY-MM-DD]TTL that has passed, or a full-entry strikethrough (a single~~...~~span covering all of the entry's content). - Archive (cold tier + pointer):
[stale],[archive]. For a non-table entry a one-line pointer is left in the hot file; for a table content row the row is dropped in place (the table stays well-formed) and its content still moves to the cold tier — no inline pointer is injected into the table body. - Dedup: exact-duplicate entries within the same
## sectionare collapsed, keeping the first; identical text under different sections is kept (distinct records). Table rows (header, separator, content) are never deduped, so a second same-schema table keeps its header and separator. - Keep: everything else.
Markers must be anchored in the LEADING position. A marker counts only as a
leading tag — right after the bullet/number prefix (- [superseded] …) or in the
first cell of a table row (| [superseded] row | … |). A marker merely mentioned in
prose ("Tag an entry [superseded] when…") **or one that merel
Установить aim-lore-hygiene в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadВложенные файлы
FAQ
Что делает скилл aim-lore-hygiene?
Enforce hygiene on per-operator sanctum files (LORE/MEMORY compaction, PERSONA Evolution-Log section-cap, CREED/BOND cap-check) — line-cap enforcement, anchored-summarization compaction at ~80% of cap, the prune-vs-archive decision, and a conservation 0-lost proof on every relocation. Use when a sanctum file approaches its size cap, on a scheduled hygiene pass, or when the operator asks to compact or prune lore.
Как установить скилл aim-lore-hygiene?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл aim-lore-hygiene запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic