SkillHub

create-agent-with-telegram-group

v0.1.5

Create a new OpenClaw agent and bind it to a dedicated Telegram group with workspace ~/claw-. Use when the user asks for one-agent-one-group setup, Telegram group binding, or repeatable agent provisioning. Always ask which model to use, ask for essential initialization choices (USER.md/I...

Sourced from ClawHub, Authored by Sheeta

Installation

Please help me install the skill `create-agent-with-telegram-group` from SkillHub official store. npx skills add Sheetaa/create-agent-with-telegram-group

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

  1. Read available models from ~/.openclaw/openclaw.json first, then confirm inputs with user (agent name, model, init-file preferences, optional telegram group title).
  2. Build workspace path as ~/claw-<agent-name> and create it if missing.
  3. Resolve group title:
  4. custom telegram_group_title if provided
  5. otherwise PascalCase(agent_name)
  6. Create and bind Telegram group (use resolved group title):
  7. use browser automation/user-account flow (Telegram bot API cannot reliably create groups)
  8. CONFIRM with user before triggering browser automation (explicit yes/no required)
  9. if browser automation is unavailable, request the minimal manual steps and resume
  10. Create/update OpenClaw config via script (preferred):
  11. CONFIRM with user before modifying openclaw.json (explicit yes/no required)
  12. python3 scripts/provision_config.py --agent-name <agent_name> --model <model> --chat-id <chat_id>
  13. this sets: agent entry, workspace, binding, and requireMention=false
  14. Apply config and activate it:
  15. if hot reload is enabled, verify reload logs show applied changes
  16. if reload is off or not applied, CONFIRM with user before restarting gateway (explicit yes/no required)
  17. restart gateway only after user approval
  18. Bootstrap agent runtime files (required for first-run stability):
  19. ensure ~/.openclaw/agents/<agent-id>/agent exists
  20. do NOT copy any auth files from other agents (this prevents credential/API key propagation)
  21. new agents inherit authentication from the gateway's shared auth context automatically
  22. do NOT manually copy or create auth-profiles.json, auth.json, or models.json
  23. If initialization is requested, ask user for file content fields first, then write files:
  24. collect required values for USER.md / IDENTITY.md / SOUL.md
  25. then run: python3 scripts/init_workspace.py --workspace <workspace> --agent-name <agent_name> [--with-user] [--with-identity] [--with-soul]
  26. if user provided custom text, apply it after script initialization (overwrite placeholders)
  27. Ensure routing validity for current schema (no invalid allowFrom entries for groups).
  28. Post-provision verification:
  29. send a test message in group and ask user to send ping
  30. confirm agent responds without @mention
  31. Return completion summary with:
  32. agent name
  33. model
  34. workspace path
  35. group title
  36. chat_id
  37. no-mention reply mode (enabled/disabled)
  38. 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: 1. Run openclaw help. 2. If needed, run openclaw <subcommand> --help for the relevant subcommand. 3. 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: </li> <li><code>chat_id</code>: <id or PENDING></li> <li><code>binding</code>: <done|pending></li> <li><code>reply_without_mention</code>: <enabled|disabled></li> <li><code>initialized_files</code>: <USER.md, IDENTITY.md, SOUL.md or subset></li> <li><code>verification</code>: <passed|failed></li> <li><code>next_step</code>: <none or exact minimal action></li> </ul> </div> </div> <!-- Right: Sidebar --> <aside class="space-y-6"> <!-- Popularity --> <div class="bg-gray-900 border border-gray-800 rounded-2xl p-6 shadow-sm"> <h3 class="text-[10px] font-black text-gray-500 uppercase tracking-widest mb-5">Popularity</h3> <div class="flex items-end gap-2 mb-6"> <span class="text-4xl font-black text-white leading-none">0</span> <span class="text-gray-500 text-[10px] font-bold uppercase mb-1">Stars</span> </div> <div class="grid grid-cols-2 gap-3 mb-6"> <div class="bg-gray-950 p-4 rounded-xl border border-gray-800 text-center"> <div class="text-gray-600 text-[10px] font-bold uppercase mb-1">DLs</div> <div class="text-white font-bold text-base">414</div> </div> <div class="bg-gray-950 p-4 rounded-xl border border-gray-800 text-center"> <div class="text-gray-600 text-[10px] font-bold uppercase mb-1">Installs</div> <div class="text-white font-bold text-base">1</div> </div> </div> <!-- View Repository: 恢复原文字,去掉图标,保持深色紧凑风格 --> <a href="https://clawhub.ai/Sheetaa/create-agent-with-telegram-group" target="_blank" class="block text-center border border-gray-700 bg-gray-800 text-gray-200 py-3 rounded-xl font-bold hover:bg-gray-700 transition-all uppercase text-[10px] tracking-widest"> View Repository </a> </div> <!-- AI Security --> <div class="bg-gray-900 border border-gray-800 rounded-2xl p-6 relative overflow-hidden"> <div class="absolute -top-10 -right-10 w-24 h-24 bg-green-500/10 rounded-full blur-2xl opacity-40"></div> <h3 class="text-[10px] font-black text-gray-500 uppercase tracking-widest mb-5 relative z-10">AI Security</h3> <div class="flex items-center gap-5 relative z-10"> <div class="w-14 h-14 rounded-full border-2 border-green-500 flex items-center justify-center text-green-500 text-xl font-black bg-gray-950 shadow-inner">98</div> <div class="flex-1"> <div class="text-white font-bold text-xs uppercase tracking-tight">None</div> <div class="text-[9px] text-gray-600 italic">Audited by AI Guard</div> </div> </div> </div> <!-- Download --> <a href="https://wry-manatee-359.convex.site/api/v1/download?slug=create-agent-with-telegram-group" class="flex items-center justify-center gap-2 w-full border border-blue-500/40 text-blue-400 py-3.5 rounded-xl font-bold hover:bg-blue-500/10 transition-all uppercase text-[10px] tracking-widest"> <i class="fa-solid fa-cloud-arrow-down"></i> Download ZIP </a> </aside> </div> </main> <!-- Footer --> <footer class="border-t border-gray-800 bg-gray-950 mt-20 py-12 text-center"> <div class="container mx-auto px-4"> <div class="flex justify-center gap-6 mb-6 text-gray-500"> <a href="#" class="hover:text-white transition-colors text-lg"><i class="fa-brands fa-discord"></i></a> <a href="#" class="hover:text-white transition-colors text-lg"><i class="fa-brands fa-x-twitter"></i></a> </div> <p class="text-gray-500 text-[10px] font-bold uppercase tracking-widest mb-2">© 2026 AI Skills Hub</p> <p class="text-gray-700 text-[9px] uppercase tracking-[0.2em]">Verified Metadata Repository</p> </div> </footer> </body> </html>