Token导航 LogoToken导航TokenDH.com
研究检索敏感数据clawhub未标认证来源可访问clear审计通过

agent-swarmAgent 群

Agent Skill

agent-swarm 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

75,876

周安装

3,226

GitHub Stars

4

下载量

26,582
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:agent-swarm(Agent 群)
来源仓库:https://github.com/austindixson/agent-swarm
安装命令:
openclaw skills install agent-swarm
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install agent-swarm

简介

重要提示:需要 OpenRouter。将任务路由到正确的模型并始终通过session_spawn 委派工作。

SKILL.md

name
agent-swarm
displayName
Agent Swarm | OpenClaw Skill
description
IMPORTANT: OpenRouter is required. Routes tasks to the right model and always delegates work through sessions_spawn. Rejects prompt-injection patterns in task strings (v1.7.6+).
version
1.7.8

Agent Swarm | OpenClaw Skill

Description

IMPORTANT: OpenRouter is required. Routes tasks to the right model and always delegates work through sessions_spawn.

Before installing

  • OPENCLAW_HOME: Not required. The skill uses OPENCLAW_HOME only if set; otherwise it defaults to ~/.openclaw. This is consistent in both metadata (_meta.json: listed in optionalEnv, not in env) and behavior.
  • openclaw.json read access: The skill reads the local file openclaw.json (at $OPENCLAW_HOME/openclaw.json or ~/.openclaw/openclaw.json). Only the fields tools.exec.host and tools.exec.node are used; no gateway secrets or API keys are read. Verify you are comfortable granting read access to that file before installing.

Examples

Single task

Router output: {"task":"write a poem","model":"openrouter/moonshotai/kimi-k2.5","sessionTarget":"isolated"}

Then call: sessions_spawn(task="write a poem", model="openrouter/moonshotai/kimi-k2.5", sessionTarget="isolated")

Parallel tasks

python3 workspace/skills/agent-swarm/scripts/router.py spawn --json --multi "fix bug and write poem"

This returns multiple spawn configs. Start one sub-agent per config.

Commands

Manual/CLI use only. The examples below pass the task as a single argument; for programmatic use with untrusted user input, always invoke the router via subprocess.run(..., [..., user_message], ...) with a list of arguments (see Security). Do not build a shell command string from user input.

python scripts/router.py default
python scripts/router.py classify "fix lint errors"
python scripts/router.py spawn --json "write a poem"
python scripts/router.py spawn --json --multi "fix bug and write poem"
python scripts/router.py models

What this skill does

Agent Swarm is a traffic cop for AI models. It picks the best model for each task, then starts a sub-agent to do the work.

IMPORTANT: OpenRouter is required

Required Platform Configuration:

  • OpenRouter API key: Must be configured in OpenClaw platform settings (not provided by this skill)
  • OPENCLAW_HOME (optional): Environment variable pointing to OpenClaw workspace root. If not set, defaults to ~/.openclaw
  • openclaw.json access: The router reads tools.exec.host and tools.exec.node from openclaw.json (located at $OPENCLAW_HOME/openclaw.json or ~/.openclaw/openclaw.json). Only these two fields are accessed; no gateway secrets or API keys are read.

Model Requirements:

  • Model IDs must use openrouter/... prefix
  • If OpenRouter is not configured in OpenClaw, delegation will fail

Why this helps

  • Faster replies (cheap orchestrator, smart sub-agent routing)
  • Better quality (code tasks go to code models, writing tasks go to writing models)
  • Lower cost (you do not run every task on the most expensive model)

Core rule (non-negotiable)

For user tasks, the orchestrator must delegate. It must NOT answer the task itself.

Use this flow every time:

  1. Run router. From orchestrator code, use subprocess with a list of arguments (never shell interpolation with user input):
   import subprocess
   result = subprocess.run(
       ["python3", "/path/to/workspace/skills/agent-swarm/scripts/router.py", "spawn", "--json", user_message],
       capture_output=True,
       text=True
   )
   data = json.loads(result.stdout) if result.returncode == 0 else {}

CLI only (manual testing; do not use from code with untrusted user input): python3 workspace/skills/agent-swarm/scripts/router.py spawn --json "your task here" Use OPENCLAW_HOME or absolute path for the script when not in workspace root.

  1. If needs_config_patch is true: stop and report that patch to the user.
  2. Otherwise call:

sessions_spawn(task=..., model=..., sessionTarget=...)

  1. Wait for sessions_spawn result.
  2. Return the sub-agent result to the user.

If sessions_spawn fails, return only a delegation failure message. Do not do the task yourself.

Config basics

Edit config.json in the skill root (parent of scripts/) to change routing.

What you can change

WhatKeyPurpose
Orchestrator / session defaultdefault_modelMain agent and new sessions (e.g. Gemini 2.5 Flash)
Task-specific model per tierrouting_rules.<TIER>.primaryModel used when a task matches that tier
Backup models if primary failsrouting_rules.<TIER>.fallbackArray of model IDs to try next

All task-specific tiers (change the model for each)

