
請在 D:\workspace\llm-wiki 初始化/補(bǔ)齊一個基于 Karpathy LLM Wiki 思路的個人知識庫系統(tǒng)。當(dāng)前目錄可能已有文件請只創(chuàng)建缺失項(xiàng)已有文件先讀取、對比并匯報差異未經(jīng)我確認(rèn)不要覆蓋、移動、刪除或重命名。重要約束當(dāng)前根目錄固定為D:\workspace\llm-wiki當(dāng)前項(xiàng)目不是空目錄因此不要使用“覆蓋式初始化”。只創(chuàng)建缺失的目錄和文件。如果文件已存在不要直接覆蓋先讀取并對比然后告訴我差異等待確認(rèn)。raw/ 目錄由人類擁有LLM 只能讀取絕不修改已有 raw 文件。wiki/ 目錄由 LLM 維護(hù)可創(chuàng)建和更新系統(tǒng)文件但已有文件仍需先對比再確認(rèn)。不要移動、刪除、重命名任何已有文件。不要自動安裝 qmd、npm 包、Python 包或其他依賴。如果 qmd 不存在只記錄“qmd 未安裝/不可用”不要自動安裝不要使用 npx。在 Windows PowerShell 環(huán)境執(zhí)行目錄樹驗(yàn)證優(yōu)先使用 PowerShell 命令不要依賴 tree -L 3。一、創(chuàng)建目錄結(jié)構(gòu)在 D:\workspace\llm-wiki 下創(chuàng)建以下目錄raw/articles/raw/clippings/raw/images/raw/pdfs/raw/notes/raw/personal/wiki/sources/wiki/concepts/wiki/entities/wiki/synthesis/wiki/templates/wiki/outputs/outputs/scripts/最終初始目錄應(yīng)為llm-wiki/├── raw/│ ├── articles/│ ├── clippings/│ ├── images/│ ├── pdfs/│ ├── notes/│ └── personal/├── wiki/│ ├── sources/│ ├── concepts/│ ├── entities/│ ├── synthesis/│ ├── templates/│ ├── outputs/│ ├── index.md│ ├── log.md│ ├── overview.md│ ├── QUESTIONS.md│ └── schema.md├── outputs/├── scripts/│ └── lint.py├── OPENAI.md└── USER_GUIDE.md二、創(chuàng)建 wiki 系統(tǒng)文件在wiki/下創(chuàng)建以下系統(tǒng)文件每個文件的內(nèi)容如下frontmatter 中的date填當(dāng)前日期。wiki/index.md--- type: system-index date: 當(dāng)前日期 graph-excluded: true --- # Knowledge Base Index ## Sources ### Processed ### Unprocessed ## Concepts ## Entities ## Recent Synthesis ## Outputs要求Sources 按日期倒序。不要引用系統(tǒng)文件。wikilink 必須使用英文小寫連字符 slug。wiki/log.md--- type: system-log date: 當(dāng)前日期 graph-excluded: true --- # Operation Log 說明 僅追加操作日志不刪除歷史記錄。 日志格式 YYYY-MM-DD HH:MM | 操作類型 | 說明 示例 2026-05-17 15:30 | init | initialized llm-wiki structurewiki/overview.md--- type: system-overview date: 當(dāng)前日期 graph-excluded: true --- # Overview ## Knowledge Base Health Dashboard | Metric | Value | Notes | |---|---:|---| | 總來源數(shù) | 0 | wiki/sources/ 中的來源頁面數(shù)量 | | 高置信度概念數(shù) | 0 | wiki/concepts/ 中 confidence: high 的頁面數(shù)量 | | 開放問題數(shù) | 0 | wiki/QUESTIONS.md 中未完成問題數(shù)量 | | Stale 頁面數(shù) | 0 | 超過 domain_volatility 時效閾值的概念頁面數(shù)量 |wiki/QUESTIONS.md--- type: system-questions date: 當(dāng)前日期 graph-excluded: true --- # Questions ## Open Questions !-- - [ ] 問題內(nèi)容opened YYYY-MM-DD -- ## Resolved Questions !-- - [x] 問題內(nèi)容resolved YYYY-MM-DD --wiki/schema.md確認(rèn) schema.md 的位置為wiki/schema.md原因schema.md 描述的是 wiki 層的數(shù)據(jù)契約不是根目錄級行為契約因此放在 wiki/ 下最合理。--- type: system-schema date: 當(dāng)前日期 graph-excluded: true --- # Schema ## Page Types | type | directory | purpose | |---|---|---| | source | wiki/sources/ | 外部來源整理頁 | | personal-writing | wiki/sources/ | 個人寫作來源頁 | | concept | wiki/concepts/ | 概念頁 | | entity | wiki/entities/ | 實(shí)體頁 | | synthesis | wiki/synthesis/ | 綜合分析頁 | | system-index | wiki/index.md | 系統(tǒng)索引 | | system-log | wiki/log.md | 操作日志 | | system-overview | wiki/overview.md | 健康儀表盤 | | system-questions | wiki/QUESTIONS.md | 問題池 | | system-schema | wiki/schema.md | 數(shù)據(jù)契約 | | lint-report | wiki/outputs/ | 健康檢查報告 | | query-output | wiki/outputs/ | 查詢輸出 | | gap-report | wiki/outputs/ | 知識空白報告 | ## Required Frontmatter Fields ### source 字段 type, title, date, source_url, domain, author, tags, processed, raw_file, raw_sha256, last_verified, possibly_outdated, language, canonical_source ### Personal Writing 字段 type, title, date, status, topic_tags, confidence_at_writing, superseded_by, raw_file, raw_sha256, last_verified, tags, processed 允許值 status: draft / published / deprecated confidence_at_writing: low / medium / high ### concept 字段 type, title, date, updated, tags, source_count, confidence, domain_volatility, last_reviewed, aliases 允許值 confidence: low / medium / high domain_volatility: low / medium / high ### entity 字段 type, title, date, tags, entity_type, aliases 允許值 entity_type: person / tool / institution / paper / product / service / framework ### synthesis 字段 type, title, date, tags, source_count, confidence 允許值 confidence: low / medium / high ## Slug Rules 所有頁面文件名和 wikilink 目標(biāo)必須使用英文小寫連字符格式。 正確 - mse-microservice-governance - full-link-canary - traffic-control 錯誤 - 微服務(wù)治理 - FullLinkCanary - traffic_control ## Graph Exclusion Rules 以下文件必須包含 graph-excluded: true - wiki/index.md - wiki/log.md - wiki/overview.md - wiki/QUESTIONS.md - wiki/schema.md - wiki/outputs/ 下所有文件Knowledge Base IndexSourcesProcessedUnprocessedConceptsEntitiesRecent SynthesisOutputs要求Sources 按日期倒序。不要引用系統(tǒng)文件。wikilink 必須使用英文小寫連字符 slug。wiki/log.mdfrontmatter:type: system-logdate: 當(dāng)前日期graph-excluded: true正文包含Operation Log說明僅追加操作日志不刪除歷史記錄。日志格式Y(jié)YYY-MM-DD HH:MM | 操作類型 | 說明示例2026-05-17 15:30 | init | initialized llm-wiki structurewiki/overview.mdfrontmatter:type: system-overviewdate: 當(dāng)前日期graph-excluded: true正文包含OverviewKnowledge Base Health DashboardMetricValueNotes總來源數(shù)0wiki/sources/ 中的來源頁面數(shù)量高置信度概念數(shù)0wiki/concepts/ 中 confidence: high 的頁面數(shù)量開放問題數(shù)0wiki/QUESTIONS.md 中未完成問題數(shù)量Stale 頁面數(shù)0超過 domain_volatility 時效閾值的概念頁面數(shù)量wiki/QUESTIONS.mdfrontmattertype: system-questionsdate: 當(dāng)前日期graph-excluded: true正文包含QuestionsOpen QuestionsResolved Questionswiki/schema.md確認(rèn) schema.md 的位置為wiki/schema.md原因schema.md 描述的是 wiki 層的數(shù)據(jù)契約不是根目錄級行為契約因此放在 wiki/ 下最合理。frontmattertype: system-schemadate: 當(dāng)前日期graph-excluded: true正文包含SchemaPage Typestypedirectorypurposesourcewiki/sources/外部來源整理頁personal-writingwiki/sources/個人寫作來源頁conceptwiki/concepts/概念頁entitywiki/entities/實(shí)體頁synthesiswiki/synthesis/綜合分析頁system-indexwiki/index.md系統(tǒng)索引system-logwiki/log.md操作日志system-overviewwiki/overview.md健康儀表盤system-questionswiki/QUESTIONS.md問題池system-schemawiki/schema.md數(shù)據(jù)契約lint-reportwiki/outputs/健康檢查報告query-outputwiki/outputs/查詢輸出gap-reportwiki/outputs/知識空白報告Required Frontmatter Fieldssource字段type, title, date, source_url, domain, author, tags, processed, raw_file, raw_sha256, last_verified, possibly_outdated, language, canonical_sourcePersonal Writing字段type, title, date, status, topic_tags, confidence_at_writing, superseded_by, raw_file, raw_sha256, last_verified, tags, processed允許值status: draft / published / deprecatedconfidence_at_writing: low / medium / highconcept字段type, title, date, updated, tags, source_count, confidence, domain_volatility, last_reviewed, aliases允許值confidence: low / medium / highdomain_volatility: low / medium / highentity字段type, title, date, tags, entity_type, aliases允許值entity_type: person / tool / institution / paper / product / service / frameworksynthesis字段type, title, date, tags, source_count, confidence允許值confidence: low / medium / highSlug Rules所有頁面文件名和 wikilink 目標(biāo)必須使用英文小寫連字符格式。正確mse-microservice-governancefull-link-canarytraffic-control錯誤微服務(wù)治理FullLinkCanarytraffic_controlGraph Exclusion Rules以下文件必須包含 graph-excluded: truewiki/index.mdwiki/log.mdwiki/overview.mdwiki/QUESTIONS.mdwiki/schema.mdwiki/outputs/ 下所有文件三、創(chuàng)建頁面模板wiki/templates/source-template.mdfrontmatter 字段type: sourcetitledatesource_urldomainauthortagsprocessedraw_fileraw_sha256last_verifiedpossibly_outdatedlanguagecanonical_source正文結(jié)構(gòu)Source TemplateSummaryKey PointsConcepts ExtractedEntities ExtractedContradictions與其他來源的分歧。My Noteswiki/templates/personal-writing-template.mdfrontmatter 字段type: personal-writingtitledatestatus: drafttopic_tagsconfidence_at_writing: mediumsuperseded_byraw_fileraw_sha256last_verifiedtagsprocessed正文結(jié)構(gòu)Personal Writing TemplateCore ArgumentKey ClaimsEvidence ReferencedLimitationswiki/templates/concept-template.mdfrontmatter 字段type: concepttitle: 中文主名稱dateupdatedtagssource_countconfidencedomain_volatilitylast_reviewedaliases正文結(jié)構(gòu)中文主名稱Definition中文主名稱English NameKey PointsMy PositionContradictionsSources僅 wikilinks 列表。Evolution Log每次更新追加一條。格式Y(jié)YYY-MM-DDN sources本次認(rèn)知變化的一句話描述wiki/templates/entity-template.mdfrontmatter 字段type: entitytitledatetagsentity_typealiases正文結(jié)構(gòu)Entity TemplateDescriptionKey ContributionsRelated ConceptsSourceswiki/templates/synthesis-template.mdfrontmatter 字段type: synthesistitledatetagssource_countconfidence正文結(jié)構(gòu)Synthesis TemplateThesisEvidenceCounter-evidenceStage 0 反向檢驗(yàn)結(jié)果。SynthesisConfidence NotesLimitationsSources四、創(chuàng)建 scripts/lint.py創(chuàng)建 scripts/lint.py。lint.py 必須執(zhí)行以下 9 項(xiàng)檢查YAML frontmatter 合法性檢查所有 wiki/ 下 .md 文件是否有合法 YAML frontmatter并包含 type 和 date。Broken Wikilinks檢查 [[xxx]] 是否引用了不存在的頁面。Index 一致性檢查 wiki/index.md 中標(biāo)記或引用的文件是否實(shí)際存在。Stub 頁面檢查正文少于 100 字的空殼頁面。系統(tǒng)文件、模板文件、outputs 可排除。近重復(fù)概念名稱檢查 wiki/concepts/ 下 slug 名稱 Jaccard 相似度是否 0.7。SHA-256 完整性檢查 source 頁中的 raw_file 和 raw_sha256。如果 raw 文件當(dāng)前哈希與記錄不一致報告? SOURCE MODIFIED。Stale 頁面根據(jù) concept 頁 domain_volatility 檢查過期high 90 天medium 180 天low 365 天跨語言重復(fù)檢查source URL 相似度不同 concept 頁 aliases 字段是否重疊Wikilink 格式規(guī)范檢查wikilink 是否為英文小寫連字符格式是否存在中文 wikilink如 [[價值投資]]是否存在駝峰、下劃線等非法格式是否存在別名斷鏈lint.py 完成后將報告寫入wiki/outputs/lint-YYYY-MM-DD.md報告 frontmatter 必須包含type: lint-reportdate: 當(dāng)前日期graph-excluded: true五、創(chuàng)建 OPENAI.md創(chuàng)建根目錄文件OPENAI.mdfrontmattertype: behavior-contractdate: 當(dāng)前日期graph-excluded: trueOPENAI.md 必須包含以下章節(jié)系統(tǒng)概述INGEST 操作規(guī)范QUERY 操作規(guī)范LINT 操作規(guī)范REFLECT 操作規(guī)范MERGE 操作規(guī)范ADD-QUESTION 操作規(guī)范Wikilink 使用規(guī)范Wiki 語言規(guī)范Confidence 更新規(guī)則Source Integrity Rules系統(tǒng)文件隔離規(guī)則文檔維護(hù)規(guī)則核心原則必須寫清楚三層架構(gòu)Raw / Wiki / Outputsraw/ 由人類擁有LLM 只能讀取絕不修改wiki/ 由 LLM 維護(hù)可讀取和寫入outputs/ 保存輸出結(jié)果所有知識結(jié)論必須可追溯到 source 頁再追溯到 raw 文件六、創(chuàng)建 USER_GUIDE.md創(chuàng)建根目錄文件USER_GUIDE.mdfrontmattertype: user-guidedate: 當(dāng)前日期graph-excluded: true必須包含快速開始三層目錄說明常用觸發(fā)詞如何放入 raw 材料如何執(zhí)行 ingest如何執(zhí)行 query如何執(zhí)行 lint如何執(zhí)行 reflectWikilink 規(guī)范Confidence 規(guī)則維護(hù)規(guī)則要求當(dāng) OPENAI.md 規(guī)則變化時USER_GUIDE.md 對應(yīng)章節(jié)必須同步更新。七、初始化 qmd 索引先檢查 qmd 是否存在qmd --version如果 qmd 可用執(zhí)行qmd add wiki/qmd status如果 qmd 不可用不要安裝不要使用 npx在最終報告中寫明qmd 當(dāng)前不可用索引初始化未執(zhí)行八、執(zhí)行 lint執(zhí)行python scripts/lint.py如果 Python 不可用嘗試py scripts/lint.py如果都不可用在最終報告中說明。九、執(zhí)行完成后的驗(yàn)證報告完成后輸出以下驗(yàn)證報告當(dāng)前工作目錄目錄結(jié)構(gòu)樹最多 3 層OPENAI.md 包含的章節(jié)列表wiki/schema.md 是否存在以及包含的 Page Typeswiki/templates/ 下的模板文件列表scripts/lint.py 包含的 9 項(xiàng)檢查列表qmd status 輸出如果 qmd 不可用說明未執(zhí)行l(wèi)int 報告路徑是否存在未覆蓋的已有文件下一步建議放入第一篇 raw 材料例如 微服務(wù)治理參考https://www.bilibili.com/video/BV1Ki5C6BEEL/?spm_id_from333.337.search-card.all.clickvd_source4d02563e0aa06f2983dd90aefb4bd1f1