Agent Swarm for Openclaw

An intelligent orchestration skill that routes tasks to the most efficient AI models while managing sub-agent delegation.

austindixson
v1.7.19
Mar 9, 2026
4
2.5k
27

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install agent-swarm

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install agent-swarm using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Agent Swarm?

Agent Swarm acts as a high-performance traffic cop for your AI ecosystem. It is designed to analyze incoming tasks and intelligently delegate them to specialized models based on the nature of the work—whether it requires deep reasoning, rapid response, or complex code generation. By leveraging OpenRouter, this skill ensures that every request is handled by the most cost-effective and capable model available.

Built as a core component for advanced Openclaw Skills implementations, Agent Swarm follows a strict non-negotiable rule: the orchestrator must delegate work rather than performing it. This separation of concerns allows for a modular, scalable agent architecture where sub-agents are spawned dynamically to solve specific problems in isolated environments.

Agent Swarm Use Cases

  • Routing complex software engineering tasks to specialized coding models like Qwen or DeepSeek.
  • Offloading simple status checks or data fetching to low-cost, high-speed models to save tokens.
  • Handling creative writing or UI/UX design requests using models optimized for creative output.
  • Managing multi-step research workflows where logic and fact-finding are delegated to reasoning-heavy models.
  • Securing agent environments by pre-validating task strings against prompt-injection patterns before spawning sub-agents.

How Agent Swarm Works

  1. The orchestrator receives a user message and passes it to the router script via a secure subprocess call.
  2. The router analyzes the input against a set of predefined tiers such as CODE, RESEARCH, or FAST.
  3. Based on the configuration, the router selects a primary model and a session target.
  4. If the task is complex, the router can output multiple spawn configurations for parallel execution.
  5. The orchestrator calls the sessions_spawn function with the recommended model and task.
  6. The sub-agent completes the work and returns the result to the orchestrator for final delivery to the user.

Agent Swarm Setup

To get started with this skill within the Openclaw Skills framework, ensure your OpenRouter API key is configured in your platform settings.

# Verify the router is functional
python scripts/router.py models

# Test task classification
python scripts/router.py classify "fix lint errors"

# Run a test spawn in JSON mode
python scripts/router.py spawn --json "write a short poem"

Ensure that the environment has read access to your openclaw.json file to allow the router to determine the correct execution host and node.

Agent Swarm Data Schema & Taxonomy

Agent Swarm utilizes a structured configuration to manage its routing logic and model registry.

Core Configuration (config.json)

Field Description
default_model The fallback model used for general tasks and new sessions.
routing_rules A mapping of tiers (CODE, FAST, VISION, etc.) to specific primary and fallback models.
models An array of supported OpenRouter model IDs.

Task Tiers

  • FAST: Simple checks and status updates.
  • REASONING: Math, logic, and step-by-step analysis.
  • CODE: Debugging, refactoring, and implementation.
  • CREATIVE: Writing, storytelling, and UI design.

Agent Swarm Advanced Features

  • Multi-agent orchestration via the --multi flag for parallel task execution.
  • Dynamic model fallback arrays to ensure task completion even if a primary model is rate-limited.
  • Built-in prompt-injection mitigation that rejects malicious task strings (script tags, event handlers).
  • Whitelisted configuration patching to safely update execution environments without exposing secrets.
  • Deep integration with OpenRouter to access the latest specialized LLMs as they are released.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*