codebase-wiki
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCodebase Wiki pack — how to work here
Codebase Wiki 启动包——如何在此开展工作
This project holds an agent-authored wiki of a codebase — DeepWiki, but living in the repo. A coding agent reads the source and writes a navigable, diagram-rich, source-grounded wiki as markdown under . It is version-controlled and diffable, private by default, human+agent co-editable, renders in OK's live preview, and doubles as durable grounding context for future agent sessions. There is no separate Q&A surface — Q&A is "the OK-grounded agent + ".
wiki/searchThis skill is pack guidance. The platformskill (read/write/preview/linking/grounding rules) still governs every markdown operation — this layers the wiki workflow on top./open-knowledge
本项目包含一个由Agent编写的代码库wiki——即DeepWiki,但它直接托管在代码仓库中。编码Agent会读取源代码,并在目录下以Markdown格式编写一个可导航、富含图表、基于源代码的wiki。该wiki支持版本控制与差异对比,默认私有,支持人类与Agent协同编辑,可在OK的实时预览中渲染,同时还能作为未来Agent会话的持久化上下文。本项目没有独立的问答界面——问答功能由「基于OK的Agent + 工具」实现。
wiki/search本技能为套件使用指南。平台的技能(读写/预览/链接/上下文关联规则)仍管控所有Markdown操作——本指南仅在其基础上叠加wiki工作流。/open-knowledge
The shape
目录结构
wiki/
OVERVIEW.md hub: what it is, a big-picture architecture diagram, a nav map to every section.
Frontmatter carries `profile` (audience/depth) + `source_commit` (freshness anchor).
log.md append-only generation / refresh audit trail
architecture/ system boundaries, layers, subsystems, cross-cutting concerns + diagrams
modules/ one page per package / module: purpose, entry points, key files, deps
flows/ key end-to-end flows as sequence / flow diagrams + narrative
concepts/ glossary: atomic pages for domain terms / core abstractions
guides/ task-oriented "how / where do I change X" (filled at depth >= standard)wiki/
OVERVIEW.md 核心页面:介绍wiki内容、全局架构图、各板块导航地图。
前置元数据包含`profile`(受众/深度)与`source_commit`(新鲜度锚点)。
log.md 仅追加式的生成/刷新审计日志
architecture/ 系统边界、层级、子系统、横切关注点及相关图表
modules/ 每个包/模块对应一个页面:说明用途、入口点、关键文件、依赖
flows/ 以序列图/流程图加文字说明呈现核心端到端流程
concepts/ 术语表:每个领域术语/核心抽象对应一个独立页面
guides/ 面向任务的「如何/在哪里修改X」指南(仅当深度≥standard时填充)Generating + refreshing
生成与刷新
Don't free-hand it — read references/generate-and-refresh.md and follow the phased, STOP-gated procedure. It auto-detects mode: a stubbed (empty ) → generate (survey → overview → architecture → modules → flows → concepts → link-graph audit); a stamped → refresh (diff , update only affected pages, re-stamp).
OVERVIEW.mdsource_commitsource_commitsource_commit..HEADTwo toolsets. Read source code with NATIVE tools (///) — OK MCP does not index non-markdown source. Author and audit the wiki with OK MCP verbs (/ for pages, / for the graph). Never hand-write wiki markdown with native /.
ReadGrepGlobBashwriteeditlinkssearchWriteEdit请勿随意编写——请阅读**references/generate-and-refresh.md并遵循分阶段、带检查点的流程。系统会自动检测模式:若为草稿(为空)则进入生成模式**(调研→概述→架构→模块→流程→概念→链接图谱审计);若已标记则进入刷新模式(对比的差异,仅更新受影响页面,重新标记)。
OVERVIEW.mdsource_commitOVERVIEW.mdsource_commitsource_commit..HEADsource_commit两套工具集。使用原生工具(///)读取源代码——OK MCP不会索引非Markdown格式的源代码。使用OK MCP指令编写和审计wiki(页面操作使用/,图谱操作使用/)。请勿使用原生/工具手动编写wiki的Markdown内容。
ReadGrepGlobBashwriteeditlinkssearchWriteEditThe two knobs
两个调节项
Two natural-language knobs, read from the user's request (e.g. "build the wiki, public and exhaustive") and recorded in frontmatter () so refreshes stay consistent:
OVERVIEW.mdprofile: <audience>/<depth>- —
audience(default) orinternal.publicmeans polished prose, no secrets / internal infra / ticket numbers, and GitHub-URL source references.public - —
depth|tour(default) |standard. Scales coverage from OVERVIEW + architecture + top flows up through per-package module pages, concepts, and task guides.exhaustive
references/generate-and-refresh.md is the authoritative source for exactly how each knob shapes the output — read it before generating.
两个自然语言调节项,从用户请求中读取(例如“构建wiki,公开且详尽”)并记录在的前置元数据中(格式为),确保刷新操作保持一致性:
OVERVIEW.mdprofile: <audience>/<depth>- — 可选
audience(默认)或internal。public意味着需使用精炼的表述,不得包含机密信息/内部基础设施/工单编号,且源代码引用需使用GitHub URL。public - — 可选
depth|tour(默认) |standard。覆盖范围从概述+架构+核心流程,扩展至每个包的模块页面、术语表及任务指南。exhaustive
references/generate-and-refresh.md是关于各调节项如何影响输出的权威说明——生成前请务必阅读。
Source-reference convention
源代码引用约定
- Intra-wiki navigation → OK doc links — they build the backlink / hub / orphan graph, so link liberally; density is how the wiki stays navigable.
- Code references → relative links + symbol code-spans () or GitHub blob URLs (
internal). Source-file links stay out of the navigation graph (publictracks onlylinks/.mdedges, so they never show as graph dead-links or orphans) — but a wrong-depth path still surfaces in the write/edit.mdxresponse (brokenLinks, orno-such-fileif it overshoots the content root), so count theunresolvablehops from the page's folder. Never invent paths — reference only files you actually read.../
The full rules — the GitHub-URL / relative fallback, the caveat, and the exact code-span shape — live in references/generate-and-refresh.md.
#Lxx- wiki内部导航 → 使用OK文档链接——此类链接会构建反向链接/核心页面/孤立页面图谱,因此请尽量多添加链接;链接密度是保证wiki可导航性的关键。
- 代码引用 → 内部环境使用相对链接+符号代码段,公开环境使用GitHub blob URL。源代码文件链接不会纳入导航图谱(仅追踪
links/.md文件的关联),因此不会被标记为图谱中的死链或孤立链接——但路径深度错误仍会在写入/编辑的.mdx响应中显示(brokenLinks,若超出内容根目录则显示no-such-file),因此请务必计算当前页面目录到目标文件的unresolvable跳转次数。请勿编造路径——仅引用实际读取过的文件。../
完整规则——包括GitHub URL/相对链接的 fallback 机制、的注意事项以及代码段的具体格式——请查看references/generate-and-refresh.md。
#LxxPer-folder rules
各目录规则
architecture/mermaidarchitecture-pagedepth: tourmodules/module-pagetourflows/mermaidflow-pageexhaustiveconcepts/concept-pageguides/guide-pagestandardexhaustivetourarchitecture/mermaidarchitecture-pagedepth: tourmodules/module-pagetourflows/mermaidflow-pageexhaustiveconcepts/concept-pageguides/guide-pagestandardexhaustivetourFreshness discipline (MUST)
新鲜度管理规范(必须遵守)
OVERVIEW.mdsource_commitsource_commit..HEADsource_commitOVERVIEW.mdsource_commitsource_commit..HEADsource_commitsource_commitLog discipline (MUST)
日志记录准则(必须遵守)
wiki/log.md[Server](./modules/server.md)markdown
undefinedwiki/log.md[Server](./modules/server.md)markdown
undefinedYYYY-MM-DD: <generate | refresh>
YYYY-MM-DD: <generate | refresh>
- Profile: <audience>/<depth>
- source_commit: <short-sha> (was <prev-sha> on refresh)
- Coverage: <sections / packages written or updated>
- Pages: Overview, Server, ...
undefined- Profile: <audience>/<depth>
- source_commit: <short-sha> (刷新前为<prev-sha>)
- 覆盖范围: <已编写或更新的板块/包>
- 涉及页面: Overview, Server, ...
undefinedTemplates
模板
Each folder ships a starter template (, , , , ). Create with . Templates carry only structure (headings + frontmatter scaffold); what each section is for is described above and in references/generate-and-refresh.md, not repeated inside document bodies.
architecture-pagemodule-pageflow-pageconcept-pageguide-pagewrite({ document: { path, template: "<name>" } })每个目录都提供了初始模板(、、、、)。使用指令创建页面。模板仅包含结构(标题+前置元数据框架);每个章节的用途已在本文档和references/generate-and-refresh.md中说明,不会在文档正文中重复。
architecture-pagemodule-pageflow-pageconcept-pageguide-pagewrite({ document: { path, template: "<name>" } })