Create a new isolated OpenClaw agent and configure it (identity + role + task) in its workspace.
Then pick an agent-name based on the purpose. Prefer short, stable ids like:
beauty, coding, support, ops, research, personalNotes:
-). The id cannot be main (reserved).~/.openclaw/workspace-.Use the exec tool to run the OpenClaw CLI. Non-interactive creation requires --workspace and --non-interactive.
Before creating, check whether it already exists:
openclaw agents list --json
Before running creation, explicitly ask for confirmation, for example:
I am ready to run: openclaw agents add --workspace ~/.openclaw/workspace- --non-interactive --json. Run it now? Only execute the command after the user confirms.
Create the agent:
openclaw agents add <agent-name> --workspace ~/.openclaw/workspace-<agent-id> --non-interactive --json
Optional flags you can add when needed:
--model – default model for this agent.--agent-dir – agent state dir (default: ~/.openclaw/agents//agent ).--bind – route a channel to this agent (repeatable).Edit the new workspace file:
~/.openclaw/workspace-/IDENTITY.md The top section is a template with identity key-value lines (examples):
name: My Agentemoji: 🦞theme: short themeavatar: path/or/urlSupported keys: name, emoji, theme, creature, vibe, avatar.
Hard rule (IDENTITY.md):
- Name: ... style lines / key-value fields).--- separator.---, add a blank line and then a --- line at the end, and append your description after it.edit for targeted append/update; use write only when edit cannot be applied reliably (for example file missing or malformed beyond safe patching).Short example (append style):
... (keep/update existing identity fields)
---
我负责:根据肤质/预算/场景给出 2-3 个可选方案,并说明优缺点与使用顺序。
After editing, sync to config via exec:
openclaw agents set-identity --workspace ~/.openclaw/workspace-<agent-id> --from-identity --json
Edit the new workspace file:
~/.openclaw/workspace-/AGENTS.md Put task definition and operating rules here (how to work), based on what the user told you in step 0. Examples of good content:
Hard rule (AGENTS.md):
--- separator.---, add a blank line + --- near the end, then append your custom section after it.edit for targeted append/update; use write only when edit cannot be applied reliably (for example file missing or malformed beyond safe patching).Short example (append style):
... (keep default template unchanged)
---
## 美妆助手工作规范
- 先问:肤质/预算/诉求/过敏史
- 再给:2-3 个方案 + 优缺点 + 价格区间
- 禁止:假装亲测;推荐三无/杂牌
If you also want a stable persona/tone/boundary file, place that in SOUL.md too, but keep the core “how to operate” rules in AGENTS.md.
(short, stable; will normalize to ).openclaw agents add --workspace ~/.openclaw/workspace- --non-interactive --json ~/.openclaw/workspace-/IDENTITY.md openclaw agents set-identity --workspace ~/.openclaw/workspace- --from-identity --json ~/.openclaw/workspace-/AGENTS.md with the role/task/rules.openclaw agents add, openclaw agents set-identity, openclaw agents bind in agents CLI.共 1 个版本