跳转至

编写文档

本页记录创建和更新正式 docs page 时应遵循的公开页面契约,避免把 docs 扩展成第二个 operational truth source。

何时使用

在 docs/ 中新增或修改正式文档页面之前,使用本页。

开始之前

确认页面描述的是当前 source 和 deploy 基线:orchestrator 仍保持 A2A-only,worker 执行 分配到的原子 TaskNode,worker-private LIFT2 MCP transport 是当前下游执行边界。旧 milestone story 属于历史,不属于当前 guide 正文。

步骤

  1. 使用锁定的 front matter keys:doc_status、truth_scope 和 audience。
  2. 把面向读者的内容放在 authority routing 之前。页面应在 H1 下先写自然的引导段落, 然后再进入对应页面类型的叙述章节。
  3. 先解释概念,再给 file map。读者应该先理解这个东西是什么、为什么存在、当前实现如何 流动,再看到源码路径。
  4. 添加页面类型需要的专用章节。
  5. 普通页面把 Current Status 放在面向读者的正文之后。ADR page 使用自己的 decision Status section。
  6. 将 Source Of Truth 和 Related Pages 放在接近结尾的位置,作为 authority appendix。 只有当页面容易被误读为 runbook、live-ops guide、public API contract、deploy authority、 runtime boundary 或 future-feature authority 时,才添加 Out Of Scope。
  7. 链接或指向源码权威,不要把 command block、schema、topology YAML 或 runbook content 复制进正式文档。
  8. 从 source、docs、ADR、deploy、package 和 public reference authority 解释当前 product truth,而不是从 workflow note 解释。
  9. 避免 line-number source citation,因为行号会漂移;改为命名 file、symbol、route、 contract 或 heading。
  10. 避免复制 runbook command;guide 和 reference page 应指向拥有 exact syntax 和 sequencing 的 runbook 或 tool config。
  11. Diagram 只描述当前工程预览实现的行为。Diagram 必须保持 A2A 与 worker-private MCP boundary,并在同页配 source pointer。
  12. 除非页面明确是 historical,否则不要把 mission 级实时传输 term 放进当前 guide 正文。
  13. 在认为变更完成之前运行 strict MkDocs。
  14. 对 bilingual coverage,root page 和 public MkDocs navigation 暴露的每个 Markdown page 都必须配套 suffix .zh.md counterpart。
  15. docs/llms.txt 保持 English-first。它是 canonical LLM-readable public index,并且不暴露在 Chinese primary navigation 中。

双语维护

核心 reader-facing docs 是 bilingual。任何 root docs page,或 public MkDocs navigation 暴露的 docs/design/*、docs/components/*、docs/guides/*、docs/reference/*、 docs/adr/* Markdown page 的变更,都要求在同一次变更中创建或更新匹配的 suffix .zh.md counterpart。

docs/llms.txt 继续保持 English-first。Bilingual page 需要 canonical LLM-readable public index 时可以链接到它,但不应创建第二套 LLM index 作为并行权威。

使用 docs/terminology.zh.md 作为 bilingual terminology contract。中文页面采用 Chinese-first prose:普通英文短语应写成自然中文,但要保留 source-visible token,例如 orchestrator、 worker、TaskNode、task_graph、A2A、Agent Card、worker-private MCP、 LIFT2 MCP、mcp_config_path、mcp_skill_implementations、mcp_servers、 output_mapping、OMEGA、mission、operator、artifact 和 read model,因为替换它们会削弱 source traceability。

Strict MkDocs gate 由 mkdocs.yml、pyproject.toml 和 uv.lock 拥有。本指南只命名该 gate,不复制命令语法。

验证

Docs changes 后,从 repo root 运行 strict MkDocs gate。提交 docs work 前,修复报告的 navigation、page 或 link warning。对于触及 validation 或 runbook routing 的 docs,还要 检查页面是否引入 workflow artifact leakage、line-number source citation、copied runbook command、private MCP details public leak 或未标记的 historical runtime term。对于 bilingual docs changes,在同一次变更中保持 English 和 Chinese page semantics 对齐。

精确命令权威

精确 strict MkDocs command 由 mkdocs.yml、pyproject.toml 和 uv.lock 拥有。本页只命名 该 gate,不复制命令语法。

页面契约

每个正式 docs page 都以简单、便于检索的 front matter 开始。

只使用 doc_status、truth_scope 和 audience 作为 page metadata key。允许值为:

Key Allowed values
doc_status shipped, draft, historical
truth_scope current, historical, deferred
audience human, llm, both

doc_status: shipped 是页面发布状态,表示页面已经发布并足够稳定,可以进入公开 docs site; 它不表示产品 GA 状态、最终 release 状态或 milestone completion。需要说明实现版本阶段时, 在正文中使用 工程预览 等表述。

不要在普通 shipped page 上使用 MkDocs Material 保留的 status metadata key。它是 navigation badge mechanism,不是通用 documentation status field。

共享页面结构

页面区域 必需用途
Lead paragraph 在 H1 下直接说明页面目的、audience 和 concept
Current Status 在面向读者的正文之后说明 shipped、draft 或 historical status
Source Of Truth 在面向读者的 sections 之后指向 owning source authority
Related Pages 提供到相邻 docs 的稳定导航

不要把 What This Page Is 作为常规 heading。使用 H1 下的自然 lead paragraph。普通页面顺序为: 面向读者的 section,随后是 Current Status、Source Of Truth 和 Related Pages。 只有需要防止 runbook、live-ops、public API、deploy、runtime 或 future-feature 误读的页面, 才使用 Out Of Scope。

页面类型 sections

页面类型 额外必需章节
Design Current Design Truth, Data And Control Flow, Authority Boundaries, Verification Surface
Component Concept Model, Implementation Flow, Responsibility, Owns, Does Not Own, Key Source Paths
Guide When To Use This, Before You Start, Steps, Verification, Exact Command Authority
Reference Index, Canonical Files, Stability Notes, Validation
ADR Status, Context, Decision, Consequences, Preserved In

图表渲染

使用 Material for MkDocs native Mermaid support 渲染 diagram。保留 mkdocs.yml 中的 pymdownx.superfences Mermaid fence,并依赖 Material privacy plugin 在 generated site 中 self-host Mermaid runtime。普通 docs page 不添加 page-local JavaScript 或 custom diagram loader。

当前状态

这是当前 architecture documentation set 的 shipped docs-authoring guidance。新增或修改正式 docs 时使用它,让站点保持 strict-buildable、source-anchored,并清楚说明当前 worker-private MCP implementation。

权威来源

mkdocs.yml、pyproject.toml 和 uv.lock 拥有 strict MkDocs build surface。Source file、 deploy asset、contract、ADR、private MCP config file 和 package README file 拥有 docs 所解释 和路由到的 truth。本页拥有 public docs page shape。

相关页面

页面 关系
docs/reference/commands.md command owner map
docs/reference/config-surfaces.md config owner map
docs/repo-map.md repository map
docs/index.md formal docs entrypoint