Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ Debugging no longer means probing an opaque database — it becomes a determinis

| Document | Contents |
| :--- | :--- |
| [`docs/adapters/contribution-guide.md`](./docs/adapters/contribution-guide.md) | Adapter PR boundaries, review checklist, and cross-platform contribution lanes |
| [`scripts/README.memory-tencentdb-ctl.md`](./scripts/README.memory-tencentdb-ctl.md) | Operations & management tooling |
| [`CHANGELOG.md`](./CHANGELOG.md) | Release notes and version history |
| [`openclaw.plugin.json`](./openclaw.plugin.json) | OpenClaw plugin manifest and configuration schema |
Expand Down
1 change: 1 addition & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ export MEMORY_TENCENTDB_GATEWAY_API_KEY="<与 Gateway 同一份密钥>"

| 文档 | 内容 |
| :--- | :--- |
| [`docs/adapters/contribution-guide.md`](./docs/adapters/contribution-guide.md) | Adapter PR 边界、Review 清单与跨平台贡献分工 |
| [`scripts/README.memory-tencentdb-ctl.md`](./scripts/README.memory-tencentdb-ctl.md) | 运维管理工具说明 |
| [`CHANGELOG.md`](./CHANGELOG.md) | 版本变更记录 |
| [`openclaw.plugin.json`](./openclaw.plugin.json) | OpenClaw 插件声明与配置 Schema |
Expand Down
40 changes: 40 additions & 0 deletions docs/adapters/contribution-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Adapter Contribution Guide

This guide helps contributors keep cross-platform adapter pull requests focused and easy to review. It is especially
useful for issue #235, where several adapter efforts may run in parallel.

## Adapter Lanes

| Lane | Owns | Should avoid |
| :--- | :--- | :--- |
| Shared Gateway client | Typed HTTP client for `/recall`, `/capture`, `/search/*`, `/session/end`, retry/error handling, lifecycle helpers | Platform-specific hooks, CLI processes, MCP protocol details |
| Coding-agent adapter | Codex-style or Claude Code-style lifecycle mapping, session key strategy, prompt injection/capture examples | Reimplementing the shared Gateway HTTP client |
| MCP bridge | MCP server/stdio transport, tool schemas, protocol-level validation, process lifecycle | Duplicating coding-agent lifecycle docs unless needed for MCP examples |
| Dify/workflow adapter | Dify extension points, conversation identity mapping, workflow-specific setup | Generic Gateway SDK code that belongs in the shared client lane |
| Documentation-only PR | Architecture diagrams, comparison tables, verification playbooks, migration notes | Shipping unverified adapter code snippets as if they were production APIs |

## Review Checklist

Before opening or updating an adapter PR:

1. Identify the lane in the PR description.
2. Link the issue or PR that owns any dependency lane.
3. Keep duplicated Gateway request/response types out of platform-specific adapters when a shared client already exists.
4. Include the hook mapping: before-turn recall, after-turn capture, explicit search, and session end/flush.
5. Show how the adapter builds stable `session_key` values from platform identity.
6. Document auth behavior for `TDAI_GATEWAY_API_KEY` when the Gateway is exposed beyond localhost.
7. Add focused tests for request shape, auth headers, error handling, and session identity.
8. Run the project checks that match the changed files, and list them in the PR body.

## Suggested PR Body Note

```md
Adapter lane: <shared Gateway client | coding-agent adapter | MCP bridge | Dify adapter | docs>
Depends on / complements: <PR or issue link>

This PR intentionally does not implement <other lane>, because that scope is covered by <PR or issue link>.
```

Using these lanes keeps adapter work additive: a platform-specific adapter can depend on the shared Gateway client, an
MCP bridge can expose the same capabilities through protocol tooling, and documentation can clarify integration without
creating another competing implementation.