Skip to content

Best Practices ​

These habits come from teams using Context to build knowledge for large engineering organizations. Most of them are about one thing: correct course early, while it is cheap. Each line links to the guide that explains it.

Checklist ​

  • Talk first, then start. Describe what the knowledge should cover, where it comes from — document links, repository addresses, the modules you care about — and what form you expect. Let the Agent ask back until it writes a work-start report for you to confirm. See Confirming the Work-Start Report.
  • Screen many mixed-quality sources before registering them. When the first knowledge base starts from a large wiki, years of designs or several repositories, let the Agent explore the code, check the documents against it and settle the site structure first. See Cold-Starting a Knowledge Base.
  • Check the outputs when a round ends. Look at the package and the site; the Agent commits the workspace to Git when the round ends. See Starting a New Task and Saving Your Work.
  • Preview early, correct with examples. On a large task, open the changed pages as soon as they are available. If something is off, show the wording you want, a counterexample or the style. See Revising a Page.
  • Ask three questions of every review report. Does the structure match what you expected? Does the content? Is anything missing from the scope, or included that should be left out? See Reading Review Reports.
  • Reorganize once the knowledge grows. First-version titles and directories are rarely ideal. Ask the Agent to propose a clearer directory and article structure from the approved knowledge; revising costs far less than producing again. See Reorganizing at Scale.

When documents lag behind code ​

Production cross-checks sources, and documents lagging behind code is normal. By default the Agent revises the knowledge to match the code. To fix the upstream documents as well, add a rule at the start of the task or in the workspace AGENTS.md:

text
When a revision is caused by a document lagging behind code, record it in
update-remote/<date>-<topic>.md with the context, the judgment and a suggested fix.
After the task, work through update-remote: find each upstream document and
revise it, or give a concise suggested fix for the user to decide.

Upstream documents then stay current and the knowledge does not drift away from them. See Writing Back Upstream.

最佳实践 ​

这些习惯来自使用 Context 为大型研发组织建设知识的团队。它们大多围绕一件事:尽早纠偏,趁代价还小的时候。每一条都链接到详细说明的指南。

清单 ​

  • 先对话,再开工。 说明知识应覆盖什么、来自哪里(文档链接、仓库地址、你关心的模块),以及你期望的形式。让 Agent 反问,直到它写出一份开工报告供你确认。参见 确认开工报告。
  • 登记前先筛选大量质量参差的来源。 当第一个知识库来自一个大型 Wiki、多年的方案或几个代码仓库时,先让 Agent 探索代码、对照代码核查文档,并定好站点结构。参见 知识库冷启动。
  • 一轮结束时检查产物。 查看知识包和站点;Agent 会在一轮结束时把知识工作区提交到 Git。参见 开始新任务与保存工作。
  • 尽早预览,用示例纠偏。 在大型任务中,有变更的页面一出来就打开看。如果有不对的地方,给出你想要的措辞、一个反例或你要的风格。参见 修订页面。
  • 每份审核报告都问三个问题。 结构是否符合预期?内容是否符合预期?是否有内容遗漏在范围之外,或纳入了本该排除的内容?参见 阅读审核报告。
  • 知识变多后重新组织。 第一版的标题和目录很少一开始就理想。让 Agent 基于已批准的知识提出更清晰的目录和文章结构;修订的成本远低于重新生产。参见 大规模重组。

文档落后于代码时 ​

生产过程会交叉核对来源,文档落后于代码是常态。默认情况下,Agent 会按代码修订知识。如果你还想修正上游文档,可以在任务开始时或在知识工作区的 AGENTS.md 中加一条规则:

text
如果这次修订是因为文档落后于代码,请在 update-remote/<date>-<topic>.md 记录背景、判断和修改建议。
任务完成后,请逐项处理 update-remote:找到对应的上游文档并修订,
或给用户一份简短的修改建议,由用户来决定。

这样上游文档能保持最新,知识也不会与它们逐渐脱节。参见 回写上游。