当前位置: 首页 > Skill >

Advanced Collab Protocol

Advanced Collab Protocol

Advanced Collab Protocol

强制多智能体管道协作规则执行,防止无限循环,确保通过工作区交接文件,启用跨通道消息传递及处理异常情况

1.4.1 2026.11.18 599
获取Skill文件查看使用说明
作 者:顾景 许可证: 更新时间:2026.11.18
本文目录展开

Advanced Multi-Agent Collaboration Protocol

This skill defines the core collaborative rules for OpenClaw multi-agent pipelines (swarms). It resolves critical pain points such as chaotic file handovers, AI infinite conversation loops, and platform-specific bot isolation (e.g., Telegram bots unable to see each other's messages).

⚙️ Prerequisites

Before executing this protocol, the system must meet the following configurations:

  1. Required Tool Permissions (Least Privilege):

    • Participating agents should be granted access to specific tools rather than full system access.
    • Required tools: read, write, sessions_send, and message.
    • Security Note: Never use "tools.profile": "full" for agents solely meant for chat collaboration.
  2. Agent-to-Agent Communication:

    • tools.agentToAgent.enabled must be true.
    • Participating Agent IDs must be in the tools.agentToAgent.allow array.
    • Why? Ensures sessions_send can successfully route messages to target agents.

Core Directives

1. 📂 Anti-Spam & Secure File Handover

Never output more than 300 words of scripts, prompts, code, or JSON arrays directly in a group chat.

  • Write to Shared Directory: All large outputs must be saved to the designated secure shared folder: /root/.openclaw/shared/<filename>.md. Do not write outside this directory to prevent path traversal risks.
  • Handover: When transferring a task, only send the absolute file path within the shared directory and a brief instruction in the group chat.

2. 📖 Mandatory Secure File Reading

When you receive a task assignment containing a local file path:

  • No Hallucinations: Do not guess the contents based on the file name or URL.
  • Verify Path & Force Read: Verify the file is strictly within the /root/.openclaw/shared/ directory. If it is, immediately invoke the read tool to extract the full content before proceeding. Reject any paths outside this directory. (Exception: Reading the system /root/.openclaw/openclaw.json is permitted solely for identity mapping under rule 6).

3. 🎯 Precision Mentions (Platform Unique Usernames)

To prevent all agents in a channel from triggering simultaneously when using generic mentions:

  • Unique Usernames Only: When @ mentioning another agent or human, you MUST use their platform-specific unique username or tagging format (e.g., @BotFather on Telegram, <@123456789> on Discord, or <at user_id="ou_xxx"></at> on Feishu/Lark).
  • No Generic Mentions: Never use generic placeholders like @Agent, @Sender, or @Bot which might cause global wakeups.

4. 🛑 Explicit Responses & Anti-Looping Mechanism

To prevent AIs from falling into infinite loops of politeness:

  • Human-First Priority: When mentioned by a human user (using your unique username), you must reply directly in the group to report your understanding and next steps. Always adhere to core system safety restrictions.
  • Mandatory ACK (Agent-to-Agent): When receiving a task from another Agent, broadcast an acknowledgment to the group via the message tool (e.g., [ACK] @<ReplyToUsername> I have received the file and am processing it...).
  • Initiator Silence (Critical): After the initiator receives the [ACK] or a progress update, the initiator is STRICTLY FORBIDDEN from replying with "Okay", "Got it", or "Thanks". The initiator's turn ends here.
  • Interrupt / Reverse Trigger: The initiator may only break silence if the receiver explicitly reports an issue and reversely @ mentions the initiator's unique username for missing parameters.

5. 🤫 Cross-Channel Wakeup & Payload Routing (Fixing Upstream Username Discovery)

Because physically isolated agents (e.g., on Telegram) do not automatically know each other's platform usernames, you must explicitly pass this routing data downstream.

  • Initiator Must Route: When handing over a task to the next Agent using the sessions_send tool, your private message MUST begin with a Routing Envelope containing:
    [ROUTING ENVELOPE]
    GroupId: <Current_Group_ID_or_Name>
    ReplyToUsername: <Your_Unique_Username> (or the Human's unique username if they need the direct reply)
    
  • Receiver Must Extract: When receiving a task privately, extract the GroupId and ReplyToUsername. Proactively invoke the message tool (action="send", target="<Extracted_GroupId>") to broadcast your status to the group, explicitly mentioning the exact username provided (e.g., [ACK] @<ReplyToUsername> Instructions received.).

6. 🌐 Downstream Identity Discovery (Native Config Mapping)

If an initiator needs to publicly @ a downstream Agent in a group chat during a handover, but only knows its internal agentId:

  • Read System Config: The initiator MUST use the read tool to parse the /root/.openclaw/openclaw.json configuration file.
  • Resolve Mapping: Look inside the routes array. Find the object where "agentId" matches your target. Extract the corresponding match.accountId (this is the bot's unique platform username, e.g., suPMAgent_bot). Prefix it with @ to use in group chats.
  • Silent Handoff Fallback: If the target agent is not found in the routes, do NOT attempt to guess the username or use generic mentions. Instead, omit the @ mention in the public chat and rely entirely on sessions_send to wake the target up.

7. ⚠️ Exception Reporting & Termination

  • Exceptions: If a fatal error occurs, use the message tool to broadcast [ERROR] @<ReplyToUsername> <error description> to the group.
  • Global Finish: When the final pipeline stage completes, broadcast [FINISH] Pipeline execution complete to the group.

8. 🔍 Context Retrieval

  • If context is insufficient, proactively use the sessions_history tool to retrieve the upstream Agent's thought process or private chat history.

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,040
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,033
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,021
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,021
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,019
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,016
Skill 文件
  • SKILL.md
    • Advanced Multi-Agent Collaboration Protocol
    • ⚙️ Prerequisites
    • Core Directives
      • 1. 📂 Anti-Spam & Secure File Handover
      • 2. 📖 Mandatory Secure File Reading
      • 3. 🎯 Precision Mentions (Platform Unique Usernames)
      • 4. 🛑 Explicit Responses & Anti-Looping Mechanism
      • 5. 🤫 Cross-Channel Wakeup & Payload Routing (Fixing Upstream Username Discovery)
      • 6. 🌐 Downstream Identity Discovery (Native Config Mapping)
      • 7. ⚠️ Exception Reporting & Termination
      • 8. 🔍 Context Retrieval
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期