Agent Council
Complete toolkit for creating and managing autonomous AI agents with Discord integration for OpenClaw.
What This Skill Does
Agent Creation:
- - Creates autonomous AI agents with self-contained workspaces
- Generates SOUL.md (personality & responsibilities)
- Generates HEARTBEAT.md (cron execution logic)
- Sets up memory system (hybrid architecture)
- Configures gateway automatically
- Binds agents to Discord channels (optional)
- Sets up daily memory cron jobs (optional)
Discord Channel Management:
- - Creates Discord channels via API
- Configures OpenClaw gateway allowlists
- Sets channel-specific system prompts
- Renames channels and updates references
- Optional workspace file search
Installation
CODEBLOCK0
Part 1: Agent Creation
Quick Start
CODEBLOCK1
Workflow
1. Gather Requirements
Ask the user:
- - Agent name (e.g., "Watson")
- Agent ID (lowercase, hyphenated, e.g., "watson")
- Emoji (e.g., "🔬")
- Specialty (what the agent does)
- Model (which LLM to use)
- Workspace (where to create agent files)
- Discord channel ID (optional)
2. Run Creation Script
CODEBLOCK2
The script automatically:
- - ✅ Creates workspace with memory subdirectory
- ✅ Generates SOUL.md and HEARTBEAT.md
- ✅ Updates gateway config (preserves existing agents)
- ✅ Adds Discord channel binding (if specified)
- ✅ Restarts gateway to apply changes
- ✅ Prompts for daily memory cron setup
3. Customize Agent
After creation:
- - SOUL.md - Refine personality, responsibilities, boundaries
- HEARTBEAT.md - Add periodic checks and cron logic
- Workspace files - Add agent-specific configuration
Agent Architecture
Self-contained structure:
CODEBLOCK3
Memory system:
- - Agent-specific memory: INLINECODE0
- Shared memory access: Agents can read shared workspace
- Daily updates: Optional cron job for summaries
Cron jobs:
If your agent needs scheduled tasks:
- 1. Create HEARTBEAT.md with execution logic
- Add cron jobs with INLINECODE1
- Document in SOUL.md
Examples
Research agent:
CODEBLOCK4
Image generation agent:
CODEBLOCK5
Health tracking agent:
CODEBLOCK6
Part 2: Discord Channel Management
Channel Creation
Quick Start
CODEBLOCK7
Workflow
- 1. Run setup script:
CODEBLOCK8
- 2. Apply gateway config (command shown by script):
CODEBLOCK9
Options
With category:
CODEBLOCK10
Use existing channel:
CODEBLOCK11
Channel Renaming
Quick Start
CODEBLOCK12
Workflow
- 1. Run rename script:
CODEBLOCK13
- 2. Apply gateway config if systemPrompt needs updating (shown by script)
- 3. Commit workspace file changes (if
--workspace used)
With Workspace Search
CODEBLOCK14
This will:
- - Rename Discord channel via API
- Update gateway config systemPrompt
- Search and update workspace files
- Report files changed for git commit
Complete Multi-Agent Setup
Full workflow from scratch:
CODEBLOCK15
Configuration
Discord Category ID
Option 1: Command line
CODEBLOCK16
Option 2: Environment variable
CODEBLOCK17
Finding Discord IDs
Enable Developer Mode:
- - Settings → Advanced → Developer Mode
Copy IDs:
- - Right-click channel → Copy ID
- Right-click category → Copy ID
Scripts Reference
create-agent.sh
Arguments:
- -
--name (required) - Agent name - INLINECODE4 (required) - Agent ID (lowercase, hyphenated)
- INLINECODE5 (required) - Agent emoji
- INLINECODE6 (required) - What the agent does
- INLINECODE7 (required) - LLM to use (provider/model-name)
- INLINECODE8 (required) - Where to create agent files
- INLINECODE9 (optional) - Discord channel ID to bind
Output:
- - Creates agent workspace
- Generates SOUL.md and HEARTBEAT.md
- Updates gateway config
- Optionally creates daily memory cron
setup-channel.py
Arguments:
- -
--name (required) - Channel name - INLINECODE11 (required) - Channel purpose/context
- INLINECODE12 (optional) - Existing channel ID
- INLINECODE13 (optional) - Discord category ID
Output:
- - Creates Discord channel (if doesn't exist)
- Generates gateway config.patch command
rename-channel.py
Arguments:
- -
--id (required) - Channel ID - INLINECODE15 (required) - Current channel name
- INLINECODE16 (required) - New channel name
- INLINECODE17 (optional) - Workspace directory to search
Output:
- - Renames Discord channel
- Updates gateway systemPrompt (if needed)
- Lists updated files (if workspace search enabled)
Gateway Integration
This skill integrates with OpenClaw's gateway configuration:
Agents:
CODEBLOCK18
Bindings:
CODEBLOCK19
Channels:
CODEBLOCK20
Agent Coordination
Your main agent coordinates with specialized agents using OpenClaw's built-in session management tools.
List Active Agents
See all active agents and their recent activity:
CODEBLOCK21
Send Messages to Agents
Direct communication:
CODEBLOCK22
Wait for response:
CODEBLOCK23
Spawn Sub-Agent Tasks
For complex work, spawn a sub-agent in an isolated session:
CODEBLOCK24
The sub-agent will:
- 1. Execute the task in isolation
- Announce completion back to your session
- Self-delete (if
cleanup: "delete")
Check Agent History
Review what an agent has been working on:
CODEBLOCK25
Coordination Patterns
1. Direct delegation (Discord-bound agents):
- - User messages agent's Discord channel
- Agent responds directly in that channel
- Main agent doesn't need to coordinate
2. Programmatic delegation (main agent → sub-agent):
CODEBLOCK26
3. Spawn for complex tasks:
CODEBLOCK27
4. Agent-to-agent communication:
Agents can send messages to each other:
CODEBLOCK28
Best Practices
When to use Discord bindings:
- - ✅ Domain-specific agents (research, health, images)
- ✅ User wants direct access to agent
- ✅ Agent should respond to channel activity
When to use sessions_send:
- - ✅ Programmatic coordination
- ✅ Main agent delegates to specialists
- ✅ Need response in same session
When to use sessions_spawn:
- - ✅ Long-running tasks (>5 minutes)
- ✅ Complex multi-step work
- ✅ Want isolation from main session
- ✅ Background processing
Example: Research Workflow
CODEBLOCK29
Communication Flow
Main Agent (You) ↔ Specialized Agents:
CODEBLOCK30
Discord-Bound Agents:
CODEBLOCK31
Hybrid Approach:
CODEBLOCK32
Troubleshooting
Agent Creation Issues:
"Agent not appearing in Discord"
- - Verify channel ID is correct
- Check gateway config bindings section
- Restart gateway: INLINECODE19
"Model errors"
- - Verify model name format: INLINECODE20
- Check model is available in gateway config
Channel Management Issues:
"Failed to create channel"
- - Check bot has "Manage Channels" permission
- Verify bot token in OpenClaw config
- Ensure category ID is correct (if specified)
"Category not found"
- - Verify category ID is correct
- Check bot has access to category
- Try without category ID (creates uncategorized)
"Channel already exists"
- - Use
--id <channel-id> to configure existing channel - Or script will auto-detect and configure it
Use Cases
- - Domain specialists - Research, health, finance, coding agents
- Creative agents - Image generation, writing, design
- Task automation - Scheduled monitoring, reports, alerts
- Multi-agent systems - Coordinated team of specialized agents
- Discord organization - Structured channels for different agent domains
Advanced: Multi-Agent Coordination
For larger multi-agent systems:
Coordination Patterns:
- - Main agent delegates tasks to specialists
- Agents report progress and request help
- Shared knowledge base for common information
- Cross-agent communication via INLINECODE22
Task Management:
- - Integrate with task tracking systems
- Route work based on agent specialty
- Track assignments and completions
Documentation:
- - Maintain agent roster in main workspace
- Document delegation patterns
- Keep runbooks for common workflows
Best Practices
- 1. Organize channels in categories - Group related agent channels
- Use descriptive channel names - Clear purpose from the name
- Set specific system prompts - Give each channel clear context
- Document agent responsibilities - Keep SOUL.md updated
- Set up memory cron jobs - For agents with ongoing work
- Test agents individually - Before integrating into team
- Update gateway config safely - Always use config.patch, never manual edits
Requirements
Bot Permissions:
- -
Manage Channels - To create/rename channels - INLINECODE24 - To read channel list
- INLINECODE25 - To post in channels
System:
- - OpenClaw installed and configured
- Node.js/npm via nvm
- Python 3.6+ (standard library only)
- Discord bot token (for channel management)
See Also
- - OpenClaw documentation: https://docs.openclaw.ai
- Multi-agent patterns: https://docs.openclaw.ai/agents
- Discord bot setup: https://docs.openclaw.ai/channels/discord
Agent Council
用于创建和管理自主AI代理的完整工具包,集成Discord,适用于OpenClaw。
此技能的功能
代理创建:
- - 创建具有独立工作区的自主AI代理
- 生成SOUL.md(个性与职责)
- 生成HEARTBEAT.md(定时执行逻辑)
- 设置记忆系统(混合架构)
- 自动配置网关
- 将代理绑定到Discord频道(可选)
- 设置每日记忆定时任务(可选)
Discord频道管理:
- - 通过API创建Discord频道
- 配置OpenClaw网关白名单
- 设置频道特定的系统提示
- 重命名频道并更新引用
- 可选的工作区文件搜索
安装
bash
从ClawHub安装
clawhub install agent-council
或手动安装
cp -r . ~/.openclaw/skills/agent-council/
openclaw gateway config.patch --raw {
skills: {
entries: {
agent-council: {enabled: true}
}
}
}
第一部分:代理创建
快速开始
bash
scripts/create-agent.sh \
--name Watson \
--id watson \
--emoji 🔬 \
--specialty 研究与分析专家 \
--model anthropic/claude-opus-4-5 \
--workspace $HOME/agents/watson \
--discord-channel 1234567890
工作流程
1. 收集需求
询问用户:
- - 代理名称(例如:Watson)
- 代理ID(小写,连字符分隔,例如:watson)
- 表情符号(例如:🔬)
- 专长(代理的职责)
- 模型(使用的LLM)
- 工作区(创建代理文件的位置)
- Discord频道ID(可选)
2. 运行创建脚本
bash
scripts/create-agent.sh \
--name 代理名称 \
--id agent-id \
--emoji 🤖 \
--specialty 此代理的职责 \
--model provider/model-name \
--workspace /path/to/workspace \
--discord-channel 1234567890 # 可选
脚本会自动:
- - ✅ 创建包含记忆子目录的工作区
- ✅ 生成SOUL.md和HEARTBEAT.md
- ✅ 更新网关配置(保留现有代理)
- ✅ 添加Discord频道绑定(如果指定)
- ✅ 重启网关以应用更改
- ✅ 提示设置每日记忆定时任务
3. 自定义代理
创建后:
- - SOUL.md - 完善个性、职责、边界
- HEARTBEAT.md - 添加定期检查和定时逻辑
- 工作区文件 - 添加代理特定配置
代理架构
独立结构:
agents/
├── watson/
│ ├── SOUL.md # 个性和职责
│ ├── HEARTBEAT.md # 定时执行逻辑
│ ├── memory/ # 代理特定记忆
│ │ ├── 2026-02-01.md # 每日记忆日志
│ │ └── 2026-02-02.md
│ └── .openclaw/
│ └── skills/ # 代理特定技能(可选)
记忆系统:
- - 代理特定记忆:/memory/YYYY-MM-DD.md
- 共享记忆访问:代理可以读取共享工作区
- 每日更新:可选的定时任务用于摘要
定时任务:
如果您的代理需要计划任务:
- 1. 创建包含执行逻辑的HEARTBEAT.md
- 使用--session 添加定时任务
- 在SOUL.md中记录
示例
研究代理:
bash
scripts/create-agent.sh \
--name Watson \
--id watson \
--emoji 🔬 \
--specialty 深度研究和竞争分析 \
--model anthropic/claude-opus-4-5 \
--workspace $HOME/agents/watson \
--discord-channel 1234567890
图像生成代理:
bash
scripts/create-agent.sh \
--name Picasso \
--id picasso \
--emoji 🎨 \
--specialty 图像生成和编辑专家 \
--model google/gemini-3-flash-preview \
--workspace $HOME/agents/picasso \
--discord-channel 9876543210
健康追踪代理:
bash
scripts/create-agent.sh \
--name Nurse Joy \
--id nurse-joy \
--emoji 💊 \
--specialty 健康追踪和健康监测 \
--model anthropic/claude-opus-4-5 \
--workspace $HOME/agents/nurse-joy \
--discord-channel 5555555555
第二部分:Discord频道管理
频道创建
快速开始
bash
python3 scripts/setup-channel.py \
--name research \
--context 深度研究和竞争分析
工作流程
- 1. 运行设置脚本:
bash
python3 scripts/setup-channel.py \
--name <频道名称> \
--context <频道用途> \
[--category-id
]
- 2. 应用网关配置(脚本会显示命令):
bash
openclaw gateway config.patch --raw {channels: {...}}
选项
带分类:
bash
python3 scripts/setup-channel.py \
--name research \
--context 深度研究和竞争分析 \
--category-id 1234567890
使用现有频道:
bash
python3 scripts/setup-channel.py \
--name personal-finance \
--id 1466184336901537897 \
--context 个人财务管理
频道重命名
快速开始
bash
python3 scripts/rename-channel.py \
--id 1234567890 \
--old-name old-name \
--new-name new-name
工作流程
- 1. 运行重命名脚本:
bash
python3 scripts/rename-channel.py \
--id <频道ID> \
--old-name <旧名称> \
--new-name <新名称> \
[--workspace <工作区目录>]
- 2. 如果需要更新systemPrompt,应用网关配置(脚本会显示)
- 3. 提交工作区文件更改(如果使用了--workspace)
带工作区搜索
bash
python3 scripts/rename-channel.py \
--id 1234567890 \
--old-name old-name \
--new-name new-name \
--workspace $HOME/my-workspace
这将:
- - 通过API重命名Discord频道
- 更新网关配置systemPrompt
- 搜索并更新工作区文件
- 报告已更改的文件以便git提交
完整的多代理设置
从头开始的完整工作流程:
bash
1. 创建Discord频道
python3 scripts/setup-channel.py \
--name research \
--context 深度研究和竞争分析 \
--category-id 1234567890
(记下输出中的频道ID)
2. 应用频道的网关配置
openclaw gateway config.patch --raw {channels: {...}}
3. 创建绑定到该频道的代理
scripts/create-agent.sh \
--name Watson \
--id watson \
--emoji 🔬 \
--specialty 深度研究和竞争分析 \
--model anthropic/claude-opus-4-5 \
--workspace $HOME/agents/watson \
--discord-channel 1234567890
完成!代理已创建并绑定到频道
配置
Discord分类ID
选项1:命令行
bash
python3 scripts/setup-channel.py \
--name channel-name \
--context 用途 \
--category-id 1234567890
选项2:环境变量
bash
export DISCORDCATEGORYID=1234567890
python3 scripts/setup-channel.py --name channel-name --context 用途
查找Discord ID
启用开发者模式:
复制ID:
- - 右键点击频道 → 复制ID
- 右键点击分类 → 复制ID
脚本参考
create-agent.sh
参数:
- - --name(必需)- 代理名称
- --id(必需