agent-2-agent
CLAUDE.md9 starsChanged 8 months agoMITView on GitHub
本文件供 AI agent 首次进入项目时快速理解全局,人类开发者请看 README.md。 a2a 是一个 Claude Code skill(不是独立应用),实现跨模型对抗式 code review。核心逻辑全在 SKILL.md,脚本只做辅助。
- Reads credentials
In this repositoryOne other file it gives its agents.
- a2aSkill
The file
Files
a2a — AI Agent 快速上下文
本文件供 AI agent 首次进入项目时快速理解全局,人类开发者请看 README.md。
这是什么
a2a 是一个 Claude Code skill(不是独立应用),实现跨模型对抗式 code review。核心逻辑全在 SKILL.md,脚本只做辅助。
文件职责
| 文件 | 作用 | 什么时候改 |
SKILL.md | skill 定义 + 完整执行流程,Claude Code 加载的入口 | 改流程、改 prompt、改 review 逻辑 |
scripts/preflight.sh | 环境预检 + token bridge 缓存,结果缓存 15min | 改检测逻辑、加新 CLI 支持 |
scripts/a2a-health.sh | 一键自检 + 自动修复 token bridge,人工排查用 | 改检测项、改修复逻辑 |
scripts/spinner.sh | 终端动画,纯 UI | 基本不用动 |
references/review-lenses.md | 三大审查视角定义(Challenger/Architect/Subtractor) | 调整审查标准 |
DEV.md | 开发同步流程 + 版本号规则 | 流程变了才改 |
关键设计决策
- 双向跨模型 dispatch:Claude→Codex 走
codex exec;Codex→Claude 走claude -p+ token bridge(或从 Claude Code 内走 Agent tool sub-agent)。 - Token Bridge:OAuth token 存在 macOS Keychain,Codex sandbox 无法直接访问。preflight 自动提取 token 缓存到
~/.cache/a2a/.claude-token(权限 600),Codex 通过ANTHROPIC_API_KEY环境变量传递。Step 1 每次自动检查补全,用户零操作。 - 从 Claude Code 内不直接调
claude -p:CLAUDECODE=1环境变量触发 nested session 保护。Claude 侧 review 走 Agent tool。 - Reviewer 互不可见:每个 reviewer 独立执行,看不到其他 reviewer 的输出,防止从众效应。
- Lean packet:reviewer 只收到自己视角需要的 diff 切片 + 精简 intent,不传完整 plan 或项目规范。
- Red-line 统一扫描:项目约束不传给 reviewer,由 Claude 在 Step 5 汇总时统一扫描一次。
修改注意事项
- 改完必须同步更新
CHANGELOG.md+SKILL.md里的 version - 同步到开源 repo 流程见
DEV.md - Cache 路径:
~/.cache/a2a/(preflight.json + .claude-token),调试时用preflight.sh --refresh或直接跑a2a-health.sh
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

