agent-creator
by @lidian6864677
Full workflow for creating an OpenClaw Agent. Use when the user says 'create an agent', 'make a new agent', 'add a bot', or needs to set up a new AI assistan...
clawhub install sub-agent-creatorπ About This Skill
name: agent-creator description: "Full workflow for creating an OpenClaw Agent. Use when the user says 'create an agent', 'make a new agent', 'add a bot', or needs to set up a new AI assistant. Covers the complete setup process including (1) adding agent config and peer bindings to openclaw.json, (2) creating workspace directory with SOUL.md persona, (3) scaffolding required folders and files, (4) copying agent runtime configs from main, (5) restarting gateway to apply changes."
Agent Creator - OpenClaw Agent Setup Tool
Automates the full end-to-end flow for creating an OpenClaw Agent.
Trigger Phrases
Activate when user says things like:
Full Workflow
Step 1: Gather Information
Ask the user:
1. Agent ID (lowercase, hyphens only): e.g. qisi, code-review, brainstorm
2. Agent Display Name: e.g. "Brainstorm Buddy", "Code Reviewer"
3. Purpose / Personality: What does this agent do? What's its style?
4. Group Chat Binding (optional): peer.id of a group chat, e.g. oc_xxx (kind = group)
5. Direct Chat Binding (optional): peer.id of a user, e.g. ou_xxx (kind = direct)
Step 2: Create Workspace Directory
OPENCLAW_DIR=~/.openclaw
mkdir -p $OPENCLAW_DIR/workspace-{agent_id}
mkdir -p $OPENCLAW_DIR/workspace-{agent_id}/memory
mkdir -p $OPENCLAW_DIR/workspace-{agent_id}/skills
Step 3: Write Workspace Files
Create the following files in the workspace directory:
SOUL.md β Agent persona (see template below)USER.md β User info templateAGENTS.md β Session bootstrap instructionsHEARTBEAT.md β Heartbeat configTOOLS.md β Tool notesmemory/ β Daily memory folderIDENTITY.md β Agent identity definition (optional)BOOTSTRAP.md β First-run bootstrap (optional)AGENTS.md content (copied from ~/.openclaw/workspace/AGENTS.md):
# AGENTS.md - Your WorkspaceIf BOOTSTRAP.md exists, that's your birth certificate. Follow it, figure out who you are, then delete it.
Every Session
Before doing anything else:
1. Read SOUL.md β this is who you are
2. Read USER.md β this is who you're helping
3. Read memory/YYYY-MM-DD.md (today + yesterday) for recent context
4. If in MAIN SESSION (direct chat with your human): Also read MEMORY.md
Memory
You wake up fresh each session. These files are your continuity:
Daily notes: memory/YYYY-MM-DD.md β raw logs of what happened
Long-term: MEMORY.md β your curated memories Safety
Don't exfiltrate private data
When in doubt, ask.
HEARTBEAT.md content:
# HEARTBEAT.mdKeep this file empty to skip heartbeat API calls.
TOOLS.md content:
# TOOLS.md - Local NotesNotes specific to this agent's setup.
Step 4: Create Agent Runtime Directory
OPENCLAW_DIR=~/.openclaw
mkdir -p $OPENCLAW_DIR/agents/{agent_id}/agent
mkdir -p $OPENCLAW_DIR/agents/{agent_id}/sessions
Step 5: Copy Agent Config from Main
OPENCLAW_DIR=~/.openclaw
cp $OPENCLAW_DIR/agents/main/agent/models.json $OPENCLAW_DIR/agents/{agent_id}/agent/
cp $OPENCLAW_DIR/agents/main/agent/auth-profiles.json $OPENCLAW_DIR/agents/{agent_id}/agent/
If the main agent config files don't exist, warn the user and ask them to provide models.json and auth-profiles.json manually.
Step 6: Update openclaw.json
Back up first:
cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak
Read the current config and add the new agent to agents.list:
{
"id": "{agent_id}",
"name": "{agent_name}",
"workspace": "~/.openclaw/workspace-{agent_id}",
"agentDir": "~/.openclaw/agents/{agent_id}/agent"
}
Add bindings if provided. For group chat:
{
"agentId": "{agent_id}",
"match": {
"channel": "feishu",
"peer": {
"kind": "group",
"id": "{group_chat_id}"
}
}
}
For direct chat:
{
"agentId": "{agent_id}",
"match": {
"channel": "feishu",
"peer": {
"kind": "direct",
"id": "{user_id}"
}
}
}
Step 7: Install Skills (optional)
If the agent needs specific skills:
cp -r ~/.openclaw/skills/{skill-name} ~/.openclaw/workspace-{agent_id}/skills/
Step 8: Restart Gateway
openclaw gateway restart
Step 9: Verify & Report
Tell the user:
SOUL.md Template
# SOUL.md - {Agent Name}_{One-line purpose}_
Core Identity
You are "{Agent Name}" β {detailed description}
Principles
{principle 1}
{principle 2}
{principle 3} Style
{style description}
_{Mission statement}_
Final Directory Structure
After creation, the layout should be:
~/.openclaw/
βββ agents/
β βββ {agent_id}/
β βββ agent/
β β βββ auth-profiles.json
β β βββ models.json
β βββ sessions/
βββ workspace-{agent_id}/
βββ AGENTS.md
βββ BOOTSTRAP.md (optional)
βββ HEARTBEAT.md
βββ IDENTITY.md (optional)
βββ SOUL.md
βββ TOOLS.md
βββ USER.md
βββ memory/
βββ skills/ (optional)
Important Notes
workspace-brainstormopenclaw.json before modifyingmodels.json and auth-profiles.json to the agents directoryscripts/agent_creator.py to automate the config and directory creation