🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

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...

Versionv1.0.1
Downloads697
Stars⭐ 1
TERMINAL
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:

  • "Create an agent"
  • "Make a new bot"
  • "Set up a new agent"
  • "Add an AI assistant"
  • 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 template
  • AGENTS.md β€” Session bootstrap instructions
  • HEARTBEAT.md β€” Heartbeat config
  • TOOLS.md β€” Tool notes
  • memory/ β€” Daily memory folder
  • IDENTITY.md β€” Agent identity definition (optional)
  • BOOTSTRAP.md β€” First-run bootstrap (optional)
  • AGENTS.md content (copied from ~/.openclaw/workspace/AGENTS.md):

    # AGENTS.md - Your Workspace

    If 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.md

    Keep this file empty to skip heartbeat API calls.

    TOOLS.md content:

    # TOOLS.md - Local Notes

    Notes 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:

  • Agent has been created successfully
  • How to interact with it (@ in group chat, or DM)
  • How to customize it further (edit SOUL.md, add skills, etc.)
  • 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 directory name should use the agent_id (English lowercase + hyphens), e.g. workspace-brainstorm
  • Agent ID must be lowercase alphanumeric with hyphens only
  • Group chat binding requires the bot to be manually added to the group (auto-join needs extra permissions)
  • Always back up openclaw.json before modifying
  • Always copy models.json and auth-profiles.json to the agents directory
  • Use the helper script scripts/agent_creator.py to automate the config and directory creation