agentleFS
28672032962867203296/hermes-agent/skills/software-development/agent-protocol/SKILL.md

agent-protocol

Skill0 starsChanged 3 months agoMITView on GitHub

Agent间通信协议:结构化消息格式+任务协商+能力发现。借鉴 Google A2A + Anthropic MCP agent间通信

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Agent Protocol — Agent 间通信协议

Google A2A(Agent-to-Agent)定义了 Agent 之间如何发现、协商、协作。当前 agent-mesh 有编排模式但无标准协议。本技能填补这个空白。

一、消息格式

任务请求

{
  "protocol": "a2a/1.0",
  "message_id": "msg_001",
  "sender": "orchestrator@hermes",
  "receiver": "worker-3@hermes",
  "type": "task_request",
  "payload": {
    "task": "审查 src/auth/login.py 的安全问题",
    "context": {
      "files": ["src/auth/login.py", "src/auth/middleware.py"],
      "constraints": ["只读", "不修改代码", "关注SQL注入和XSS"],
      "deadline": "5分钟内"
    },
    "expected_output": {
      "format": "json",
      "schema": {"findings": [{"severity": "high|medium|low", "line": "int", "description": "string"}]}
    }
  }
}

任务响应

{
  "protocol": "a2a/1.0",
  "message_id": "msg_001_resp",
  "sender": "worker-3@hermes",
  "receiver": "orchestrator@hermes",
  "type": "task_response",
  "status": "completed",
  "payload": {
    "findings": [...],
    "confidence": 0.85,
    "time_spent_ms": 4200
  }
}

二、能力发现

Agent 在加入协作时声明自己的能力:

{
  "agent_id": "worker-3@hermes",
  "capabilities": {
    "skills": ["security-review", "code-analysis"],
    "tools": ["terminal", "file", "search_files"],
    "max_depth": 1,
    "preferred_model": "sonnet-5",
    "languages": ["python", "javascript", "go"],
    "limitations": ["no_network", "readonly_filesystem"]
  }
}

编排者根据能力匹配任务给合适的 Agent。

三、协商流程

编排者 → 广播任务 → 各Agent评估自己能力
  ↓
Agent回复: "我能做" / "我能做但需要X" / "做不了"
  ↓
编排者选择最优Agent → 发送正式任务
  ↓
Agent执行 → 返回结果+置信度
  ↓
编排者验证 → 接受/要求修改/重新分配

四、错误处理

错误响应编排者动作
超时{"status":"timeout"}重试1次→降级→换Agent
能力不足{"status":"cannot_do","reason":"..."}换Agent
部分完成{"status":"partial","done":[...],"blocked":[...]}补充上下文继续
冲突{"status":"conflict","mine":X,"theirs":Y}升级到人工

五、与 agent-mesh 联动

agent-mesh(编排模式)+ agent-protocol(通信格式)= 完整的 Agent 协作系统。

agent-mesh 定义"怎么编排",agent-protocol 定义"怎么通信"。

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.