TierKey to change primaryTypical use
FASTrouting_rules.FAST.primarySimple tasks: check, list, status, fetch
REASONINGrouting_rules.REASONING.primaryLogic, math, step-by-step analysis
CREATIVErouting_rules.CREATIVE.primaryWriting, stories, UI/UX, design
RESEARCHrouting_rules.RESEARCH.primaryResearch, search, fact-finding
CODErouting_rules.CODE.primaryCode, debug, refactor, implement
QUALITYrouting_rules.QUALITY.primaryComplex/architecture tasks
COMPLEXrouting_rules.COMPLEX.primaryMulti-step / complex system tasks
VISIONrouting_rules.VISION.primaryImage analysis, screenshots, visual

To change all task-specific models: edit each routing_rules.<TIER>.primary above. Use model IDs from the models array in config.json (must start with openrouter/).

Simple config examples

Orchestrator only (keep defaults for tiers):

{
  "default_model": "openrouter/google/gemini-2.5-flash"
}

(Other keys like routing_rules and models can stay as in the shipped config.json.)

Change one tier (e.g. CODE to MiniMax):

"routing_rules": {
  "CODE": {
    "primary": "openrouter/minimax/minimax-m2.5",
    "fallback": ["openrouter/qwen/qwen3-coder-flash"]
  }
}

Change multiple tiers (primaries only):

"routing_rules": {
  "CREATIVE": { "primary": "openrouter/moonshotai/kimi-k2.5", "fallback": [] },
  "CODE":     { "primary": "openrouter/z-ai/glm-4.7-flash", "fallback": ["openrouter/minimax/minimax-m2.5"] },
  "RESEARCH": { "primary": "openrouter/x-ai/grok-4.1-fast", "fallback": [] }
}

Only include tiers you want to override; the rest are read from the full config.json.

Security

Input Validation

The router validates and sanitizes all inputs to prevent injection attacks:

  • Task strings: Validated for length (max 10KB), null bytes; rejects prompt-injection patterns (script tags, javascript: protocol, event-handler attributes). Invalid tasks raise ValueError with a clear message.
  • Config patches: Only allows modifications to tools.exec.host and tools.exec.node (whitelist approach)
  • Labels: Validated for length and null bytes

Safe Execution

Critical: When calling router.py from orchestrator code, always use subprocess with a list of arguments, never shell string interpolation:

# ✅ SAFE: Use subprocess with list arguments
import subprocess
result = subprocess.run(
    ["python3", "/path/to/router.py", "spawn", "--json", user_message],
    capture_output=True,
    text=True
)

# ❌ UNSAFE: Shell string interpolation (vulnerable to injection)
import os
os.system(f'python3 router.py spawn --json "{user_message}"')  # DON'T DO THIS

The router uses Python's argparse, which safely handles arguments when passed as a list. Shell string interpolation is vulnerable to command injection if the user message contains shell metacharacters.

Config Patch Safety

The recommended_config_patch only modifies safe fields:

  • tools.exec.host (must be 'sandbox' or 'node')
  • tools.exec.node (only when host is 'node')

All config patches are validated before being returned. The orchestrator should validate patches again before applying them to openclaw.json.

Prompt Injection Mitigation

The router rejects task strings that contain prompt-injection patterns (e.g. <script>, javascript:, onclick=). Rejected tasks raise ValueError; the orchestrator should surface a clear message and not pass the task to sub-agents. Additional layers:

  1. The orchestrator (validating task strings and handling rejections)
  2. The sub-agent LLM (resisting prompt injection)
  3. The OpenClaw platform (sanitizing sessions_spawn inputs)

File Access

Required File Access:

  • Read: openclaw.json (located via OPENCLAW_HOME environment variable or ~/.openclaw/openclaw.json)

- Fields accessed: tools.exec.host and tools.exec.node only - Purpose: Determine execution environment for spawned sub-agents - Security: The router does NOT read gateway secrets, API keys, or any other sensitive configuration

Write Access:

  • Write: None (no files are written by this skill)
  • Config patches: The skill may return recommended_config_patch JSON that the orchestrator can apply, but the skill itself does not write to openclaw.json

Security Guarantees:

  • The router does not persist, upload, or transmit any tokens or credentials
  • Only tools.exec.host and tools.exec.node are accessed from openclaw.json
  • All file access is read-only except for validated config patches (whitelisted to tools.exec.* only)

Other Security Notes

  • This skill does not expose gateway secrets.
  • Use gateway-guard separately for gateway/auth management.
  • The router does not execute arbitrary code or modify files outside of config patches.
  • The phrase "saves tokens" in documentation refers to cost savings (using cheaper models for simple tasks), not token storage or collection.

适合场景

01

调用多模型

02

代码和文本生成

03

Agent 推理流程

04

OpenRouter 模型接入

能力概览

能力 1

统一调用多种 LLM

能力 2

支持 Claude、Gemini、Kimi 等模型

能力 3

适合聊天、代码和推理任务

能力 4

可作为 Agent 模型调用入口

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

98.68%
按下载量换算26,231

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

未展示

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills