op7418/claude-to-im-skill52 files

Claude To Im

|

Specification
Skill ID
op7418/claude-to-im-skill/claude-to-im
Publisher
op7418
Repository
claude-to-im-skill
Installs
0
Files
52
Synced
Sep 23, 2026
How to use it

Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.

op7418/claude-to-im-skill/claude-to-imInstalls these files
  • .gitignore
  • CLAUDE.md
  • LICENSE
  • README.md
  • README_CN.md
  • SECURITY.md
  • SKILL.md
  • config.env.example
  • evals/evals.json
  • package-lock.json
  • package.json
  • references/setup-guides.md
  • references/token-validation.md
  • references/troubleshooting.md
  • references/usage.md
  • scripts/build.js
  • scripts/daemon.ps1
  • scripts/daemon.sh
  • scripts/doctor.sh
  • scripts/install-codex.sh
  • scripts/supervisor-linux.sh
  • scripts/supervisor-macos.sh
  • scripts/supervisor-windows.ps1
  • src/__tests__/codex-provider.test.ts
  • src/__tests__/config.test.ts
  • src/__tests__/llm-provider.test.ts
  • src/__tests__/logger.test.ts
  • src/__tests__/permission.test.ts
  • src/__tests__/store.test.ts
  • src/__tests__/weixin-adapter.test.ts
  • src/__tests__/weixin-api.test.ts
  • src/__tests__/weixin-login.test.ts
  • src/__tests__/weixin-media.test.ts
  • src/__tests__/weixin-store.test.ts
  • src/adapters/weixin-adapter.ts
  • src/adapters/weixin/weixin-api.ts
  • src/adapters/weixin/weixin-ids.ts
  • src/adapters/weixin/weixin-media.ts
  • src/adapters/weixin/weixin-session-guard.ts
  • src/adapters/weixin/weixin-types.ts
  • src/codex-provider.ts
  • src/config.ts
  • src/llm-provider.ts
  • src/logger.ts
  • src/main.ts
  • src/permission-gateway.ts
  • src/qrcode.d.ts
  • src/sse-utils.ts
  • src/store.ts
  • src/weixin-login.ts
  • src/weixin-store.ts
  • tsconfig.json

What this skill tells the agent

Claude-to-IM Bridge Skill

You are managing the Claude-to-IM bridge. User data is stored at ~/.claude-to-im/.

The skill directory (SKILL_DIR) is at ~/.claude/skills/claude-to-im. In Codex installs it may instead be ~/.codex/skills/Claude-to-IM-skill. If neither path exists, fall back to Glob with pattern **/skills/**/claude-to-im/SKILL.md or **/skills/**/Claude-to-IM-skill/SKILL.md and derive the root from the result.

Command parsing

Parse the user's intent from $ARGUMENTS into one of these subcommands:

User says (examples)Subcommand
setup, configure, 配置, 我想在飞书上用 Claude, 帮我连接 Telegram, 帮我接微信setup
start, start bridge, 启动, 启动桥接start
stop, stop bridge, 停止, 停止桥接stop
status, bridge status, 状态, 运行状态, 怎么看桥接的运行状态status
logs, logs 200, 查看日志, 查看日志 200logs
reconfigure, 修改配置, 帮我改一下 token, 换个 botreconfigure
doctor, diagnose, 诊断, 挂了, 没反应了, bot 没反应, 出问题了doctor

Disambiguation: `status` vs `doctor` — Use status when the user just wants to check if the bridge is running (informational). Use doctor when the user reports a problem or suspects something is broken (diagnostic). When in doubt and the user describes a symptom (e.g., "没反应了", "挂了"), prefer doctor.

Extract optional numeric argument for logs (default 50).

Before asking users for any platform credentials, read SKILL_DIR/references/setup-guides.md internally so you know where to find each credential. Do NOT dump the full guide to the user upfront — only mention the specific next step they need to do (e.g., "Go to https://open.feishu.cn → your app → Credentials to find the App ID"). If the user says they don't know how, then show the relevant section of the guide.

Runtime detection

Before executing any subcommand, detect which environment you are running in:

  1. Claude Code — AskUserQuestion tool is available. Use it for interactive setup wizards.
  2. Codex / other — AskUserQuestion is NOT available. Fall back to non-interactive guidance: explain the steps, show SKILL_DIR/config.env.example, and ask the user to create ~/.claude-to-im/config.env manually.

You can test this by checking if AskUserQuestion is in your available tools list.

Config check (applies to start, stop, status, logs, reconfigure, doctor)

Before running any subcommand other than setup, check if ~/.claude-to-im/config.env exists:

  • If it does NOT exist:
  • In Claude Code: tell the user "No configuration found" and automatically start the setup wizard using AskUserQuestion.
  • In Codex: tell the user "No configuration found. Please create ~/.claude-to-im/config.env based on the example:" then show the contents of SKILL_DIR/config.env.example and stop. Don't attempt to start the daemon — without config.env the process will crash on startup and leave behind a stale PID file that blocks future starts.
  • If it exists: proceed with the requested subcommand.

Subcommands

setup

Run an interactive setup wizard. This subcommand requires AskUserQuestion. If it is not available (Codex environment), instead show the contents of SKILL_DIR/config.env.example with field-by-field explanations and instruct the user to create the config file manually.

When AskUserQuestion IS available, collect input one field at a time. After each answer, confirm the value back to the user (masking secrets to last 4 chars only) before moving to the next question.

Step 1 — Choose channels

Ask which channels to enable (telegram, discord, feishu, qq, weixin). Accept comma-separated input. Briefly describe each:

  • telegram — Best for personal use. Streaming preview, inline permission buttons.
  • discord — Good for team use. Server/channel/user-level access control.
  • feishu (Lark) — For Feishu/Lark teams. Streaming cards, tool progress, inline permission buttons.
  • qq — QQ C2C private chat only. No inline permission buttons, no streaming preview. Permissions use text /perm ... commands.
  • weixin — WeChat QR login. Single linked account only; a new login replaces the previous one. No inline permission buttons, no streaming preview. Permissions use text /perm ... commands or quick 1/2/3 replies. Voice messages only use WeChat's own speech-to-text text; raw voice audio is not transcribed by the bridge.

Step 2 — Collect tokens per channel

For each enabled channel, collect one credential at a time. Tell the user where to find each value in one sentence. Only show the full guide section (from SKILL_DIR/references/setup-guides.md) if the user asks for help or says they don't know how:

  • Telegram: Bot Token → confirm (masked) → Chat ID (see guide for how to get it) → confirm → Allowed User IDs (optional). Important: At least one of Chat ID or Allowed User IDs must be set, otherwise the bot will reject all messages.
  • Discord: Bot Token → confirm (masked) → Allowed User IDs → Allowed Channel IDs (optional) → Allowed Guild IDs (optional). Important: At least one of Allowed User IDs or Allowed Channel IDs must be set, otherwise the bot will reject all messages (default-deny).
  • Feishu: App ID → confirm → App Secret → confirm (masked) → Domain (optional) → Allowed User IDs (optional). After collecting credentials, explain the two-phase setup the user must complete:
  • Phase 1 (before starting bridge): (A) batch-add permissions, (B) enable bot capability, (C) publish first version + admin approve. This makes permissions and bot effective.
  • Phase 2 (requires running bridge): (D) run /claude-to-im start, (E) configure events (im.message.receive_v1) and callback (card.action.trigger) with long connection mode, (F) publish second version + admin approve.
  • Why two phases: Feishu validates WebSocket connection when saving event subscription — if the bridge isn't running, saving will fail. The bridge needs published permissions to connect.
  • Keep this to a short checklist — show the full guide only if asked.
  • QQ: Collect two required fields, then optional ones:
  1. QQ App ID (required) → confirm
  2. QQ App Secret (required) → confirm (masked)
  • Tell the user: these two values can be found at https://q.qq.com/qqbot/openclaw
  1. Allowed User OpenIDs (optional, press Enter to skip) — note: this is user_openid, NOT QQ number. If the user doesn't have openid yet, they can leave it empty.
  2. Image Enabled (optional, default true, press Enter to skip) — if the underlying provider doesn't support image input, set to false
  3. Max Image Size MB (optional, default 20, press Enter to skip)
  • Remind user: QQ first version only supports C2C private chat sandbox access. No group/channel support, no inline buttons, no streaming preview.
  • Weixin: Do not ask for a static token. Instead:
  1. Tell the user this channel uses QR login, not manual credential entry.
  2. Run cd SKILL_DIR && npm run weixin:login
  3. The helper writes ~/.claude-to-im/runtime/weixin-login.html and tries to open it automatically in the local browser.
  4. If auto-open fails, tell the user to open that HTML file manually and scan the QR code with WeChat.
  5. Wait for the helper to report success, then confirm that the linked account was saved locally.
  • Explain briefly: the linked Weixin account is stored in ~/.claude-to-im/data/weixin-accounts.json. Running the helper again replaces the previously linked account.
  • Explain briefly: CTI_WEIXIN_MEDIA_ENABLED only controls inbound image/file/video downloads. For voice messages, the bridge only accepts the text returned by WeChat's built-in speech-to-text. If WeChat does not provide a transcript, the bridge replies with an error instead of downloading/transcribing raw audio.

Step 3 — General settings

Ask for runtime, default working directory, model, and mode:

  • Runtime: claude (default), codex, auto

Use this skill in a project

Open any RiverX project, search the Skills panel for op7418/claude-to-im-skill/claude-to-im, and install it in one click.

Use this skill