Antfarm
Multi-agent workflow pipelines on OpenClaw. Each workflow is a sequence of specialized agents (planner, developer, verifier, tester, reviewer) that execute autonomously via cron jobs polling a shared SQLite database.
All CLI commands use the full path to avoid PATH issues:
CODEBLOCK0
Shorthand used below: antfarm-cli means node ~/.openclaw/workspace/antfarm/dist/cli/cli.js.
Workflows
| Workflow | Pipeline | Use for |
|---|
| INLINECODE2 | plan -> setup -> develop (stories) -> verify -> test -> PR -> review | New features, refactors |
| INLINECODE3 |
triage -> investigate -> setup -> fix -> verify -> PR | Bug reports with reproduction steps |
|
security-audit | scan -> prioritize -> setup -> fix -> verify -> test -> PR | Codebase security review |
Core Commands
CODEBLOCK1
Before Starting a Run
The task string is the contract between you and the agents. A vague task produces bad results.
Always include in the task string:
- 1. What to build/fix (specific, not vague)
- Key technical details and constraints
- Acceptance criteria (checkboxes)
Get the user to confirm the plan and acceptance criteria before running.
How It Works
- - Agents have cron jobs (every 15 min, staggered) that poll for pending steps
- Each agent claims its step, does the work, marks it done, advancing the next step
- Context passes between steps via KEY: value pairs in agent output
- No central orchestrator — agents are autonomous
Force-Triggering Agents
To skip the 15-min cron wait, use the cron tool with action: "run" and the agent's job ID. List crons to find them — they're named antfarm/<workflow-id>/<agent-id>.
Workflow Management
CODEBLOCK2
Creating Custom Workflows
See {baseDir}/../../docs/creating-workflows.md for the full guide on writing workflow YAML, agent workspaces, step templates, and verification loops.
Agent Step Operations (used by agent cron jobs, not typically manual)
CODEBLOCK3
Antfarm
基于OpenClaw的多智能体工作流管道。每个工作流由一系列专业智能体(规划者、开发者、验证者、测试者、审查者)组成,通过轮询共享SQLite数据库的cron作业自主执行。
所有CLI命令均使用完整路径以避免PATH问题:
bash
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js
下文简写:antfarm-cli 表示 node ~/.openclaw/workspace/antfarm/dist/cli/cli.js。
工作流
| 工作流 | 管道 | 用途 |
|---|
| feature-dev | 规划 -> 搭建 -> 开发(故事) -> 验证 -> 测试 -> PR -> 审查 | 新功能、重构 |
| bug-fix |
分类 -> 调查 -> 搭建 -> 修复 -> 验证 -> PR | 带有复现步骤的Bug报告 |
| security-audit | 扫描 -> 优先级排序 -> 搭建 -> 修复 -> 验证 -> 测试 -> PR | 代码库安全审查 |
核心命令
bash
安装所有工作流(创建智能体 + 启动仪表盘)
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js install
完全卸载(工作流、智能体、cron任务、数据库、仪表盘)
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js uninstall [--force]
启动一次运行
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow run
<带有验收标准的详细任务>
检查运行状态
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow status <任务或运行ID前缀>
列出所有运行
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow runs
从失败步骤恢复运行
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow resume
查看日志
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
启动运行前
任务字符串是您与智能体之间的契约。模糊的任务会产生糟糕的结果。
任务字符串中始终包含:
- 1. 要构建/修复的内容(具体而非模糊)
- 关键技术细节和约束条件
- 验收标准(复选框)
在运行前让用户确认计划和验收标准。
工作原理
- - 智能体拥有cron作业(每15分钟,错开执行),轮询待处理步骤
- 每个智能体认领其步骤,完成工作,标记完成,推进下一步
- 上下文通过智能体输出中的KEY: value键值对在步骤间传递
- 无中央协调器——智能体自主运行
强制触发智能体
要跳过15分钟的cron等待,使用带有 action: run 和智能体作业ID的 cron 工具。列出cron任务即可找到它们——命名格式为 antfarm//。
工作流管理
bash
列出可用工作流
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow list
安装/卸载单个工作流
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow install
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow uninstall
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow uninstall --all [--force]
创建自定义工作流
关于编写工作流YAML、智能体工作空间、步骤模板和验证循环的完整指南,请参阅 {baseDir}/../../docs/creating-workflows.md。
智能体步骤操作(由智能体cron作业使用,通常不手动执行)
bash
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js step claim # 认领待处理步骤
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js step complete # 完成步骤(从标准输入输出)
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js step fail # 步骤失败并重试
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js step stories # 列出运行的故事