dabruhce-multi-agent-orchestration
Colony 多智能体任务委派与流程编排,含审计日志与学习系统。
安装 / 下载方式
TotalClaw CLI推荐
totalclaw skills install shop:totalclaw:totalclaw~dabruhce-multi-agent-orchestrationcURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~dabruhce-multi-agent-orchestration/file -o dabruhce-multi-agent-orchestration.md## 概述(中文)
Colony 多智能体任务委派与流程编排,含审计日志与学习系统。
## 技能正文
# Colony 编排技能
多智能体任务委派与流程编排,含审计日志与智能体学习能力。
## 快速开始
```bash
# Single task - auto-routed
node scripts/colony.mjs dispatch "find top 5 time-series databases"
# Multi-stage process
node scripts/colony.mjs process validate-idea --context "AI meal planning for parents"
node scripts/colony.mjs process-status # check progress
node scripts/colony.mjs approve abc123 # continue past checkpoint
# Check audit stats
node scripts/colony.mjs audit
# View agent memory
node scripts/colony.mjs memory scout
```
## 智能体
| 智能体 | 角色 | 专长 |
|-------|------|----------------|
| **scuttle** | 研究员 | 快速搜索、查询、事实查找 |
| **scout** | 研究员 | 深度市场/竞品研究、情报 |
| **forecast** | 分析师 | 数据分析、趋势、预测 |
| **pincer** | 编码员 | 编写、调试、重构代码 |
| **shell** | 运维 | Git、部署、系统任务 |
| **forge** | 产品 | PRD、规格、路线图 |
| **ledger** | 财务 | 定价、成本、商业案例 |
| **muse** | 创意 | 头脑风暴、命名、创意 |
| **scribe** | 写手 | 博客、文档、长文 |
| **quill** | 文案 | 落地页、销售文案、广告 |
| **echo** | 社媒 | 推文、社媒帖子、推广 |
| **sentry** | QA | 测试、缺陷验证 |
## 任务命令
### 分派(自动路由)
```bash
node scripts/colony.mjs dispatch "research best practices for API rate limiting"
```
根据任务关键词自动检测最佳智能体。
### 分配给指定智能体
```bash
node scripts/colony.mjs assign scout "find top 5 time-series databases"
node scripts/colony.mjs assign pincer "refactor the auth module to use JWT"
node scripts/colony.mjs assign shell "deploy the staging branch"
```
### 检查状态
```bash
node scripts/colony.mjs status
```
显示所有智能体及其当前任务。
### 获取结果
```bash
node scripts/colony.mjs results # Latest completed task
node scripts/colony.mjs results abc123 # Specific task by ID
```
### 查看历史
```bash
node scripts/colony.mjs history # Last 10 completed/failed
node scripts/colony.mjs history --limit 20 # Custom limit
```
## 流程命令
流程是将智能体串联的多阶段工作流。
### 列出可用流程
```bash
node scripts/colony.mjs processes
```
### 启动流程
```bash
node scripts/colony.mjs process <process-name> --context "description"
```
示例:
```bash
node scripts/colony.mjs process validate-idea --context "AI-powered meal planning for busy parents"
node scripts/colony.mjs process content-pipeline --context "How to use vector databases for RAG"
node scripts/colony.mjs process product-launch --context "Life Lunch ritual kit for parents"
node scripts/colony.mjs process bug-triage --context "Login fails with OAuth on mobile"
```
### 检查流程状态
```bash
node scripts/colony.mjs process-status # Show latest run
node scripts/colony.mjs process-status abc123 # Specific run
```
显示:当前阶段、已完成阶段、检查点、输出文件。
### 查看流程运行
```bash
node scripts/colony.mjs runs # All runs (active, paused, completed)
node scripts/colony.mjs runs --limit 5 # Last 5
```
### 批准检查点
流程到达检查点时暂停等待人工批准:
```bash
node scripts/colony.mjs approve abc123
```
也用于重试失败阶段。
### 取消流程
```bash
node scripts/colony.mjs cancel abc123
```
## 审计命令
跟踪智能体性能、任务统计与系统健康。
### 仪表盘
```bash
node scripts/colony.mjs audit
```
显示全局统计、每智能体摘要与近期事件。
### 智能体详情
```bash
node scripts/colony.mjs audit agent scout
node scripts/colony.mjs audit agent pincer
```
显示特定智能体的详细统计,包括:
- 总任务数、成功率
- 平均耗时
- Token 使用
- 近期失败
### 事件日志
```bash
node scripts/colony.mjs audit log # Last 20 events
node scripts/colony.mjs audit log --limit 50 # More events
```
### 最慢任务
```bash
node scripts/colony.mjs audit slow # Top 10 slowest
node scripts/colony.mjs audit slow --limit 20
```
### 近期失败
```bash
node scripts/colony.mjs audit failures # Last 10 failures
node scripts/colony.mjs audit failures --limit 20
```
## 学习命令
智能体从经验中学习并共享知识。
### 反馈
为已完成任务记录反馈:
```bash
node scripts/colony.mjs feedback abc123 "Great research, but needed more pricing data"
```
### 智能体记忆
每个智能体有持久记忆文件记录所学:
```bash
# View an agent's memory
node scripts/colony.mjs memory scout
# Add a lesson
node scripts/colony.mjs memory scout add "Always check publication dates on research sources"
# Add to specific sections
node scripts/colony.mjs memory scout add "Use bullet points for clarity" --pattern
node scripts/colony.mjs memory scout add "Missed competitor X in analysis" --mistake
node scripts/colony.mjs memory scout add "Prefers markdown tables over lists" --pref
```
### 共享学习
跨智能体洞察与教训:
```bash
# View all shared learnings
node scripts/colony.mjs learn
# Add a learning
node scripts/colony.mjs learn add "validate-idea works better with 3 competitors max" --category process
node scripts/colony.mjs learn add "Always verify API rate limits early" --category technical --source run-abc123
```
### 全局上下文
所有智能体可访问的共享上下文:
```bash
# View global context
node scripts/colony.mjs context
# Set preferences
node scripts/colony.mjs context set preferences.codeStyle "TypeScript, functional"
node scripts/colony.mjs context set preferences.timezone "America/Chicago"
# Add active facts (temporary context)
node scripts/colony.mjs context add-fact "We're targeting enterprise customers"
node scripts/colony.mjs context add-fact "Launch deadline is Q2 2024"
# Add decisions
node scripts/colony.mjs context add-decision "Use Postgres over MySQL" --project "life-lunch"
# Add projects
node scripts/colony.mjs context add-project "life-lunch"
```
### 回顾
回顾近期活动并生成洞察:
```bash
node scripts/colony.mjs retro # Last 7 days
node scripts/colony.mjs retro --days 14 # Last 14 days
```
显示:
- 任务完成摘要
- 每智能体统计
- 失败模式
- 建议的学习
## 可用流程
### validate-idea
**端到端验证商业想法**
- 阶段:头脑风暴 → 研究 → 分析 → 规格 → 估算
- 检查点:analyze 之后
- 输出:business-case.md
### product-launch
**端到端产品发布**
- 阶段:研究 → 规格 → 构建 → 文案
- 检查点:spec 之后、copy 之后
- 输出:market-brief.md, prd.md, code/, landing-copy.md
### content-pipeline
**研究、撰写、发布、推广内容**
- 阶段:研究 → 草稿 → 审阅 → 发布 → 推广
- 检查点:review(人工审阅草稿)
- 输出:research.md, draft.md, social-posts.md
### bug-triage
**复现、修复、部署缺陷修复**
- 阶段:复现 → 修复 → 测试 → 部署
- 检查点:无(快速路径)
- 输出:bug-report.md, fix-summary.md
### customer-research
**深入客户细分**
- 阶段:识别 → 痛点 → 验证 → 综合
- Checkpoints: none
- 输出:customer-profile.md, insights.md
### landing-page
**创建完整落地页**
- 阶段:策略 → 文案 → 审阅 → 构建
- 检查点:文案审阅之后
- 输出:strategy.md, copy.md, landing.html, landing.css
## 流程如何工作
1. **启动** — 流程创建运行条目并生成首阶段智能体
2. **执行** — 每阶段使用上一阶段输入运行
3. **检查点** — 若阶段为检查点,流程暂停等待批准
4. **继续** — 批准后运行下一阶段
5. **完成** — 所有阶段完成,输出在 `colony/context/<run-id>/`
### 上下文传递
- 任务模板中的 `{context}` 替换为你的 --context 值
- 阶段输出保存到 `colony/context/<run-id>/<output-file>`
- 下一阶段从上一阶段输出文件读取输入
- 智能体记忆与全局上下文注入提示词
- 完整任务历史在 `tasks.json`
### 并行阶段
共享同一 `parallel_group` 的阶段并发运行:
```yaml
stages:
- id: spec
agent: forge
inputs: [analysis.md]
parallel_group: "final" # Stages with same group run together
- id: estimate
agent: ledger
inputs: [analysis.md]
parallel_group: "final" # Same group = parallel execution
```
流程到达并行组时:
1. 收集所有连续且 `parallel_group` 相同的阶段
2. 所有阶段并发生成(使用 `Promise.all()`)
3. 流程等待所有并行阶段完成
4. 任一阶段失败则整组失败
5. 检查点按组工作(所有并行阶段完成后暂停)
输出清晰显示并行执行:
```
═══ Parallel Group: final (2 stages) ═══
→ Stage 4: spec (forge)
→ Stage 5: estimate (ledger)
--- [PARALLEL] Stage 4/5: spec ---
--- [PARALLEL] Stage 5/5: estimate ---
═══ Parallel Group: final completed ═══
```
**何时使用并行组:**
- 读取相同输入的阶段(彼此无依赖)
- 构建 + 文案任务(都依赖 spec,彼此无依赖)
- 对同一数据的多种分析
- 独立研究线程
**含并行阶段的流程:**
- `validate-idea`:spec + estimate 并行运行
- `product-launch`:build + copy 并行运行
### 通知
Colony 可在流程到达检查点、完成或失败时发送通知。通知使用 `openclaw cron wake` 提醒你。
**配置**(`colony/config.yaml`):
```yaml
notifications:
enabled: true # Master switch for all notifications
on_checkpoint: true # Notify when process pauses at checkpoint
on_complete: true # Notify when process finishes
on_failure: true # Notify when process/stage fails
```
**通过 CLI 管理:**
```bash
# View current config
node scripts/colony.mjs config
# Disable all notifications
node scripts/colony.mjs config set notifications.enabled false
# Enable only failure notifications
node scripts/colony.mjs config set notifications.on_checkpoint false
node scripts/colony.mjs config set notifications.on_complete false
node scripts/colony.mjs config set notifications.on_failure true
```