New Agent

v2.1.0

Create new OpenClaw agents and connect them to messaging channels (Telegram, Discord, Slack, Feishu, WhatsApp, Signal, Google Chat). Supports single and batc...

0· 195·0 current·0 all-time
byfocusailab@joansongjr

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for joansongjr/new-agent.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "New Agent" (joansongjr/new-agent) from ClawHub.
Skill page: https://clawhub.ai/joansongjr/new-agent
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install new-agent

ClawHub CLI

Package manager switcher

npx clawhub@latest install new-agent
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description, SKILL.md, README, and the two scripts all focus on creating agent workspaces, registering agents via the openclaw CLI, and writing channel credentials into the gateway config (openclaw.json). The requested/used resources (workspace dir, openclaw.json, optional OPENCLAW_STATE_DIR) are consistent with that purpose.
Instruction Scope
The runtime instructions and scripts create workspace files, call the local 'openclaw' CLI, back up and read/write the gateway config (~/.openclaw/openclaw.json by default), and restart the gateway. This is within scope but noteworthy: the scripts will store provided channel credentials (bot tokens, app secrets, service-account info) in the top-level config and add agents to tools.agentToAgent.allow, which persists sensitive data and changes routing/agent-communication policy.
Install Mechanism
No external install or network downloads; this is an instruction-only skill with included shell/Python scripts that run locally. There are no URL downloads, package installs, or archive extraction steps in the provided files.
Credentials
The skill declares no required env vars. The scripts optionally respect OPENCLAW_STATE_DIR and otherwise operate on the user's OpenClaw state directory. They will ingest tokens/appSecrets provided in a manifest or via interactive login and write them into openclaw.json — this is expected, but it means you must supply channel credentials and accept they will be persisted in the gateway config.
Persistence & Privilege
always is false and the skill does not request permanent platform-level privileges. It modifies the gateway's own config (openclaw.json) and adds agents to agentToAgent.allow, which is consistent with its function and not an unexplained privilege escalation.
Assessment
This skill appears to do what it says, but review and use cautiously: 1) Inspect the manifest you pass to batch-setup.sh — it contains bot tokens/app secrets. Keep that file private and delete it when done. 2) The scripts will write those credentials into your openclaw.json and create backup copies; do not commit openclaw.json or backups to source control. 3) The scripts add agents to tools.agentToAgent.allow (enables agent-to-agent messaging) — verify you want that for security/isolation reasons. 4) Only run these scripts on a trusted machine where you control the OpenClaw gateway; consider testing with a small dry-run or a non-production gateway first. 5) Confirm the source of the skill (homepage is empty) before cloning/installing from unknown remotes; review the repository if installing from GitHub. Finally, ensure the manifest includes actual credentials (the scripts insert MISSING_* placeholders if fields are absent) and keep manifests/configs protected.

Like a lobster shell, security has layers — review code before you run it.

latestvk973t0eyfxnqe8j0ewak1kvx9n83h92p
195downloads
0stars
10versions
Updated 1mo ago
v2.1.0
MIT-0

New Agent

Add one or more agents to your OpenClaw gateway with dedicated workspaces and messaging channels.

When to Use

  • User wants to add a new AI agent or bot
  • User wants to connect a bot to a messaging platform
  • User wants to create a team of agents at once (batch mode)

Modes

ModeWhenScript
SingleAdd one agentscripts/setup-agent.sh
BatchAdd multiple agents at oncescripts/batch-setup.sh

⚠️ Always prefer batch mode when creating 2+ agents. Single-agent creation modifies openclaw.json each time, triggering a gateway hot reload per agent. For channels with persistent connections (Feishu WebSocket, Discord gateway), this causes repeated disconnects. Batch mode writes config once and restarts once.


Single Agent Mode

Required Information

FieldExample
Agent name"Luna"
Channeltelegram / discord / slack / feishu / whatsapp / signal / googlechat
CredentialsBot token, app secret, or QR scan

Step 1: Workspace + Registration

./scripts/setup-agent.sh {name}

This creates workspace files and registers the agent with openclaw agents add --non-interactive --workspace.

Step 2: Channel Configuration

