Agent Create + Dedicated Telegram Group
Create one dedicated Telegram group per agent, bind the agent to that group, and set an isolated workspace path.
Script-first Rule
Prefer bundled scripts for deterministic steps (more stable + lower token cost). Only do manual JSON editing when scripts cannot cover a special case.
Use:
scripts/provision_config.py for agent/config/binding/no-mention setup (with automatic backup of openclaw.json)
scripts/init_workspace.py for USER.md / IDENTITY.md / SOUL.md initialization
Access Scope
This skill accesses the following files on the host:
~/.openclaw/openclaw.json — read (model discovery) and write (agent binding)
~/.openclaw/cron/jobs.json — read-only (for job listing if needed)
~/claw-<agent-name>/ — workspace directory created by script
~/.openclaw/agents/<agent-id>/agent/ — directory created (no auth files copied)
Config Safety
scripts/provision_config.py reads and writes ~/.openclaw/openclaw.json.
- By default it creates a backup file:
~/.openclaw/openclaw.json.bak.<timestamp>.
- It updates only:
agents.list (add/update target agent) — does NOT copy auth credentials
bindings (add target telegram group binding)
channels.telegram.groups.<chat_id>.requireMention=false
gateway.reload.mode only if missing (sets default hybrid)
- The skill does NOT propagate API keys or auth tokens between agents.
- Gateway-level auth is inherited automatically; do not manually copy auth files.
Inputs
Collect (before executing):
agent_name (required)
model (required): ask user explicitly which model to use; model options must be read live from the user’s ~/.openclaw/openclaw.json (do not hardcode examples)
- Optional
telegram_group_title override (custom group name)
- Initialization preferences (required ask):
- whether to create/update
USER.md
- whether to create/update
IDENTITY.md
- whether to create/update
SOUL.md
- If initialization is enabled, collect content fields before writing files:
USER.md: user name / preferred call name / language / goals / notes
IDENTITY.md: agent display name / vibe / emoji (optional)
SOUL.md: role/mission / tone / constraints (short bullet points)
Normalize agent_name:
- Keep lowercase letters, digits, and hyphens only.
- Replace spaces/underscores with
-.
- Use this value in paths and IDs.
Telegram group title rule:
- If user provides
telegram_group_title, use it directly.
- If not provided, generate default title from agent name in PascalCase.
- Example:
test-skill -> TestSkill, bilingual-agent -> BilingualAgent.
Workflow
- Read available models from
~/.openclaw/openclaw.json first, then confirm inputs with user (agent name, model, init-file preferences, optional telegram group title).
- Build workspace path as
~/claw-<agent-name> and create it if missing.
- Resolve group title:
- custom
telegram_group_title if provided
- otherwise PascalCase(agent_name)
- Create and bind Telegram group (use resolved group title):
- use browser automation/user-account flow (Telegram bot API cannot reliably create groups)
- CONFIRM with user before triggering browser automation (explicit yes/no required)
- if browser automation is unavailable, request the minimal manual steps and resume
- Create/update OpenClaw config via script (preferred):
- CONFIRM with user before modifying openclaw.json (explicit yes/no required)
python3 scripts/provision_config.py --agent-name <agent_name> --model <model> --chat-id <chat_id>
- this sets: agent entry, workspace, binding, and
requireMention=false
- Apply config and activate it:
- if hot reload is enabled, verify reload logs show applied changes
- if reload is off or not applied, CONFIRM with user before restarting gateway (explicit yes/no required)
- restart gateway only after user approval
- Bootstrap agent runtime files (required for first-run stability):
- ensure
~/.openclaw/agents/<agent-id>/agent exists
- do NOT copy any auth files from other agents (this prevents credential/API key propagation)
- new agents inherit authentication from the gateway's shared auth context automatically
- do NOT manually copy or create auth-profiles.json, auth.json, or models.json
- If initialization is requested, ask user for file content fields first, then write files:
- collect required values for
USER.md / IDENTITY.md / SOUL.md
- then run:
python3 scripts/init_workspace.py --workspace <workspace> --agent-name <agent_name> [--with-user] [--with-identity] [--with-soul]
- if user provided custom text, apply it after script initialization (overwrite placeholders)
- Ensure routing validity for current schema (no invalid allowFrom entries for groups).
- Post-provision verification:
- send a test message in group and ask user to send
ping
- confirm agent responds without
@mention
- Return completion summary with:
- agent name
- model
- workspace path
- group title
- chat_id
- no-mention reply mode (
enabled/disabled)
- status and next step (if any)
Telegram Automation Rules
- Group creation/deletion and member operations should use browser automation (user-account flow).
- For browser flow, prefer Chrome relay profile for existing logged-in Telegram sessions.
- If no connected Chrome tab is available, ask user to attach once, then continue.
- If Telegram shows confirmation/captcha that cannot be automated, request one manual click, then resume.
OpenClaw Command Discovery
Do not invent OpenClaw commands.
When agent create/update command syntax is unknown:
- Run
openclaw help.
- If needed, run
openclaw <subcommand> --help for the relevant subcommand.
- Use only discovered command forms.
Idempotency
- If
~/claw-<agent-name> already exists, reuse it.
- If a same-name group already exists, confirm whether to reuse or create a fresh one.
- If agent already exists, update model/binding/workdir instead of duplicating.
Reliability Checks (must do)
- Verify
requireMention=false for the bound group.
- Verify gateway config actually applied:
- check reload mode/status logs (
config hot reload applied, restarting telegram channel)
- if reload is
off or not applied, restart gateway and re-check logs.
- Send one bot-originated test message to the new group, then require one live user
ping.
- Verify agent replies without
@mention.
- Do not claim success before
ping -> pong verification passes.
Failure Handling
If group creation succeeds but binding fails:
- Keep created group.
- Report exact failed step.
- Provide one-command resume instruction for the next run.
If chat_id cannot be resolved automatically:
- Report that as a partial success.
- Provide the shortest fallback step to fetch chat_id, then continue binding.
Output Template
Return concise status:
agent:
model:
workspace: ~/claw-<agent-name>
telegram_group:
chat_id:
binding: <done|pending>
reply_without_mention: <enabled|disabled>
initialized_files: <USER.md, IDENTITY.md, SOUL.md or subset>
verification: <passed|failed>
next_step:
1---
2name: create-agent-with-telegram-group
3description: "Create a new OpenClaw agent and bind it to a dedicated Telegram
4 group with workspace ~/claw-<agent-name>. Use when the user asks for
5 one-agent-one-group setup, Telegram group binding, or repeatable agent
6 provisioning. Always ask which model to use, ask for essential initialization
7 choices (USER.md/IDENTITY.md/SOUL.md), and set group reply mode to
8 no-mention-required. Explicit user confirmation is required before any
9 high-privilege actions: modifying openclaw.json, triggering browser
10 automation, or restarting the gateway."
11metadata:
12 source: https://skillmd.com/skills/modbender/create-agent-with-telegram-group
13---
14
15
16# Agent Create + Dedicated Telegram Group
17
18Create one dedicated Telegram group per agent, bind the agent to that group, and set an isolated workspace path.
19
20## Script-first Rule
21
22Prefer bundled scripts for deterministic steps (more stable + lower token cost). Only do manual JSON editing when scripts cannot cover a special case.
23
24Use:
25- `scripts/provision_config.py` for agent/config/binding/no-mention setup (with automatic backup of `openclaw.json`)
26- `scripts/init_workspace.py` for `USER.md` / `IDENTITY.md` / `SOUL.md` initialization
27
28## Access Scope
29
30This skill accesses the following files on the host:
31- `~/.openclaw/openclaw.json` — read (model discovery) and write (agent binding)
32- `~/.openclaw/cron/jobs.json` — read-only (for job listing if needed)
33- `~/claw-<agent-name>/` — workspace directory created by script
34- `~/.openclaw/agents/<agent-id>/agent/` — directory created (no auth files copied)
35
36## Config Safety
37
38- `scripts/provision_config.py` reads and writes `~/.openclaw/openclaw.json`.
39- By default it creates a backup file: `~/.openclaw/openclaw.json.bak.<timestamp>`.
40- It updates only:
41 - `agents.list` (add/update target agent) — does NOT copy auth credentials
42 - `bindings` (add target telegram group binding)
43 - `channels.telegram.groups.<chat_id>.requireMention=false`
44 - `gateway.reload.mode` only if missing (sets default `hybrid`)
45- The skill does NOT propagate API keys or auth tokens between agents.
46- Gateway-level auth is inherited automatically; do not manually copy auth files.
47
48## Inputs
49
50Collect (before executing):
51- `agent_name` (required)
52- `model` (required): ask user explicitly which model to use; model options must be read live from the user’s `~/.openclaw/openclaw.json` (do not hardcode examples)
53- Optional `telegram_group_title` override (custom group name)
54- Initialization preferences (required ask):
55 - whether to create/update `USER.md`
56 - whether to create/update `IDENTITY.md`
57 - whether to create/update `SOUL.md`
58- If initialization is enabled, collect content fields before writing files:
59 - `USER.md`: user name / preferred call name / language / goals / notes
60 - `IDENTITY.md`: agent display name / vibe / emoji (optional)
61 - `SOUL.md`: role/mission / tone / constraints (short bullet points)
62
63Normalize `agent_name`:
64- Keep lowercase letters, digits, and hyphens only.
65- Replace spaces/underscores with `-`.
66- Use this value in paths and IDs.
67
68Telegram group title rule:
69- If user provides `telegram_group_title`, use it directly.
70- If not provided, generate default title from agent name in PascalCase.
71 - Example: `test-skill` -> `TestSkill`, `bilingual-agent` -> `BilingualAgent`.
72
73## Workflow
74
751. Read available models from `~/.openclaw/openclaw.json` first, then confirm inputs with user (agent name, model, init-file preferences, optional telegram group title).
762. Build workspace path as `~/claw-<agent-name>` and create it if missing.
773. Resolve group title:
78 - custom `telegram_group_title` if provided
79 - otherwise PascalCase(agent_name)
804. Create and bind Telegram group (use resolved group title):
81 - use browser automation/user-account flow (Telegram bot API cannot reliably create groups)
82 - **CONFIRM with user before triggering browser automation** (explicit yes/no required)
83 - if browser automation is unavailable, request the minimal manual steps and resume
845. Create/update OpenClaw config via script (preferred):
85 - **CONFIRM with user before modifying openclaw.json** (explicit yes/no required)
86 - `python3 scripts/provision_config.py --agent-name <agent_name> --model <model> --chat-id <chat_id>`
87 - this sets: agent entry, workspace, binding, and `requireMention=false`
886. Apply config and activate it:
89 - if hot reload is enabled, verify reload logs show applied changes
90 - if reload is off or not applied, **CONFIRM with user before restarting gateway** (explicit yes/no required)
91 - restart gateway only after user approval
927. Bootstrap agent runtime files (required for first-run stability):
93 - ensure `~/.openclaw/agents/<agent-id>/agent` exists
94 - do NOT copy any auth files from other agents (this prevents credential/API key propagation)
95 - new agents inherit authentication from the gateway's shared auth context automatically
96 - do NOT manually copy or create auth-profiles.json, auth.json, or models.json
978. If initialization is requested, ask user for file content fields first, then write files:
98 - collect required values for `USER.md` / `IDENTITY.md` / `SOUL.md`
99 - then run: `python3 scripts/init_workspace.py --workspace <workspace> --agent-name <agent_name> [--with-user] [--with-identity] [--with-soul]`
100 - if user provided custom text, apply it after script initialization (overwrite placeholders)
1019. Ensure routing validity for current schema (no invalid allowFrom entries for groups).
10210. Post-provision verification:
103 - send a test message in group and ask user to send `ping`
104 - confirm agent responds without `@mention`
10511. Return completion summary with:
106 - agent name
107 - model
108 - workspace path
109 - group title
110 - chat_id
111 - no-mention reply mode (`enabled`/`disabled`)
112 - status and next step (if any)
113
114## Telegram Automation Rules
115
116- Group creation/deletion and member operations should use browser automation (user-account flow).
117- For browser flow, prefer Chrome relay profile for existing logged-in Telegram sessions.
118- If no connected Chrome tab is available, ask user to attach once, then continue.
119- If Telegram shows confirmation/captcha that cannot be automated, request one manual click, then resume.
120
121## OpenClaw Command Discovery
122
123Do not invent OpenClaw commands.
124
125When agent create/update command syntax is unknown:
1261. Run `openclaw help`.
1272. If needed, run `openclaw <subcommand> --help` for the relevant subcommand.
1283. Use only discovered command forms.
129
130## Idempotency
131
132- If `~/claw-<agent-name>` already exists, reuse it.
133- If a same-name group already exists, confirm whether to reuse or create a fresh one.
134- If agent already exists, update model/binding/workdir instead of duplicating.
135
136## Reliability Checks (must do)
137
138- Verify `requireMention=false` for the bound group.
139- Verify gateway config actually applied:
140 - check reload mode/status logs (`config hot reload applied`, `restarting telegram channel`)
141 - if reload is `off` or not applied, restart gateway and re-check logs.
142- Send one bot-originated test message to the new group, then require one live user `ping`.
143- Verify agent replies without `@mention`.
144- Do not claim success before `ping -> pong` verification passes.
145
146## Failure Handling
147
148If group creation succeeds but binding fails:
149- Keep created group.
150- Report exact failed step.
151- Provide one-command resume instruction for the next run.
152
153If chat_id cannot be resolved automatically:
154- Report that as a partial success.
155- Provide the shortest fallback step to fetch chat_id, then continue binding.
156
157## Output Template
158
159Return concise status:
160
161- `agent`: <agent-name>
162- `model`: <selected-model>
163- `workspace`: `~/claw-<agent-name>`
164- `telegram_group`: <title>
165- `chat_id`: <id or PENDING>
166- `binding`: <done|pending>
167- `reply_without_mention`: <enabled|disabled>
168- `initialized_files`: <USER.md, IDENTITY.md, SOUL.md or subset>
169- `verification`: <passed|failed>
170- `next_step`: <none or exact minimal action>