mcpField
A
antfarm-workflows

antfarm-workflows

github.com/snarktankAgent 工作流2.5k46 次安装35 周前更新
代码仓库

关于 antfarm-workflows

Antfarm 是运行在 OpenClaw 上的多 Agent 工作流技能,将规划、开发、验证、测试和审查等专门步骤串成自动执行的流程。它使用 cron 任务轮询共享 SQLite 数据库推进任务,适用于功能开发、修复缺陷和安全审查。

主要功能

  1. 01运行多 Agent 工作流
  2. 02提供功能开发、缺陷修复和安全审查流程
  3. 03通过 cron 轮询共享 SQLite 数据库
  4. 04支持安装和管理工作流
  5. 05支持创建自定义工作流

适用场景

  1. 01将新功能拆分为连续执行的步骤
  2. 02按复现信息处理缺陷报告
  3. 03扫描并修复代码库安全问题

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/snarktank/antfarm --skill antfarm-workflows

安装后在 Claude Code 中输入/antfarm-workflows确认已加载。

详细介绍

Antfarm

基于 OpenClaw 的多 Agent 工作流管道。每个工作流由一系列专用 Agent(规划者、开发者、验证者、测试者、审查者)组成,它们通过定时任务轮询共享的 SQLite 数据库并自主执行。

所有 CLI 命令都使用完整路径,以避免 PATH 问题:

node ~/.openclaw/workspace/antfarm/dist/cli/cli.js <command>

下文使用的简写:antfarm-cli 表示 node ~/.openclaw/workspace/antfarm/dist/cli/cli.js。

工作流

工作流管道适用场景
feature-dev规划 -> 设置 -> 开发(用户故事) -> 验证 -> 测试 -> PR -> 审查新功能、重构
bug-fix分类 -> 调查 -> 设置 -> 修复 -> 验证 -> PR提供复现步骤的 Bug 报告
security-audit扫描 -> 排定优先级 -> 设置 -> 修复 -> 验证 -> 测试 -> PR代码库安全审查

核心命令

# Install all workflows (creates agents + starts dashboard)
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js install

# Full uninstall (workflows, agents, crons, DB, dashboard)
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js uninstall [--force]

# Start a run
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow run <workflow-id> "<detailed task with acceptance criteria>"

# Check a run
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow status "<task or run-id prefix>"

# List all runs
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow runs

# Resume a failed run from the failed step
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow resume <run-id>

# View logs
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js logs [lines]

# Dashboard
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js dashboard [start] [--port N]
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js dashboard stop

开始运行前

任务描述是你与 Agent 之间的约定。任务描述含糊会导致结果不理想。

任务描述中务必包含:

  1. 要构建或修复的内容(具体明确,不要含糊)
  2. 关键技术细节和限制条件
  3. 验收标准(复选框)

运行前,请用户确认计划和验收标准。

工作原理

  • Agent 会运行定时任务(每 15 分钟一次,错开执行),轮询待处理步骤
  • 每个 Agent 领取自己的步骤、完成工作并将其标记为完成,随后推进到下一步
  • 上下文通过 Agent 输出中的 KEY: value 键值对在步骤间传递
  • 没有中央编排器——Agent 自主运行

强制触发 Agent

若要跳过 15 分钟的定时任务等待,请使用 cron 工具,设置 action: "run" 并提供 Agent 的任务 ID。列出定时任务即可找到它们——任务名的格式为 antfarm/<workflow-id>/<agent-id>。

工作流管理

# List available workflows
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js workflow list

# Install/uninstall individual workflows
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]

创建自定义工作流

完整指南请参阅 {baseDir}/../../docs/creating-workflows.md,了解如何编写工作流 YAML、Agent 工作区、步骤模板和验证循环。

Agent 步骤操作(由 Agent 定时任务使用,通常不手动执行)

node ~/.openclaw/workspace/antfarm/dist/cli/cli.js step claim <agent-id>        # Claim pending step
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js step complete <step-id>      # Complete step (output from stdin)
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js step fail <step-id> <error>  # Fail step with retry
node ~/.openclaw/workspace/antfarm/dist/cli/cli.js step stories <run-id>        # List stories for a run

评论

支持 Markdown