Contributing
Context and Agent Graph are developed in the open on GitHub, in context4ai/context and context4ai/agent-graph. Both welcome bug reports, documentation, tests and implementation changes. Common ways in:
- Report a defect with a minimal, sanitized reproduction through the issue templates.
- Improve the documentation. This site is built from context4ai/portal; package references live in each project's repository.
- Share an Indexer that teaches Context to read a new kind of source; see Creating an Indexer and Community Indexers.
- Add a language extractor under Context's
packages/extract-*, following the@c4a/extractprotocol. - Propose an Agent Graph protocol change or example. Newcomers start with Why Graph Engineering, Authoring Graphs and the repository's
getting-startedexample.
The two projects follow the same rhythm:
- Search existing Issues and Discussions first.
- Discuss anything that changes a public contract before writing it. Small documentation fixes and isolated bug fixes can go straight to a pull request.
- Develop with Bun, keep runtime code working on Node.js 20 or later, and run the project's verification command.
- Open a focused pull request that explains the problem, the behavior you chose, the compatibility impact and how you verified it.
Never report a security vulnerability in a public Issue; see Support for private reporting.
| Context | Agent Graph | |
|---|---|---|
| Discuss first | Workspace protocols, lifecycle ordering, public CLI JSON, package layout | Protocol changes, new public fields, compatibility behavior |
| Verification | bun run verify:full | bun run verify |
| Developer guide | DEVELOPMENT.md | DEVELOPMENT.md |
Context
git clone https://github.com/context4ai/context.git
cd context
bun install
bun run build
bun run verifybun run verify runs type checking, lint and the default tests; verify:full adds the full-only CLI tests and checks of the built Node artifacts, so build first. DEVELOPMENT.md in the repository covers the repository layout, running a local CLI and plugin, verification scopes and releases.
A pull request is ready for review when:
bun run verify:fullpasses;- lifecycle behavior comes with Route and recovery coverage;
- the CLI does not make semantic decisions that belong to the Agent or the user;
- tests use neutral fixtures rather than business-specific content;
- English and Simplified Chinese user documentation still describe the same behavior;
- user-visible changes have an entry under the next version in
CHANGELOG.md; - no generated
dist/, workspace data, snapshots, credentials or private source material is committed.
Write commit messages as English conventional commits that name the target version, for example fix(v0.7.62): exempt More menu targets from knowledge map coverage. Maintainers release by creating a GitHub Release whose tag matches the package version; the publish workflow verifies and publishes every package through npm Trusted Publishing.
Agent Graph
git clone https://github.com/context4ai/agent-graph.git
cd agent-graph
bun install
bun run verifybun run verify runs type checking, lint, the tests and the build. Use GitHub Discussions for design or adoption questions and ideas that are not yet actionable. DEVELOPMENT.md describes the source layout, protocol rules, testing principles and the release audit.
A pull request is ready for review when:
bun run verifypasses;- public TypeScript types and JSON Schemas agree;
- protocol behavior has unit or integration coverage, and at least one published example covers new protocol behavior;
- English and Simplified Chinese documentation still describe the same behavior;
- runtime code uses standard Node.js APIs rather than Bun-only APIs;
- no generated
dist/,.tmp/, coverage or package archive files are committed.
Write commit messages as English conventional commits, with the project version when practical:
feat(v0.3.0): add route inspection metadata
fix(v0.2.2): reject stale evaluation revisions
docs(v0.3.0): clarify provider adoption pathsMaintainers may ask for changes that preserve protocol portability, deterministic behavior or documentation parity. To test a Graph change end to end, see Testing and Publishing.
Fixing this documentation
Every article on this site ends with its sources, linked to the exact repository revision it was written from. If an article is wrong because the documentation or code it cites is wrong, fix it in that repository. Both projects keep English and Simplified Chinese documentation equivalent, so update both languages in the same pull request.
Participation in both projects is governed by their Code of Conduct.
参与贡献
Context 和 Agent Graph 都在 GitHub 上公开开发,仓库分别是 context4ai/context 和 context4ai/agent-graph。两个项目都欢迎问题报告、文档、测试和实现改动。常见的参与方式:
- 报告缺陷:通过 issue 模板提交一个最小、已脱敏的复现。
- 改进文档:本站由 context4ai/portal 构建;各包的参考文档放在各自项目的仓库中。
- 分享 Indexer:教 Context 读取一种新的来源;参见创建 Indexer和社区 Indexer 一览。
- 添加语言提取器:放在 Context 的
packages/extract-*下,遵循@c4a/extract协议。 - 提出 Agent Graph 协议变更或示例:新人可先读为什么是 Graph Engineering和编写 Graph,再运行仓库中的
getting-started示例。
两个项目的节奏相同:
- 先搜索已有的 Issues 和 Discussions。
- 凡是会改变公开契约的改动,先讨论再动手。小的文档修正和孤立的缺陷修复可以直接提交 pull request。
- 用 Bun 开发,保证运行时代码在 Node.js 20 及以上版本可用,并运行项目的验证命令。
- 提交聚焦的 pull request,说明问题、你选择的行为、兼容性影响以及如何验证。
不要在公开 Issue 中报告安全漏洞;私下报告的方式见支持。
| Context | Agent Graph | |
|---|---|---|
| 需要先讨论 | 知识工作区协议、生命周期顺序、公开的 CLI JSON、知识包布局 | 协议变更、新增公开字段、兼容性行为 |
| 验证 | bun run verify:full | bun run verify |
| 开发指南 | DEVELOPMENT.md | DEVELOPMENT.md |
Context
git clone https://github.com/context4ai/context.git
cd context
bun install
bun run build
bun run verifybun run verify 运行类型检查、lint 和默认测试;verify:full 还会运行仅在完整模式下执行的 CLI 测试和构建出的 Node 产物检查,因此要先构建。仓库中的 DEVELOPMENT.md 介绍仓库结构、运行本地 CLI 与插件、验证范围和发布。
满足以下条件的 pull request 即可进入审查:
bun run verify:full通过;- 生命周期行为附带 Route 和恢复的测试覆盖;
- CLI 不替 Agent 或用户做语义判断;
- 测试使用中性的夹具,而不是具体业务内容;
- 英文和简体中文的用户文档描述的仍是同样的行为;
- 用户可见的改动在
CHANGELOG.md的下一个版本下有对应条目; - 不提交生成的
dist/、知识工作区数据、快照、凭证或私有来源材料。
提交信息使用英文 conventional commit 并写明目标版本,例如 fix(v0.7.62): exempt More menu targets from knowledge map coverage。维护者通过创建 tag 与包版本一致的 GitHub Release 来发版;发布工作流会验证所有包,并通过 npm Trusted Publishing 发布。
Agent Graph
git clone https://github.com/context4ai/agent-graph.git
cd agent-graph
bun install
bun run verifybun run verify 运行类型检查、lint、测试和构建。设计或接入方面的问题、尚不能落地的想法,请发到 GitHub Discussions。DEVELOPMENT.md 介绍源码结构、协议规则、测试原则和发布审计。
满足以下条件的 pull request 即可进入审查:
bun run verify通过;- 公开的 TypeScript 类型与 JSON Schema 一致;
- 协议行为有单元或集成测试覆盖,并且至少有一个已发布的示例覆盖新的协议行为;
- 英文和简体中文文档描述的仍是同样的行为;
- 运行时代码使用标准 Node.js API,而不是 Bun 专有 API;
- 不提交生成的
dist/、.tmp/、覆盖率报告或包归档文件。
提交信息使用英文的 conventional commit,可行时带上项目版本:
feat(v0.3.0): add route inspection metadata
fix(v0.2.2): reject stale evaluation revisions
docs(v0.3.0): clarify provider adoption paths维护者可能会要求修改,以保持协议的可移植性、行为的确定性或文档的一致。要端到端测试一个 Graph 改动,参见测试与发布。
修正本站文档
本站每篇文章末尾都列出了来源,并链接到撰写时依据的确切仓库修订。如果文章出错是因为它引用的文档或代码有误,请到对应仓库中修正。两个项目都要求英文和简体中文文档保持一致,所以请在同一个 pull request 中同时更新两种语言。
参与这两个项目都需遵守各自的行为准则(Code of Conduct)。