loom-memory
Record repo-wide lessons when saving to your own memory or asked to remember; recall, reconcile, or forget them when a task needs it.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- loom-memory
- description
- Record repo-wide lessons when saving to your own memory or asked to remember; recall, reconcile, or forget them when a task needs it.
02 资源文件 11
- 参考文档evals/host-memory-trigger-cases.json2.2 KB
- 参考文档evals/host-memory-trigger.md2.3 KB
- 参考文档evals/record-timing-cases.json5.4 KB
- 参考文档evals/record-timing.md14.5 KB
- 参考文档README.md1.8 KB
- 参考文档references/okf-profile.md4.0 KB
- 参考文档references/operations.md7.4 KB
- 脚本scripts/loom_memory.py28.5 KB
- 脚本scripts/migrate_legacy_store.py14.6 KB
- 参考文档templates/memory-store-index.md261 B
- 参考文档templates/memory-store-README.md2.0 KB
03 SKILL.md 正文
loom-memory
loom-memory is the one public surface over an OKF v0.2-compatible
repository memory store: a directory of Markdown concept files plus a
generated index.md, holding durable repository lessons that outlive any
single change. The store is docs/loom/memory/ at the repository root unless
the repository already keeps its loom memory store elsewhere; initialize it
there when it is absent. It exposes four operations — Recall, Record,
Reconcile, Retire — and nothing else. Validation and index
generation are implemented in
${CLAUDE_PLUGIN_ROOT}/skills/loom-memory/scripts/loom_memory.py (the
skills/loom-memory/scripts/loom_memory.py file inside this skill's own
directory); this skill is the only place that decides when and how to
call them. ${CLAUDE_PLUGIN_ROOT} is this plugin's root, substituted on
Claude Code; on any other host it is the directory two levels above this
SKILL.md — use that path in its place wherever it appears below.
This skill runs identically wherever agent skills and repository file access are available. Nothing in this file or in the store schema depends on a specific host's private path or API — Recall, Record, Reconcile, Retire, and validation work the same whether or not any other plugin is installed.
Boundary against git-memory
git-memory owns commit- and pull-request-bound Decision, Learning, and
Gotcha carriers — captured at the moment of one change, retrieved through
git log and PR history. loom-memory owns repository lessons that
outlive a change: durable practices, habits, and recurring gotchas that
stay true after the commit that taught them is long gone. Neither skill is
a runtime dependency of the other, and content does not move automatically
between them — a commit-bound Gotcha: trailer is not itself a
loom-memory concept until someone deliberately records it as one.
When this skill activates
Three triggers, all passive:
- Explicit user request — the user asks to remember, recall, reconcile, or retire repository knowledge, in any language.
- Host memory save — the agent is about to save a lesson to its own host-managed memory, on any agent host. Run Record's classification first: a repo-wide lesson is recorded here as well; anything else stays only in host memory.
- Independent agent judgement — mid-task, the agent identifies a concrete need for prior repository experience (not a hunch, not a completeness ritual).
Apart from the host memory save in trigger 2, reaching any particular point in a workflow is not, by itself, a reason to invoke it — this skill has no fixed-station calling convention and installs no gate on anyone else's process.
The four operations
Recall
Trigger: explicit request, or the agent judges prior repository experience is needed for the task at hand.
Steps:
- Read
index.mdfirst. Never open every concept file — the index exists so an agent chooses without loading bodies. - Open only the bounded set of concept files whose index entry matches the need.
- For each matching lesson, verify that any file, flag, skill, or command it names still exists before acting on it. A lesson that names a vanished file is stale evidence, not a fact to act on — say so.
- An absent store or an empty result is a normal no-memory result, not an error. Report it plainly and continue the task.
- A store with concept files but no
index.mdis structural corruption, not an empty result. Fail this recall explicitly and point the user at${CLAUDE_PLUGIN_ROOT}/skills/loom-memory/scripts/loom_memory.py validate(theskills/loom-memory/scripts/loom_memory.pyfile inside this skill's own directory) or the explicit migration operation — never read the concept files directly to work around a missing index.
Record
Trigger: explicit request, the agent is about to save a lesson to its own host-managed memory, or the agent judges a discovery is worth keeping past this change.
When: before the branch closes. A fact already known while the branch is still open — one that did not require the merge to observe — belongs in that same branch, never a separate post-merge branch: a branch and a pull request opened only to write down something already known is pure overhead the close-out should have absorbed. The one exception is a fact only confirmable by observing real post-merge or installed behavior; that genuinely needs a follow-up branch, and those are batched rather than one pull request per discovery. A lesson that surfaces only after a closing review has spent its last reviewed content is the same case: it rides the next change's branch batched, which is still not a branch opened to record. Such a lesson stays in host memory until the next change's branch records it.
How much: almost nothing qualifies. Most of what a change surfaces is not a durable lesson — a one-off implementation slip belongs in its commit message, a verification result belongs in the change's evidence, an unfinished item belongs in an intent. Zero to one durable lesson per change is the normal outcome. The filter below judges one candidate at a time, so it cannot see the other signal: wanting to record eight things at once means the filter has not been applied yet.
Steps:
- Classify the candidate first. It qualifies only as a durable repository
lesson — not an open task, a change narrative, a verification record, a
commit-bound decision (that belongs in
git-memory), or a personal preference. It also fails as a fact true only on one machine (local paths, local environments, installed tool versions), or as behavior of one agent host or tool unrelated to the repository. Then ask: would this still hold and help another contributor who clones this repository on a different machine with different tools? When it fails this classification, do not record it; it stays only in host memory — say why it was not recorded. - Inspect the target store before index access or concept writes.
Initialize an absent or empty directory with
init <store>using${CLAUDE_PLUGIN_ROOT}/skills/loom-memory/scripts/loom_memory.py; this createsREADME.mdandindex.mdfrom the bundled templates. Preserve existing populated stores: skip initialization, detect legacy README-indexed stores as described inreferences/operations.mdand stop for explicit migration. For other populated stores, runvalidate <store>first and stop on any violation, including a missing index; continue only with a valid store. - Read
index.mdand search for an equivalent or contradictory live entry before creating anything. A match routes to Reconcile instead. - Author exactly one concept file: frontmatter (
type,nameequal to the filename stem,description, at least onesources[].resource), followed by a body ofTrigger,Correct path,Why, andLimitsonly when a real non-applicability boundary exists — seereferences/okf-profile.md. - Regenerate and validate the index with
${CLAUDE_PLUGIN_ROOT}/skills/loom-memory/scripts/loom_memory.py regenerate-index <store>andvalidate <store>(that script isskills/loom-memory/scripts/loom_memory.pyinside this skill's own directory).
Reconcile
Trigger: a new lesson contradicts, narrows, or is equivalent to a current entry (same subject, same rule).
Steps:
- Locate the current entry through
index.md, never by guessing a filename. - An equivalent lesson keeps the existing entry's content unchanged and only adds
its new source to that entry's
sources. A contradicting or narrowing lesson updates that entry in place, or replaces it with one current concept. Never create a second entry for the same subject. - Preserve every existing
sources[].resourceand add the new source rather than discarding provenance. - Regenerate and validate the index.
Retire
Trigger: an entry is no longer true and has no current replacement value.
Steps:
- Name the entry and why it no longer holds.
- Require explicit user approval before deleting anything — Retire never deletes on the agent's own judgement alone, unlike the other three operations.
- On approval, delete the concept file. Git history is the archive; this
store keeps no separate
log.mdchange log. - Regenerate and validate the index after deletion.
Failure behavior
A requested operation that finds malformed frontmatter, a missing required field, duplicate concept identity, index drift, or a broken index target stops with every offender named — never a first-match-only report — and never installs another plugin or blocks unrelated work.
A store that turns out to be a legacy README-indexed store (no generated
index.md; concept files still shaped by the pre-OKF format) is reported
as needing an explicit migration, without modifying any file. This skill
never reads or writes that legacy format itself; migration is a separate,
explicit operation, never an implicit side effect of installation, session
start, Recall, or any other station.
Resource map
references/okf-profile.md— the OKF v0.2 compatibility clauses this store profile pins, the Loom minimum concept schema, the lesson body contract, and whylog.mdis omitted.references/operations.md— the full step-by-step procedure behind each operation above, including the Record classification filter and the Reconcile merge rule in detail.${CLAUDE_PLUGIN_ROOT}/skills/loom-memory/scripts/loom_memory.py(theskills/loom-memory/scripts/loom_memory.pyfile inside this skill's own directory) —init <store>,validate <store>, andregenerate-index <store>.templates/memory-store-README.mdandtemplates/memory-store-index.md— the starting shape for a new store, instantiated as that store'sREADME.mdandindex.md.
License
MIT — see repository root LICENSE.
04 同仓库更多 Skills
using-loom-workflow
Route broad Loom workflow-tool requests to the right skill. Use when the request spans tools or the right workflow skill is unclear.
skill-retro
Review selected past or current Claude Code or Codex sessions against readable target skill sources and related integration. Produce source-linked proposals without applying changes.
recap-state
Give an in-session recap of current progress for 'where were we', '我們剛剛在幹嘛', '剛剛講到哪', '我跟丟了', 'ちょっと振り返って', '今どこだっけ', or '振り返り'. The built-in /recap is an away-summary.
project-retro
Review one current or specified coding session for source-backed project development improvements. Use for a requested retrospective, including 振り返り seeking improvements; not for current-progress recaps or recurring skill mining.
loom-visualization
Show comparisons, flows, decisions, states or reasoning chains as tables, ASCII or Mermaid in coding chat, including when a Loom station reports to the user (intent restatement, choices, acceptance test results); not Obsidian notes.
loom-interactive-diagram
Create and check editable diagrams during standalone or Loom work. Use when the agent needs to create a diagram for the user to edit in an external editor or read back saved changes; draw.io is the default format.