Each channel needs two things in openclaw.json:

  1. An account entry under channels.{channel}.accounts
  2. A binding in the top-level bindings array

⚠️ The bindings array is at the root level of openclaw.json, NOT under agents.

Account Entry Templates

Add under channels.{channel}.accounts.{name}:

Telegram:

{
  "dmPolicy": "pairing",
  "botToken": "YOUR_BOT_TOKEN",
  "groupPolicy": "open",
  "streaming": "partial"
}

Discord:

{
  "token": "YOUR_BOT_TOKEN"
}

Slack:

{
  "mode": "socket",
  "appToken": "xapp-...",
  "botToken": "xoxb-..."
}

Feishu / Lark:

{
  "appId": "YOUR_APP_ID",
  "appSecret": "YOUR_APP_SECRET"
}

For Lark (global), add "domain": "lark".

WhatsApp / Signal — Use interactive login:

openclaw channels login --channel whatsapp --account {name}
openclaw channels login --channel signal --account {name}

Binding (Top-Level)

{
  "agentId": "{name}-agent",
  "match": {
    "channel": "{channel}",
    "accountId": "{name}"
  }
}

Agent-to-Agent (Optional)

Add "{name}-agent" to tools.agentToAgent.allow.

Step 3: Verify & Pair

openclaw gateway restart
openclaw agents list --bindings
openclaw channels status --probe

For DM channels, send /start to the bot, then:

openclaw pairing approve {channel} {CODE}

Batch Mode (Recommended for 2+ Agents)

Why Batch?

When creating multiple agents one-by-one:

  • Each openclaw agents add modifies openclaw.json → triggers hot reload
  • Each channel account addition → another hot reload
  • Feishu/Discord WebSocket disconnects and reconnects each time
  • Messages sent during reload may be lost

Batch mode: all workspaces first, one config write, one restart.

Step 1: Define Agents

Create a JSON manifest file listing all agents:

[
  {
    "name": "基金经理",
    "id": "fund-manager",
    "role": "管理投资研究团队",
    "emoji": "📈",
    "channel": "feishu",
    "appId": "cli_xxx",
    "appSecret": "xxx"
  },
  {
    "name": "科技研究员",
    "id": "tech-researcher",
    "role": "科技行业投资研究",
    "emoji": "💻",
    "channel": "feishu",
    "appId": "cli_yyy",
    "appSecret": "yyy"
  }
]

Fields:

  • name — Display name (used in IDENTITY.md)
  • id — Agent ID slug (lowercase, used for agent-id, account-id, workspace dir)
  • role — Role description (used in SOUL.md)
  • emoji — Agent emoji
  • channel — Channel type
  • For Telegram: add "botToken": "..."
  • For Feishu: add "appId": "..." and "appSecret": "..."
  • For Discord: add "token": "..."
  • For Slack: add "appToken": "..." and "botToken": "..."

Step 2: Run Batch Setup

./scripts/batch-setup.sh agents.json

This will:

  1. ✅ Create all workspaces (IDENTITY.md, SOUL.md, AGENTS.md, USER.md)
  2. ✅ Register all agents (openclaw agents add --non-interactive)
  3. ✅ Add all channel accounts to openclaw.json in one write
  4. ✅ Add all bindings in one write
  5. ✅ Add all agents to agentToAgent.allow in one write
  6. ✅ Restart gateway once

Step 3: Pair

For each agent, send a message in the channel, then approve:

openclaw pairing approve {channel} {CODE}

Shared Channel (Multiple Agents, One Bot)

You can route multiple agents through a single bot using group-based bindings:

{
  "agentId": "tech-researcher",
  "match": {
    "channel": "feishu",
    "accountId": "shared-bot",
    "groupId": "oc_xxxxx"
  }
}
  • DM → routes to default agent for that account
  • Group messages → route based on groupId match
  • One bot, multiple brains

Notes

  • All agents share existing model credentials — no extra API keys needed
  • One channel is enough to bring an agent online
  • Add more channels later by repeating the single-agent steps
  • The default model comes from agents.defaults.model.primary in your config
  • Batch mode prevents hot-reload churn — always use it for 2+ agents

Comments

Loading comments...