SuperAPI AI 工具集

antfarm-workflows

智能体与模型

查看项目

更新于 10-16 02:09

技能介绍

Antfarm 是一个面向 OpenClaw 的多智能体工作流编排工具,用于把多步骤的开发类任务交给一组专职智能体自主完成。

用途 Antfarm 适合需要多阶段协作的开发任务。当用户提到 antfarm,或要求运行多步骤工作流(如功能开发、缺陷修复、安全审计)时使用。每条工作流由一系列专职智能体组成,包括规划者(planner)、开发者(developer)、验证者(verifier)、测试者(tester)、审查者(reviewer),它们通过定时任务轮询共享的 SQLite 数据库,自主执行各自步骤。

内置工作流

  • feature-dev:流水线为 plan -> setup -> develop(stories)-> verify -> test -> PR -> review,适用于新功能开发与重构。
  • bug-fix:流水线为 triage -> investigate -> setup -> fix -> verify -> PR,适用于带有复现步骤的缺陷报告。
  • security-audit:流水线为 scan -> prioritize -> setup -> fix -> verify -> test -> PR,适用于代码库安全审查。

使用方式 所有 CLI 命令使用完整路径以避免 PATH 问题: node ~/.openclaw/workspace/antfarm/dist/cli/cli.js <command>

核心命令:

  • 安装全部工作流(创建智能体并启动仪表盘): node ~/.openclaw/workspace/antfarm/dist/cli/cli.js install
  • 完全卸载(工作流、智能体、定时任务、数据库、仪表盘): node ~/.openclaw/workspace/antfarm/dist/cli/cli.js uninstall [--force]
  • 启动一次运行: node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow run <workflow-id> "<detailed task with acceptance criteria>"
  • 查看某次运行状态: node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow status "<task or run-id prefix>"
  • 列出所有运行: node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow runs
  • 从失败步骤恢复运行: node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow resume <run-id>
  • 查看日志: node ~/.openclaw/workspace/antfarm/dist/cli/cli.js logs [lines]
  • 仪表盘: node ~/.openclaw/workspace/antfarm/dist/cli/cli.js dashboard [start] [--port N] node ~/.openclaw/workspace/antfarm/dist/cli/cli.js dashboard stop

工作流管理:

  • 列出可用工作流: node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow list
  • 安装/卸载单个工作流: node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow install <name> node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow uninstall <name> node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow uninstall --all [--force]

运行前的准备 任务字符串是用户与智能体之间的契约,模糊的任务会产生糟糕的结果。任务字符串中应始终包含:要构建或修复的内容(具体而非模糊)、关键技术细节与约束、验收标准(复选框形式)。在运行前应让用户确认计划与验收标准。

工作原理 智能体拥有定时任务(每 15 分钟一次,错峰执行),轮询待处理的步骤。每个智能体认领自己的步骤,完成工作后标记为完成,从而推进下一步。上下文通过智能体输出中的 KEY: value 键值对在步骤之间传递。没有中央编排器,智能体是自主运行的。

强制触发智能体 如需跳过 15 分钟的定时等待,可使用 cron 工具,action 设为 "run",并指定智能体的 job ID。列出定时任务即可找到它们,命名格式为 antfarm/<workflow-id>/<agent-id>。

创建自定义工作流 完整指南(编写工作流 YAML、智能体工作区、步骤模板与验证循环)见 {baseDir}/../../docs/creating-workflows.md。

智能体步骤操作(供智能体定时任务使用,通常不手动执行)

  • node ~/.openclaw/workspace/antfarm/dist/cli/cli.js step claim <agent-id> # 认领待处理步骤
  • node ~/.openclaw/workspace/antfarm/dist/cli/cli.js step complete <step-id> # 完成步骤(输出来自 stdin)
  • node ~/.openclaw/workspace/antfarm/dist/cli/cli.js step fail <step-id> <error> # 步骤失败并重试
  • node ~/.openclaw/workspace/antfarm/dist/cli/cli.js step stories <run-id> # 列出某次运行的故事

适用场景与限制 适用于在 OpenClaw 环境中编排多步骤开发、修复与安全审计任务。运行依赖 OpenClaw 工作区路径与 SQLite 数据库,智能体推进依赖定时任务轮询,默认存在最长约 15 分钟的等待间隔。关于收费、价格、平台支持范围等更多信息,资料暂未提供。