yzr-llm-wiki-management
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLLM Wiki Management
LLM Wiki Management
按 Karpathy LLM Wiki 设计哲学
维护一个本地、复利累积的知识库:用户只管读 + 提供资料 + 提问题,LLM 负责摘要、
交叉引用、归档、簿记这些"无聊的部分"。和各类云端 wiki skill 的关键区别是
本地文件 + 三层纪律——vs 云端 MCP 单层文档。
本 skill 提供三块交付物:
- SKILL.md(本文)——工作流 + 纪律的"宪法"
- 确定性执行(归 llmw CLI,)——本 skill 零代码。原 scripts/ 的 deterministic 工具(lint / fixtures 检查 / ingest 探测 / 机械写)全部收敛为
llmw.content子命令:llmw(详见 §工作流各节)。高频确定性任务固化在 CLI,agent 只负责需要判断的部分。llmw wiki lint / check-fixtures / ingest-diff / write - references/——按需加载:各操作详细流程(ingest / query / lint / upgrade)、页面模板
(page-templates.md)、lint-checklist、external-repo(接入 + 跨主机重建)。骨架模板 + fixtures(CLI 字节级比对金标准)内建于 CLI 包资产(探测),upgrade-workflow.md §六 (语义合并规则,agent 走 upgrade plan 时的合并依据)
llmw wiki check-fixtures
Maintain a local, compound-growth knowledge base following Karpathy's LLM Wiki Design Philosophy: Users only need to read, provide materials, and ask questions, while the LLM handles "boring parts" like summarization, cross-referencing, archiving, and bookkeeping. The key difference from various cloud wiki skills is local files + three-layer discipline — versus cloud MCP single-layer documents.
This skill delivers three components:
- SKILL.md (this document) — The "constitution" of workflows and disciplines
- Deterministic Execution (managed by llmw CLI, ) — This skill has zero code. All deterministic tools in the original scripts/ (lint/ fixtures check/ ingest detection/ mechanical writing) are consolidated into
llmw.contentsubcommands:llmw(see workflow sections for details). High-frequency deterministic tasks are solidified in the CLI, and agents only handle parts requiring judgment.llmw wiki lint / check-fixtures / ingest-diff / write - references/ — Load on demand: detailed processes for each operation (ingest/ query/ lint/ upgrade), page templates (page-templates.md), lint-checklist, external-repo (access + cross-host reconstruction). Skeleton templates + fixtures (CLI byte-level comparison golden standard) are built into CLI package assets (detected via ), and upgrade-workflow.md §6 (semantic merge rules, the basis for agents when following upgrade plans)
llmw wiki check-fixtures
输入 / 输出
Input / Output
启动时需具备的信息
Information Required at Startup
| 信息 | 来源 | 备注 |
|---|---|---|
| Wiki 根目录 | | 例 |
| 主题名 | setup 时一次性指定,写入 | 例 "LLM Systems" |
| 操作类型 | 用户自然语言 | ingest / query / lint / upgrade / setup |
| 触发资料 | ingest 时给文件路径或目录 | 必须在 |
| Information | Source | Notes |
|---|---|---|
| Wiki root directory | | Example: |
| Topic name | Specified once during setup, written to | Example: "LLM Systems" |
| Operation type | User's natural language | ingest / query / lint / upgrade / setup |
| Trigger materials | File path or directory during ingest | Must be within |
操作产物
Operation Products
- setup → 由 workspace CLI 完成(按 CLI 包内模板落盘), 本 skill 不实现创建逻辑;产物形态为目录结构 + AGENTS.md(SSOT)+ CLAUDE.md(薄壳)+ wiki/index.md + wiki/log.md + MEMORY/MEMORY.md + .gitignore
- ingest → 新增 / 更新 + 同步实体 / 概念页 + 追加
wiki/sources/<slug>.md条目 + 更新log.mdindex.md - query → 对话中给出答案(带引用),可选把答案归档为 或
wiki/comparisons/wiki/syntheses/<slug>.md - lint → 中报告:raw/ 是否被改、孤儿页、断裂交叉引用、过期摘要、缺 frontmatter、log.md 格式
log - upgrade → (dry-run →
llmw wiki upgrade)修骨架(byte/block/ header-owned + legacy paths);内容页 frontmatter legacy 走--apply --yes拿lint --check-version --apply,agent 按actions[]§六 修;详见 §5 Upgradereferences/upgrade-workflow.md
- setup → Completed by workspace CLI (rendered from templates in the CLI package), this skill does not implement creation logic; products include directory structure + AGENTS.md (SSOT) + CLAUDE.md (thin shell) + wiki/index.md + wiki/log.md + MEMORY/MEMORY.md + .gitignore
- ingest → Add/update + sync entity/concept pages + append entries to
wiki/sources/<slug>.md+ updatelog.mdindex.md - query → Provide answers in the conversation (with references), optionally archive answers as or
wiki/comparisons/wiki/syntheses/<slug>.md - lint → Report in : whether raw/ has been modified, orphan pages, broken cross-references, outdated summaries, missing frontmatter, log.md format issues
log - upgrade → (dry-run →
llmw wiki upgrade) fixes the skeleton (byte/block/header-owned + legacy paths); legacy frontmatter of content pages is fixed via--apply --yesto getlint --check-version --apply, and agents modify according to upgrade-workflow.md §6; see §5 Upgrade for detailsactions[]
执行原则 / 边界
Execution Principles / Boundaries
核心原则
Core Principles
操作前置(orient ritual,所有操作通用):每次 ingest / query / lint 启动前,不依赖 symlink ——按以下顺序读完四件套再动手:
- 确认
已在上下文(经薄壳 CLAUDE.md 或原生加载——会话常驻;<wiki-root>/AGENTS.md是CLAUDE.md薄壳,不持纪律)——拿到本 wiki 的主题名与「当前配置」表(@AGENTS.md行)。MEMORY 全文经顶部Wiki Format 版本@MEMORY/MEMORY.md已在上下文;tag 白名单在@import(见 §核心原则 §6)wiki/tags.md ——知道有哪些页、分布在哪些类别,避免重复创建 / 漏交叉引用Read <$LLM_WIKI_ROOT>/wiki/index.md (最近 ~30 行即可)——看清最近活动,避免重复 ingest / 漏归档旧工作Read <$LLM_WIKI_ROOT>/wiki/log.md (按需)——确认本 wiki 是否有 项目级扩展脚本的完整分节契约(使用场景 / 调用约定 / 作用 / 前置依赖);不强制(wiki 可无 scripts/),但触发非标工作流前必须先查(AGENTS.md 顶部的Read <$LLM_WIKI_ROOT>/scripts/SCRIPTS.md@scripts/SCRIPTS.md已加载全文)@import四件套任一未读完不写任何 wiki 内容。100+ 页的 wiki 还应在全域wiki/补一次——单看 index.md 可能漏掉 entity/concept 页之间的引用关系。Grep "<topic>"
- raw/ 由用户掌控,LLM 只读——两处写权限例外(symlink 接入 +
raw/external/协作草稿)不得外推;操作细节见raw/discussions//references/external-repo.mdreferences/ingest-workflow.md §10 - 写操作正路 = 系列——log 追加走
llmw wiki write、新建页走write log、编辑已审页后清write new戳走reviewed、MEMORY 新条目走write touch、index 条目走write memory add;格式 +write index add截断由脚本保证,lint 只兜底带外手改。逃生舱:脚本不支持的形态手写 Edit/Write 合法、lint 兜底——脚本是默认路径不是闸门LOG_RETENTION_LIMIT - 每页必带 YAML frontmatter——新建页走 (5 必填 + 推荐
llmw wiki write new)。权威定义(description取值 / reserved /type特化 / 可信度信号)见sources§一;例外清单(index / log / MEMORY / MEMORY*)同节references/page-templates.md - LLM 修改已审核页必须清 戳——每次编辑后跑
reviewed;生命周期规则 canonical 见llmw wiki write touch「可信度与认知质量信号」段;lint 用page-templates.md兜底reviewed-stale - MEMORY/ 是 LLM agent 的私有记忆——新条目走 ;只改
llmw wiki write memory add这一份(无副本漂移)。物理位置在MEMORY/MEMORY.md而非<wiki-root>/内 = publish 时自然留作私有层不外传;写入流程见工作流 §4wiki/ - tag 白名单在 ——取值 / 解析 / 审计循环 canonical 在 fixture 头部说明块(落盘即读);lint 语义见
wiki/tags.mdlint-checklist.md §11
Operation Preprocessing (orient ritual, applicable to all operations): Before starting any ingest/ query/ lint operation, do not rely on symlinks — read the four components in the following order before taking action:
- Confirm
is in context (loaded via thin shell CLAUDE.md or natively — persistent in the session;<wiki-root>/AGENTS.mdis a thin shell ofCLAUDE.mdand does not hold disciplines) — obtain the wiki's topic name and "current configuration" table ("Wiki Format Version" row). The full MEMORY content is already in context via the top@AGENTS.md@MEMORY/MEMORY.md; tag whitelist is in@import(see §Core Principles §6)wiki/tags.md — Know which pages exist and their categories, avoid duplicate creation/ missing cross-referencesRead <$LLM_WIKI_ROOT>/wiki/index.md (last ~30 lines are sufficient) — Review recent activities, avoid duplicate ingest/ missing archiving of old workRead <$LLM_WIKI_ROOT>/wiki/log.md (as needed) — Confirm whether this wiki has a complete section contract for project-level extended scripts (usage scenarios/ calling conventions/ functions/ preconditions); not mandatory (wiki may not have scripts/), but must check before triggering non-standard workflows (theRead <$LLM_WIKI_ROOT>/scripts/SCRIPTS.md@scripts/SCRIPTS.mdat the top of AGENTS.md has loaded the full content)@importDo not write any wiki content if any of the four components are not read. For wikis with 100+ pages, also runacross the entireGrep "<topic>"directory — relying solely on index.md may miss reference relationships between entity/concept pages.wiki/
- raw/ is controlled by users, LLM has read-only access — Two write permission exceptions (symlink access +
raw/external/collaborative drafts) cannot be extended; seeraw/discussions//references/external-repo.mdfor operation detailsreferences/ingest-workflow.md §10 - Standard write operations = series — Append logs via
llmw wiki write, create new pages viawrite log, clear thewrite newtimestamp after editing approved pages viareviewed, add new MEMORY entries viawrite touch, add index entries viawrite memory add; format +write index addtruncation are guaranteed by scripts, and lint only handles manual modifications outside the standard path. Escape hatch: Manual Edit/Write is allowed for formats not supported by scripts, with lint as a fallback — scripts are the default path, not a gatekeeperLOG_RETENTION_LIMIT - Every page must have YAML frontmatter — create new pages via (5 required fields + recommended
llmw wiki write new). Authoritative definitions (values ofdescription/ reserved fields/typespecialization/ credibility signals) are insources§1; exception list (index/ log/ MEMORY/ MEMORY*) is in the same sectionreferences/page-templates.md - LLM must clear the timestamp when modifying approved pages — Run
reviewedafter each edit; canonical lifecycle rules are in the "Credibility and Cognitive Quality Signals" section ofllmw wiki write touch; lint usespage-templates.mdas a fallbackreviewed-stale - MEMORY/ is the private memory of LLM agents — Add new entries via ; only modify
llmw wiki write memory add(no copy drift). Its physical location inMEMORY/MEMORY.mdinstead of<wiki-root>/means it is naturally kept as a private layer and not published during publishing; see Workflow §4 for writing processwiki/ - Tag whitelist is in — Canonical values/ parsing/ audit cycle are explained in the header block of the fixture (read immediately after being written to disk); lint semantics are in
wiki/tags.mdlint-checklist.md §11
边界
Boundaries
- 不绕过 自创约定——若 AGENTS.md 没说的,先问用户再写
AGENTS.md
其余边界纪律以 wiki 根为准(自动加载,会话常驻)。AGENTS.md
- Do not bypass to create custom conventions — If AGENTS.md does not specify, ask the user first before writing
AGENTS.md
Other boundary disciplines are subject toin the wiki root (automatically loaded, persistent in the session).AGENTS.md
反模式(绝对禁止)
Anti-Patterns (Absolutely Forbidden)
- 跨 wiki 互引但不更新对端 index(同步是用户责任)
其余反模式以 wiki 根+AGENTS.md§五 为准。references/external-repo.md
- Cross-wiki references without updating the index of the target wiki (synchronization is the user's responsibility)
Other anti-patterns are subject toin the wiki root +AGENTS.md§5.references/external-repo.md
反合理化三件套(纪律型 skill 必带)
Anti-Rationalization Triad (Mandatory for Discipline-Based Skills)
本 skill 是纪律型 skill(含多条"必须 / 禁止 / 不"+"不" 起始段)。纪律型禁令在 LLM 压力下会被以各种合理化借口绕开——三件套只堵一类:已被合理化的违反。 未被合理化的违反(直接忽略规则)= 缺 §反模式 清单本身,与三件套无关。
This skill is a discipline-based skill (contains multiple "must/ forbidden/ not" + sections starting with "not"). Discipline-based prohibitions may be bypassed by the LLM under pressure with various rationalizations — the triad only blocks one type: rationalized violations. Unrationalized violations (directly ignoring rules) mean the anti-pattern list itself is incomplete, and are unrelated to the triad.
Rationalization Table
Rationalization Table
baseline 实跑记录:3 次 RED 运行——① 带纪律 ingest 任务:全程合规零借口;② 无纪律 ingest 任务(Iron Law 创建场景):仍合规(模型自带该 规范知识);③ 带纪律 + 用户施压任务("随便记一下 / 赶时间"):产出真实借口一条(下表 第 1 行)+ 一处静默遗漏(frontmatter 缺必填字段,无借口直接漏掉)。tags
| 常见借口 | 为什么是错的 | 应改做什么 |
|---|---|---|
| "剪藏只有一句话,按'克制建页'原则和你说的小事轻办,一个资料页够了"(实跑 transcript) | 用户的"随便 / 赶时间"是态度不是豁免——写 wiki 页即触发 5 必填 / 建页阈值 / log 纪律;"轻办"是拿用户情绪当省略纪律的挡箭牌(同轮还静默漏了必填 | 流程不缩水;"克制建页"判断如实执行但向用户说明("本文只有一个中心主题,暂不建概念页,出现第二篇同主题再补"),字段与 log 纪律照走 |
收录纪律:表内条目只从实跑 transcript 收录(预写借口 = 噪声 + 信号干扰; 与「反合理化」原则一致)。本表当前仅 1 行(3 次 RED 仅产出 1 条真实借口 + 1 处 静默遗漏);未来实跑中出现的新借口补入本表,未出现不新增。
Baseline actual run records: 3 RED runs — ① Disciplined ingest task: fully compliant with zero excuses; ② Undisciplined ingest task (Iron Law creation scenario): still compliant (the model has built-in knowledge of the规范); ③ Disciplined + user-pressured task ("Just jot it down/ hurry up"): produced one real excuse (row 1 in the table below) + one silent omission (missing requiredfield in frontmatter, omitted directly without excuse).tags
| Common Excuse | Why It's Wrong | What to Do Instead |
|---|---|---|
| "The clipping only has one sentence, following the 'restrained page creation' principle and your advice to handle small matters lightly, one source page is enough" (actual run transcript) | The user's "casual/ hurry up" is an attitude, not an exemption — creating a wiki page triggers the 5 required fields/ page creation threshold/ log disciplines; "handling lightly" uses the user's emotion as an excuse to skip disciplines (the same run also silently omitted the required | Do not shrink the process; execute the "restrained page creation" judgment truthfully but explain to the user ("This document only has one central topic, no concept page will be created for now, and it will be added when a second document on the same topic appears"), and follow the field and log disciplines as required |
Inclusion Rule: Entries in the table are only collected from actual run transcripts (pre-written excuses = noise + signal interference; consistent with the "anti-rationalization" principle). The table currently has only 1 row (3 RED runs produced only 1 real excuse + 1 silent omission); new excuses from future actual runs will be added to the table, and no entries will be added if they do not appear.
违反字面 = 违反精神
Violating the Letter = Violating the Spirit
任何对 §核心原则 / §边界 / §反模式 三段禁令的"看起来不同但效果一致"绕法都算违反——本 skill 常见绕法前三:
- 把 /
Edit改为Write+ 手动生成新内容再Read——不算绕开"用 Read 之外工具做自动修改"禁令,操作工具是 Write 一样算Write - 把"不删除 wiki 页"解释为"先把内容拷出去再 然后写回"——不算绕开不删禁令,状态效果完全等同
rm - 把"raw/ 由用户掌控,LLM 只读"解释为"我进 raw/ 后立即再
cp,窗口里我读到了内容 = 等价于只读"——不算,写入发生在第一步rm
禁止用"严格按字面 / 严格按精神"二选一措辞给 agent 留退路——任何"看起来不同但效果等价"都是违反。
Any workaround that "looks different but has the same effect" for the prohibitions in §Core Principles/ §Boundaries/ §Anti-Patterns is considered a violation — the top three common workarounds for this skill:
- Changing /
EdittoWrite+ manually generating new content thenRead— does not bypass the prohibition of "using tools other than Read for automatic modification", using Write as the operation tool still countsWrite - Interpreting "do not delete wiki pages" as "copy the content out first, then , then write it back" — does not bypass the no-deletion prohibition, the state effect is exactly the same
rm - Interpreting "raw/ is controlled by users, LLM has read-only access" as "I into raw/ then immediately
cp, I read the content in the window = equivalent to read-only" — does not, writing occurs in the first steprm
Forbid using "strictly literal/ strictly spiritual" alternative wording to leave loopholes for agents — any "looks different but has the same effect" is a violation.
Red Flags(念头清单 — 出现即停)
Red Flags (Thought List — Stop Immediately When They Appear)
念头出现 ≠ 已违反;念头 = 警告 = 重读 §核心原则 / §边界 / §反模式 三段。
- "用户说'随便记一下 / 赶时间 / 别太正式'——纪律可以打折了"(实跑观察)
- "我觉得这一步对当前 case 不必要"
- "用户没明说要我做这步"
- "这样更快 / 更省 token / 更高效"
- "约定没禁止"
- "我已经做了等价的事" / "效果一样不算违反"
- "先这样留着,回头再补"
- "我自己生成字段比 frontmatter 严格写更灵活"
- "log 条目这次先跳过,反正是 wiki 不是 git"
- "raw 反正用户也天天改,我帮一下忙"
- "lint 报了一堆,反正都是 warn 不算错"
没有"念头清单 = 已违反"的递进——念头出现是信号,再走下去才成行动。 但念头后仍继续 = 默认承担违反精神的责任。
Having a thought ≠ having violated a rule; thoughts = warnings = re-read §Core Principles/ §Boundaries/ §Anti-Patterns.
- "The user said 'Just jot it down/ hurry up/ don't be too formal' — disciplines can be relaxed" (actual run observation)
- "I think this step is unnecessary for the current case"
- "The user didn't explicitly ask me to do this step"
- "This is faster/ saves more tokens/ is more efficient"
- "The convention doesn't prohibit it"
- "I've done something equivalent" / "Same effect doesn't count as a violation"
- "Leave it like this for now, I'll fix it later"
- "Generating fields myself is more flexible than writing strictly according to frontmatter"
- "Skip the log entry this time, it's a wiki not git anyway"
- "The user modifies raw/ every day, I'll help out"
- "Lint reported a lot of issues, but they're all warnings so they don't count as errors"
There is no progression of "thought list = violation" — having a thought is a signal, and continuing to act will lead to a violation. But continuing after having a thought = assuming responsibility for violating the spirit.
工作流 / 步骤
Workflows / Steps
0. 一次性 setup(首次使用)—— 由 workspace CLI 完成
0. One-Time Setup (First Use) — Completed by Workspace CLI
职责边界:本 skill 只负责 wiki 的成长阶段(ingest / query / lint)。 wiki 仓的创建与删除由 workspace CLI 负责——命令是(与本 skill 同仓维护, 命令名与参数见其自带文档); wiki 仓的"出生形态"由 CLI 包内模板渲染决定——llmw探测。 产物形态见 §输入/输出 操作产物。llmw wiki check-fixtures
LLM agent 接管后做什么:
- 验证 CLI 落盘——读 确认主题名 + 日期替换正确;
<wiki-root>/AGENTS.md/wiki/index.md存在且 frontmatter 完整;wiki/log.md是薄壳<wiki-root>/CLAUDE.md - 跑 orient ritual(见 §执行原则 / 边界 顶部引用块)
- 询问用户是否做首次 ingest——若是,把第一份资料路径给 agent
Responsibility Boundary: This skill only handles the growth phase of the wiki (ingest/ query/ lint). The creation and deletion of wiki repositories are handled by the workspace CLI — the command is(maintained in the same repository as this skill, see its built-in documentation for command names and parameters); the "birth form" of the wiki repository is determined by template rendering in the CLI package — detected viallmw. See §Input/Output Operation Products for product forms.llmw wiki check-fixtures
What LLM agents do after taking over:
- Verify CLI deployment — Read to confirm the topic name and date are replaced correctly;
<wiki-root>/AGENTS.md/wiki/index.mdexist and have complete frontmatter;wiki/log.mdis a thin shell<wiki-root>/CLAUDE.md - Run the orient ritual (see the quoted block at the top of §Execution Principles / Boundaries)
- Ask the user if they want to do the first ingest — if yes, provide the path of the first material to the agent
1. Ingest(摄取新资料)
1. Ingest (Ingest New Materials)
触发:"把这篇摄取到 wiki" / 有新文件 / 跑 发现未摄取项。
raw/llmw wiki ingest-diff流程摘要(agent 驱动;详细 7 步 + 批处理见
;外部代码仓 5 步接入 /
漂移刷新 / 跨主机重建见 ):
references/ingest-workflow.mdreferences/external-repo.md- 跑 (日常加
llmw wiki ingest-diff)找出未摄取/待重摄文件清单--check-stale - 单篇对一下要点——仅交互式单篇或少量场景:确认主题方向 / 重点交叉的 entity / 用户判断要保留
- 对每个文件:Read 全文 → 提取元数据 → 建骨架 → 写正文(stale-raw 走 Edit,不 Write 覆盖)→ 同步 entity/concept(只 append "Sources" 段) →
llmw wiki write new --type=source ...→llmw wiki write index add→ 编辑过的页跑llmw wiki write log --op=ingestllmw wiki write touch - commit(仅启用 git 时):节奏由用户/agent 决定,不自动 commit
Triggers: "Ingest this into the wiki" / New files in / Running finds uningested items.
raw/llmw wiki ingest-diffProcess Summary (agent-driven; detailed 7 steps + batch processing in ; 5-step access/ drift refresh/ cross-host reconstruction for external code repositories in ):
references/ingest-workflow.mdreferences/external-repo.md- Run (add
llmw wiki ingest-difffor daily use) to find the list of uningested/ re-ingestable files--check-stale - Verify key points for single files — Only for interactive single-file or small-scale scenarios: confirm topic direction/ key cross-referenced entities/ user's judgment on what to retain
- For each file: Read the full text → Extract metadata → Create a skeleton via → Write the body (use Edit instead of Write overwrite for stale-raw) → Sync entity/concept pages (only append the "Sources" section) →
llmw wiki write new --type=source ...→llmw wiki write index add→ Runllmw wiki write log --op=ingestfor edited pagesllmw wiki write touch - commit (only when git is enabled): Rhythm is determined by the user/agent, do not auto-commit
批处理摄取(≥ 3 份 raw 同时摄入)
Batch Ingest (≥ 3 raw materials ingested simultaneously)
走批处理路径而非逐份。一次聚合、一次写入、一次索引——避免 N 次重复 search / N 次
index 更新 / N 条 log。5 步流程 + 为什么批处理 + log 标题前缀 的细节见
「批处理」节。
Bulk:references/ingest-workflow.md外部代码仓作为语料——若用户说"把 X 仓库纳入 wiki":不内嵌拷仓,走
的 symlink 路径
( 总纪律的写权限例外之一——symlink + anchor 一律经
CLI 子命令落盘;另一处例外是 协作草稿,见 ingest-workflow.md §10)。
接入命令:(CLI 自动建 symlink +
读 git 身份字段 + 原子写 anchor);随后 扫描;漂移刷新 /
跨主机重建()见 。
external-repo.mdraw/llmw wiki externalraw/discussions/llmw wiki external add <target> --name=<n> [--notes=...]llmw wiki ingest-diffllmw wiki external rebuildreferences/external-repo.mdUse the batch processing path instead of processing one by one. Aggregate once, write once, index once — avoid N repeated searches/ N index updates/ N log entries. See the "Batch Processing" section of for details on the 5-step process/ why batch processing/ log title prefix .
references/ingest-workflow.mdBulk:External code repositories as corpus — If the user says "Include repo X in the wiki": do not embed or copy the repository, use the symlink path in (one of the write permission exceptions to the raw/ core discipline — symlinks + anchors are always written via the CLI subcommand; the other exception is collaborative drafts, see ingest-workflow.md §10). Access command: (CLI automatically creates symlinks + reads git identity fields + atomically writes anchors); then run to scan; see for drift refresh/ cross-host reconstruction ().
external-repo.mdllmw wiki externalraw/discussions/llmw wiki external add <target> --name=<n> [--notes=...]llmw wiki ingest-diffreferences/external-repo.mdllmw wiki external rebuild2. Query(跨页综合)
2. Query (Cross-Page Synthesis)
触发:"wiki 里有 X 吗" / "总结 wiki 中关于 Y 的内容" / "对比 A 和 B"。
流程:
- 先看 index.md——按关键词 / 类别找候选页
- 读相关页(不读 raw——raw 已经在 source 页里消化过)
- 跨页综合——用引用形式带 source 链接;矛盾处显式标注:"A 说 X(来源:...), B 说 Y(来源:...),需要更深入调研"
- 展示答案 + 询问归档——如果答案有"对比 / 综合 / 发现联系"的性质,询问用户:
"这段答案适合归档回 wiki 作为 comparisons/.md 吗?"
<slug> - 用户同意后归档——走 references/page-templates.md 的 或
comparison模板 + 追加 log 条目synthesis
详细 query 流程与判定规则见 。
references/query-workflow.mdTriggers: "Does the wiki have X?" / "Summarize content about Y in the wiki" / "Compare A and B".
Process:
- Check index.md first — Find candidate pages by keywords/ categories
- Read relevant pages (do not read raw/ — raw/ has already been digested in source pages)
- Cross-page synthesis — Include source links in reference format; explicitly mark contradictions: "A states X (Source: ...), B states Y (Source: ...), further research is needed"
- Display answer + ask about archiving — If the answer has the nature of "comparison/ synthesis/ discovering connections", ask the user: "Is this answer suitable for archiving back to the wiki as comparisons/.md?"
<slug> - Archive after user approval — Use the or
comparisontemplate from references/page-templates.md + append a log entrysynthesis
See for detailed query processes and judgment rules.
references/query-workflow.md3. Lint(健康检查)
3. Lint (Health Check)
触发:"lint wiki" / 定期(频率阈值见 lint-checklist.md §七)/ 大型 wiki 主动建议。
流程:
- 跑 做 deterministic 检查
llmw wiki lint - 脚本覆盖(大类如下,权威清单见 ): raw 不可变性 / frontmatter 字段 / 孤儿页 / 断链 / log.md 格式 / 过期摘要 / 页面体量 / 认知质量与可信度信号(
references/lint-checklist.md/reviewed/contested)/contradictionssymlink ↔ anchor 关联(external-repo.md)/ fixtures 一致性(见下文「fixtures 一致性检查」段)raw/external/ - 脚本输出后 agent 还要做半定性检查:矛盾主张 / 缺失交叉引用 / 建议新摄取方向
- 报告 + 询问用户哪些修
详细 checklist 见 。
references/lint-checklist.mdTriggers: "Lint the wiki" / Regularly (frequency threshold in lint-checklist.md §7) / Proactively suggest for large wikis.
Process:
- Run for deterministic checks
llmw wiki lint - Script coverage (major categories below, authoritative list in ): raw immutability/ frontmatter fields/ orphan pages/ broken links/ log.md format/ outdated summaries/ page volume/ cognitive quality and credibility signals (
references/lint-checklist.md/reviewed/contested) /contradictionssymlink ↔ anchor association (external-repo.md)/ fixture consistency (see the "Fixture Consistency Check" section below)raw/external/ - After script output, agents must also perform semi-qualitative checks: contradictory claims/ missing cross-references/ suggestions for new ingest directions
- Report + ask the user which fixes to implement
See for detailed checklists.
references/lint-checklist.md4. Memory(写入 LLM agent 持久化记忆)
4. Memory (Write to LLM Agent's Persistent Memory)
触发:在 ingest / query / lint 过程中识别到值得沉淀的信息——踩坑、用户偏好、跨文档关联。
何时写:
- 遇到踩坑(例:raw/ PDF 频繁 OCR 错误,下次让用户先转格式)
- 发现用户偏好(例:用户偏好表格化对比、不喜散文式总结)
- 跨 ingest 关联(两 source 页指向同一论文不同章节)
- lint 报告的 recurring pattern(每次 lint 都报某 type 缺字段)
流程摘要(agent 主动;frontmatter 字段 / 索引同步 / 完整 vs 短条目判定的权威定义在
wiki 根 的 节 + fixture 头部说明块 canonical):
AGENTS.mdMEMORY/memory-index.txt- 决定是否值得写——能否让未来 agent 工作更顺?
- 判别条目形式:完整(含 why+how 上下文)→ 建文件 + 索引行,再 Edit 写正文;短(纯 reminder)→ 直接
llmw wiki write memory add --slug=... --title=...加一行索引MEMORY/MEMORY.md - 写正文——记录具体经验,含上下文 / 解决步骤 / 未来如何避免
- 不追加 log 条目 / 不在 wiki/index.md 列出(MEMORY 不走单一入口约束)
纪律:
- 不删除任何 MEMORY 文件——踩坑记录沉淀下来
- 写新文件时保留原 字段;只更新
createdupdated - 用户不直接编辑 MEMORY/——若用户想补充,先转告 agent 由 agent 写入
Triggers: Identify information worth沉淀 during ingest/ query/ lint processes — pitfalls, user preferences, cross-document associations.
When to Write:
- Encountering pitfalls (e.g., frequent OCR errors in raw/ PDFs, ask the user to convert the format first next time)
- Discovering user preferences (e.g., user prefers tabular comparisons, dislikes prose-style summaries)
- Cross-ingest associations (two source pages point to different chapters of the same paper)
- Recurring patterns in lint reports (every lint reports missing fields for a certain type)
Process Summary (agent-initiated; authoritative definitions of frontmatter fields/ index synchronization/ full vs short entry judgment are in the section of in the wiki root + the header block of fixture ):
MEMORY/AGENTS.mdmemory-index.txt- Decide if it's worth writing — Will it make future agent work smoother?
- Determine entry form: Full (includes why+how context) → Create a file + index entry via , then Edit to write the body; Short (pure reminder) → Directly add an index line to
llmw wiki write memory add --slug=... --title=...MEMORY/MEMORY.md - Write the body — Record specific experience, including context/ solution steps/ how to avoid it in the future
- Do not append log entries/ do not list in wiki/index.md (MEMORY does not follow the single-entry constraint)
Disciplines:
- Do not delete any MEMORY files — Pitfall records are preserved
- Retain the original field when writing new files; only update
createdupdated - Users do not directly edit MEMORY/ — If the user wants to add content, inform the agent first and let the agent write it
5. Upgrade(升级 wiki format)
5. Upgrade (Upgrade Wiki Format)
触发:用户说"升级 wiki / 迁移 / 检查 wiki 版本 / 老格式 / format 升级 / 是否需要
reformat";或 报告 / legacy warn。
llmw wiki lintwiki-format-version-stale职责:三方分工——CLI 修骨架(byte/block/header-owned + legacy
paths + self-verify + blocked_drift 3 终态);lint plan 修内容页 frontmatter
legacy(当前仅 );agent 负责 drift 裁定(本地定制搬 MEMORY 或丢弃)+
§六语义合并(index 重复 / MEMORY 归并)。迁移期不走 ;
不追加 log 条目。
llmw [wiki] upgradeactions[]type-memory-valuellmw wiki write完整步骤(5 步流程 / drift 裁定 / 决策树 / 语义合并规则 §6.1-§6.4)见 。
references/upgrade-workflow.mdTriggers: User says "Upgrade the wiki/ migrate/ check wiki version/ old format/ format upgrade/ need reformat"; or reports / legacy warnings.
llmw wiki lintwiki-format-version-staleResponsibilities: Three-party division of labor — CLI fixes the skeleton (byte/block/header-owned + legacy paths + self-verify + blocked_drift 3 final states); lint plan fixes legacy frontmatter of content pages (currently only ); agents are responsible for drift adjudication (retain or discard local custom MEMORY) + §6 semantic merging (index duplication/ MEMORY merging). Do not use during migration; do not append log entries.
llmw [wiki] upgradeactions[]type-memory-valuellmw wiki writeComplete Steps (5-step process/ drift adjudication/ decision tree/ semantic merge rules §6.1-§6.4) are in .
references/upgrade-workflow.md参考样例
Reference Examples
5 个完整样例(setup / ingest / query / lint / upgrade)见 ——按需 Read。
references/examples.md5 complete examples (setup/ ingest/ query/ lint/ upgrade) are in — Read as needed.
references/examples.md