acp-adapter AGENTS.md

acp-adapter AGENTS.md is an instructions file for Codex, OpenCode from beyond5959/acp-adapter. It costs 1,346 tokens per session, scanned A, original, MIT.

A set of instructions for developing ACP Adapter, a Go program that connects the Codex and Claude coding agents to clients through the Agent Client Protocol. It specifies protocol rules, supported communication channels, version handling, and testing requirements.

In plain words
What is it for?
Use it when modifying the adapter, its Codex or Claude integrations, generated schemas, protocol messages, or related tests and acceptance checks.
Why use it?
It helps keep communication machine-readable and prevents changes from breaking the protocol or drifting away from the supported Codex and Claude interfaces.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/beyond5959/acp-adapter/agents-md
Clone the repo
git clone --depth 1 https://github.com/beyond5959/acp-adapter

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for acp-adapter AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/beyond5959/acp-adapter/agents-md.svg)](https://agentmods.dev/instructions/beyond5959/acp-adapter/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/beyond5959/acp-adapter/agents-md"><img src="https://agentmods.dev/badge/instructions/beyond5959/acp-adapter/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,346 This file is loaded in full into every session.
When invoked 1,346 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01346 $0.01346
Opus 5 $0.00673 $0.00673
Sonnet 5 $0.00269 $0.00269
Haiku 4.5 $0.00135 $0.00135

Measured 3d ago against content hash 6466ac11853c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

acp-adapter AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 71 lines

How it starts

The opening of the file, as written. The whole thing — 71 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

本仓库用于实现 Go 版 ACP 适配器。当前支持两类下游后端:

  • Codex:基于 Codex App Server
  • Claude:基于 Claude Code CLI 子进程

请在任何改动前先阅读 docs/SPEC.mddocs/ACCEPTANCE.md

官方文档入口:

0. 最高优先级约束(MUST)

  1. ACP stdio 严格合规
    • 适配器通过 stdio newline-delimited JSON-RPC 与 ACP Client 通信。
    • stdout 只能输出 ACP 协议 JSON-RPC 消息;任何日志、调试输出必须写入 stderr
    • 每条消息以 \n 分隔,消息体不得包含未转义的换行。
  2. 下游必须按后端走受支持的官方通道(不得解析交互式文本输出)
    • Codex 后端:必须以子进程方式启动 codex app-server,通过 stdio JSONL/JSON-RPC 与之通信;不得直接解析 Codex CLI 文本输出。
    • Claude 后端:必须通过 Claude Code CLI 子进程的 machine-readable 输出链路(当前实现为 claude -p ... --output-format stream-json)集成;不得抓取/解析交互式 TUI 文本。
  3. 版本锁定与协议形态驱动
    • Codex 后端:必须提供脚本/Makefile 目标:用 codex app-server generate-json-schema --out internal/codex/schema 生成并提交 schema 产物。
    • Codex 后端:Go 类型优先通过 schema 生成(或至少进行 runtime 校验),避免手写漂移。
    • Claude 后端:涉及 CLI stream-json 事件形态的改动,必须补充或更新测试,防止协议漂移。
  4. 可验证、可回归
    • 每个 PR 必须保持 go test ./... 通过。
    • 新增能力必须新增或更新测试/集成用例,或在 docs/ACCEPTANCE.md 中记录验证步骤(必须可执行)。

1. 工程规范

  • Go 版本:Go 1.24+(如需调整,请同步更新 CI)。
  • 目录结构需保持清晰分层:internal/acpinternal/codexinternal/claudeinternal/bridgeinternal/configinternal/observabilitypkg/codexacppkg/claudeacp
  • 代码风格:优先显式错误处理;避免“吞错”;对外错误应带上下文(sessionId/threadId/turnId)。
  • 并发:每个 session 同时只允许 1 个 active turn;session/cancel 必须快速生效且不泄漏 goroutine。

2. 运行与调试

  • 默认日志格式:结构化 JSON 到 stderr(可配置 log level)。
  • 提供 --trace-json 开关:可选把 ACP 与下游后端(Codex App Server / Claude CLI)的原始 JSON 流(脱敏)落盘用于调试。

3. 当前阶段与实现脉络

  • Codex 主线:PR1-PR5 已完成,核心能力基于 Codex App Server。
  • Claude 主线:C-R0-C-R5 已完成,核心能力基于 Claude Code CLI 子进程。
  • Library Mode:R5 进行中,R6 待完成。
  • 任何新增能力或修复,都必须先确认其影响范围是 codexclaude,还是双后端共享链路,并同步检查 docs/ACCEPTANCE.md 对应条目。

4. 禁止事项(MUST NOT)

  • 不得把日志/调试文本写到 stdout。
  • 不得引入 LSP 的 Content-Length framing(本项目不是 LSP)。
  • 不得在未通过 permission 的情况下执行写盘/命令/网络/有副作用的工具调用(默认策略)。

Read the full file on GitHub · 71 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 71 lines · 1,346 tokens per session scan A 6466ac11853c

Subscribe to this mod's changes

acp-adapter AGENTS.md is an instructions file published in the GitHub repository beyond5959/acp-adapter (18 stars, last pushed 4mo ago), licensed MIT. It adds 1,346 tokens to every session, about $0.0067 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories