返回顶部
s

subagent-collaboration子代理协作

多子代理协作分析与构建技能。自动分析 OpenClaw 中多个子代理的能力、使用模式和协作关系,智能推荐协作模式(并行/串行/分层/竞争/会诊/接力),生成协作流程设计和安全配置。适用于复杂任务分解、多专家会诊、工作流编排等场景。

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
97
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

subagent-collaboration

多子代理协作分析与构建技能

版本:1.0.0 | 创建日期:2026-03-30 | 作者:TUTU



🎯 技能概述

本技能帮助 OpenClaw 用户分析、设计和构建多子代理协作系统,实现复杂任务的高效分解和执行。

核心能力

  1. 1. 子代理能力分析 - 扫描已配置子代理,识别专长领域
  2. 协作模式推荐 - 根据任务特征推荐最佳协作模式
  3. 协作流程生成 - 自动生成可执行的协作代码
  4. 安全配置检查 - 集成 RSG v2.2.0 子代理监控规则
  5. 资源优化建议 - 模型选择、超时设置、并发控制

📋 使用场景

适用任务

任务类型推荐模式子代理数典型耗时
多领域综合分析并行协作3-5 个3-5 分钟
工作流任务
串行协作 | 2-4 个 | 5-10 分钟 | | 超大型项目 | 分层协作 | 5-10 个 | 10-20 分钟 | | 方案对比择优 | 竞争协作 | 3-5 个 | 5-8 分钟 | | 疑难问题会诊 | 专家会诊 | 4-6 个 | 5-8 分钟 | | 长流程处理 | 接力协作 | 3-5 个 | 8-15 分钟 |

典型用例

✅ 分析美伊战争形势 → 多专家并行分析 + 综合汇总
✅ 开发完整功能 → 需求→架构→实现→测试→审查串行流程
✅ 制定 3 年战略 → 分层协作(总协调员→各组组长)
✅ 选择技术架构 → 多方案竞争 + 评审委员会
✅ 系统故障诊断 → 多专家会诊 + 综合诊断
✅ 撰写行业报告 → 资料收集→整理→分析→润色接力



🚀 快速开始

方式 1:命令行分析

bash

分析当前子代理配置


python3 skills/subagent-collaboration/scripts/analyze_subagents.py

生成协作流程设计

python3 skills/subagent-collaboration/scripts/generate_workflow.py --task 分析 AI 行业趋势

检查安全配置

python3 skills/subagent-collaboration/scripts/security_check.py

方式 2:对话式构建

作为 subagent-collaboration 技能,帮我设计一个多子代理协作流程:

任务:分析某科技公司是否值得投资

要求:

  • - 需要市场、技术、财务、团队多维度分析
  • 最终给出投资建议
  • 考虑风险控制

方式 3:代码生成

javascript
// 使用技能生成的协作代码
const collaboration = await generateCollaboration({
task: 分析 AI 行业趋势,
mode: parallel, // parallel/serial/hierarchical/competition/consultation/relay
agents: [market-analyst, tech-analyst, finance-analyst],
timeout: 300,
safetyCheck: true
});



📊 协作模式详解

1️⃣ 并行协作(Parallel)

适用: 多领域专家同时分析,主代理汇总

javascript
// 生成代码示例
const results = await Promise.all([
sessions_spawn({
task: 分析地缘政治格局,
label: geo-analysis,
model: bailian/qwen3.5-plus,
timeoutSeconds: 300,
sandbox: require,
cleanup: delete
}),
sessions_spawn({
task: 分析军事能力对比,
label: military-analysis,
model: bailian/qwen3-coder-plus,
timeoutSeconds: 300,
sandbox: require,
cleanup: delete
}),
sessions_spawn({
task: 分析经济影响,
label: economic-analysis,
model: bailian/glm-4.7,
timeoutSeconds: 300,
sandbox: require,
cleanup: delete
})
]);

// 主代理汇总
const finalReport = synthesize(results);

安全配置检查:

  • - ✅ 每个子代理都有 label
  • ✅ 超时时间合理(≤300 秒)
  • ✅ 使用 sandbox=require
  • ✅ cleanup=delete 自动清理
  • ⚠️ 并发数 3 个(接近上限,需注意)



2️⃣ 串行协作(Chain)

适用: 任务有依赖关系,按顺序执行

javascript
// 第 1 步:需求分析
const requirements = await sessions_spawn({
task: 分析用户需求,列出功能清单,
label: requirements,
timeoutSeconds: 120,
sandbox: require,
cleanup: delete
});

// 第 2 步:架构设计(依赖第 1 步)
const architecture = await sessions_spawn({
task: 基于以下需求设计架构:${requirements},
label: architecture,
timeoutSeconds: 180,
sandbox: require,
cleanup: delete
});

// 第 3 步:代码实现(依赖第 2 步)
const code = await sessions_spawn({
task: 根据以下架构编写代码:${architecture},
label: implementation,
timeoutSeconds: 300,
sandbox: require,
cleanup: delete
});

// 第 4 步:代码审查
const review = await sessions_spawn({
task: 审查以下代码:${code},
label: code-review,
timeoutSeconds: 180,
sandbox: require,
cleanup: delete
});

安全配置检查:

  • - ✅ 每步都有清晰 label
  • ✅ 超时时间根据复杂度设置
  • ✅ 总耗时约 13 分钟(可接受)
  • ⚠️ 前一步失败会影响后续(需错误处理)



3️⃣ 分层协作(Hierarchical)

适用: 超大型任务,多层分解

javascript
// 第 1 层:总协调员
const coordinator = await sessions_spawn({
task: 制定项目总体计划,分解为 5 个子任务,
label: coordinator,
timeoutSeconds: 180,
sandbox: require,
cleanup: keep // 保留协调结果
});

// 第 2 层:子任务负责人(并行)
const subTasks = coordinator.subTasks.map((task, i) =>
sessions_spawn({
task: task.description,
label: sub-task-${i},
timeoutSeconds: 300,
sandbox: require,
cleanup: delete
})
);

// 汇总结果
const results = await Promise.all(subTasks);

安全配置检查:

  • - ✅ 协调员使用 cleanup=keep
  • ✅ 子任务使用 cleanup=delete
  • ⚠️ 并发数需注意(建议分批)
  • ⚠️ 总子代理数可能超过 5 个(需监控)



4️⃣ 竞争协作(Competition)

适用: 多方案对比择优

javascript
// 生成多个独立方案
const [planA, planB, planC] = await Promise.all([
sessions_spawn({
task: 设计方案 A:激进策略,
label: plan-a-aggressive,
model: bailian/qwen3-max,
timeoutSeconds: 300,
sandbox: require,
cleanup: delete
}),
sessions_spawn({
task: 设计方案 B:保守策略,
label: plan-b-conservative,
model: bailian/qwen3-max,
timeoutSeconds: 300,
sandbox: require,
cleanup: delete
}),
sessions_spawn({
task: 设计方案 C:平衡策略,
label: plan-c-balanced,
model: bailian/qwen3-max,
timeoutSeconds: 300,
sandbox: require,
cleanup: delete
})
]);

// 评审委员会
const bestPlan = await sessions_spawn({
task: 评审以下 3 个方案,选择最佳并说明理由:
方案 A:${planA}
方案 B:${planB}
方案 C:${planC},
label: review-board,
model: bailian/qwen3-max,
timeoutSeconds: 300,
sandbox: require,
cleanup: delete
});

安全配置检查:

  • - ✅ 每个方案有清晰标识
  • ✅ 使用相同模型确保公平
  • ⚠️ 资源消耗大(4 个子代理)

-

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 subagent-collaboration-1775930539 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 subagent-collaboration-1775930539 技能

通过命令行安装

skillhub install subagent-collaboration-1775930539

下载

⬇ 下载 subagent-collaboration v1.0.0(免费)

文件大小: 19.03 KB | 发布时间: 2026-4-12 11:33

v1.0.0 最新 2026-4-12 11:33
subagent-collaboration 1.0.0

- Initial release of the multi-subagent collaboration skill for OpenClaw.
- Automatically analyzes subagent capabilities, usage patterns, and collaboration relationships.
- Intelligently recommends optimal collaboration modes (parallel, serial, hierarchical, competition, consultation, relay).
- Generates executable collaboration workflow designs and integrates safety configuration checks (based on RSG v2.2.0 rules).
- Provides resource optimization recommendations, including model selection, timeout settings, and concurrency control.
- Suitable for advanced task decomposition, expert consultation, workflow orchestration, and similar scenarios.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部