A set ofhost-level, sharded by directory + tagsmemory architecture. There are only three things:
index— Index: maps scope (directory) and tag (label) to slug.The first thing to do after loading is read it.rules/<slug>.md— Stable: what it is, how to operate it, how to maintain it.logs/<slug>.md— Append: what happened, what needs to be done (todos are written directly as one line, without opening a separate file). Once accumulated to a certain extent,compact(see below).
Directories are used for automatic matching of "where the person is"; tags are used for cross-directory matching of "who the matter belongs to".
The skill only manages this architecture; exactly what to record is configured by the user.
Store location
Default ~/host-memory/(Windows:%USERPROFILE%\host-memory)。
~/host-memory/
├── INDEX.md # 索引:scope / tag → slug
├── rules/<slug>.md
└── logs/<slug>.md
Do immediately after loading
- Read
INDEX.md; if it does not exist, treat it as empty. - Matching slug:scope and the current directoryequalonly then counts as a match (nested subdirectories do not match the parent scope);tag by topiccross-directorymatch.
- Read only the matching slug's
rules/<slug>.md; to see context / todos, then readlogs/<slug>.mdthe tail of. - If multiple match, read them all;do notautomatically load the scope above the current directory unless the user explicitly points to it.Do not readunmatched slugs,do not traverse
rules/、logs/— tags only query INDEX, and do not go through the body text.
Write
- Stable knowledge →
rules/<slug>.md; observations / operations results / todo →logs/<slug>.mdappend one line. - To create new memory → first in
INDEX.mdadd one line (scope → slug + tag), then create the file. - For knowledge that is cross-topic and does not fall under a certain directory: write scope as
-, and match only by tag. - Cross-directory commonalities belong to the nearest ancestor slug; machine-wide ones belong to
host-<host>。 - read-only, do not create; only writing creates files.
- Record onlyentries and locations, and do not record secrets / tokens / passwords in plaintext.
Compaction (compress logs)
logs are append-only and will keep growing longer; they are expensive to read and noisy. Compaction narrows them again:promote still-valid items into rules, delete outdated ones, and keep only the recent context.
- Compact only slugs that have been matched, and never traverse for the sake of compaction.
- Promote stable facts (still-applicable "what it is / how to operate / how to maintain") into
rules/<slug>.md; delete completed todos, overturned conclusions, and pure process logs. - Always retain unfinished todos; for lines where you are unsure whether they are still valid, prefer to keep them.
- Keep the recent segment (for example, the most recent few records) as-is as context; do not clear it down to only markers.
- Append one line at the end as a compaction marker, clearly stating how much was compacted:
- 2026-10-05 14:20 compact 32 行 → 9 行;上提 4 条到 rules - Compaction isthe onlyoperation allowed to rewrite
logs/<slug>.md; in all other cases, only append. INDEX is not changed by compaction.
Naming and labels
- slug: stable, readable, unique, kebab-case, prefer the directory / project's own name (
agent-things)。 - Host-level:
host-<主机名小写>(host-wuren)。 - labels: lowercase kebab-case, 3–6 per entry, prefer reusing existing labels (
#config#wsl#backup). It is the lookup key in INDEX, don't write it as a sentence. - When there is a conflict, add a parent qualifier.
Format
INDEX.md(one per line:scope → slug — 说明 #标签; use scope - to indicate matching by labels only):
# INDEX
- `D:\Project` → `d-project` — 本机所有项目的根 #projects #root
- `D:\Project\agent-things` → `agent-things` — … #node #project
- `-` → `chezmoi` — 点文件 / 配置同步 #dotfiles #config #chezmoi
rules/<slug>.md: free markdown, write "what it is / how to operate / how to maintain". Format, fields, and sections all follow the user's habits,not preset。
logs/<slug>.md(append-only):
# log: agent-things
- 2026-10-04 20:40 todo 清一下 node_modules
- 2026-10-04 20:52 done D: 盘剩 195G,暂不清
- 2026-10-04 21:03 obs Fedora-44 是默认 WSL
Boundaries with adjacent skills
- Project-internal exploration process → project-memory (within the project
./tmp/) - chezmoi / dotfiles / age operations → chezmoi-config-manager; this skill only records "configuration is managed by chezmoi + status/entry point"
- Windows command reliability → windows-shell-reliability, powershell-safe-invocation
- GUI operations → computer-use
This skill only does ledger and indexing, and does not copy other skills.
Lazy initialization
Only create the corresponding rules/ / logs/ file on the first write, and in INDEX.md add one line.