Agent Skillsdtyq/magic › im-channels

im-channels

GitHub

处理IM渠道(微信、钉钉等)消息解析与Bot连接配置。解析<im>元数据及媒体文件,指导凭据收集与SDK连接,支持状态检查。

backend/super-magic/agents/skills/im-channels/SKILL.md dtyq/magic

Trigger Scenarios

用户发送包含<im>块的消息 需要连接或配置IM Bot

Install

npx skills add dtyq/magic --skill im-channels -g -y
More Options

Non-standard path

npx skills add https://github.com/dtyq/magic/tree/master/backend/super-magic/agents/skills/im-channels -g -y

Use without installing

npx skills use dtyq/magic@im-channels

指定 Agent (Claude Code)

npx skills add dtyq/magic --skill im-channels -a claude-code -g -y

安装 repo 全部 skill

npx skills add dtyq/magic --all -g -y

预览 repo 内 skill

npx skills add dtyq/magic --list

SKILL.md

Frontmatter
{
    "name": "im-channels",
    "description": "Use when connecting or configuring IM channel bots (WeChat, WeCom, DingTalk, Lark), or when you receive a user message that contains an <im> block indicating it was sent from an IM channel — read this skill to understand what the context means and how to handle it correctly."
}

IM Channels

This skill covers two scenarios: connecting an IM bot, and understanding incoming messages from IM channels.


Scenario A: Incoming Message from an IM Channel

When a user message includes an <im> block at the end, the message was relayed from an IM platform. The block looks like this:

<!-- Text-only message -->
<im source="DingTalk" />

<!-- Message with media attachments -->
<im source="WeChat">
  <media>
    <file type="image" mime="image/jpeg" path="workspace/media/photo_001.jpg" />
    <file type="voice" mime="audio/silk" path="workspace/media/voice_001.silk" />
    <file type="image" mime="image/jpeg" path="workspace/media/photo_002.jpg" from="quoted" />
  </media>
</im>

What each field means

  • source: the IM platform — WeChat, WeCom, DingTalk, or Lark
  • <file>: a file already downloaded into the workspace; use its path directly
  • type: media category — image, voice, video, file, etc.
  • mime: MIME type of the file
  • from="quoted": the file came from a message the user was replying to, not their current message

How to respond

  • Treat the user's text as the primary intent; the <im> block is metadata only
  • For media files, read or process them using the path value — no download needed, files are already in the workspace
  • Reply naturally; the IM platform handles formatting on delivery
  • Only the final reply is visible to the user. IM channels replace intermediate content with the last message — do not rely on the user seeing earlier streamed output. Compose a complete, self-contained answer. This applies only to replies relayed back through an IM channel, not to Scenario B below

Scenario B: Connecting an IM Bot

Connect the current Agent to an IM platform so it can receive and send messages in the target app.

Step 1 — Confirm the channel

If the user did not specify one, ask which IM platform they want: WeChat, WeCom, DingTalk, or Lark.

Step 2 — Read the reference

Load the matching reference file for credentials and exact steps:

WeChat and WeCom are completely separate platforms. Do not mix them up. WeChat uses QR authorization and does not require bot_id or secret.

Step 3 — Collect credentials and connect

Follow the instructions in the reference file. Run the run_sdk_snippet code to establish the connection.

Step 4 — Report the result

If the connection succeeds, tell the user what to do next. If it fails, return the error and guide the next step.

Check Status

To inspect the current configuration and connection state of all IM channels, run:

from sdk.tool import tool

result = tool.call("get_im_channel_status", {})
print(result.content)

Notes

  • After a connection is established, it keeps running in the background. Credentials are saved to .magic/config/im-channels.json and bound to the current sandbox. Restarting the same sandbox process should auto-reconnect without asking for setup again.
  • To disable auto-reconnect for a channel, edit .magic/config/im-channels.json and set that channel's enabled field to false.
  • All channels share the same Agent as the web session, so conversation history stays connected across surfaces.
  • For WeChat, do not generate your own QR layout. The tool returns the exact markdown content to output — reply with it verbatim.

Version History

  • f9973c5 Current 2026-08-20 03:37

    修复微信连接流程:确保等待登录的提示在同一回复中返回,避免二维码单独回复导致Agent会话中断。

  • 41d7ef4 2026-07-25 09:29

Same Skill Collection

backend/super-magic/agents/skills/agent-info/SKILL.md
backend/super-magic/agents/skills/canvas-designer/SKILL.md
backend/super-magic/agents/skills/chat-history/SKILL.md
backend/super-magic/agents/skills/cli-manager/SKILL.md
backend/super-magic/agents/skills/compact-chat-history/SKILL.md
backend/super-magic/agents/skills/creating-slides/SKILL.md
backend/super-magic/agents/skills/develop-data-analysis-dashboard/SKILL.md
backend/super-magic/agents/skills/document-converter/SKILL.md
backend/super-magic/agents/skills/download/SKILL.md
backend/super-magic/agents/skills/env-manager/SKILL.md
backend/super-magic/agents/skills/magic-calendar/SKILL.md
backend/super-magic/agents/skills/magicbase/SKILL.md
backend/super-magic/agents/skills/sandbox-manager/SKILL.md
backend/super-magic/agents/skills/self-media-pre-publish-analyzer/SKILL.md
backend/super-magic/agents/skills/share/SKILL.md
backend/super-magic/agents/skills/skill-vetter/SKILL.md
backend/super-magic/agents/skills/slide-template/SKILL.md
backend/super-magic/agents/skills/subagents/SKILL.md
backend/super-magic/agents/skills/teamshare-cli/SKILL.md
backend/super-magic/agents/skills/user-info/SKILL.md
backend/super-magic/agents/skills/using-cron/SKILL.md
backend/super-magic/agents/skills/using-llm/SKILL.md
backend/super-magic/agents/skills/using-mcp/SKILL.md
frontend/magic-web/.agents/skills/antd-style-to-tailwind/SKILL.md
frontend/magic-web/.agents/skills/code-review-expert/SKILL.md
frontend/magic-web/.agents/skills/dual-edition-module-migration/SKILL.md
frontend/magic-web/.agents/skills/magic-web-error-logging/SKILL.md
frontend/magic-web/.agents/skills/sw-best-practices/SKILL.md
frontend/magic-web/.agents/skills/ui-data-testid/SKILL.md
frontend/magic-web/.agents/skills/vercel-composition-patterns/SKILL.md
frontend/magic-web/.agents/skills/vercel-react-best-practices/SKILL.md
backend/super-magic/agents/skills/ai-card-generator/SKILL.md
backend/super-magic/agents/skills/crew-creator/SKILL.md
backend/super-magic/agents/skills/deep-research/SKILL.md
backend/super-magic/agents/skills/dingtalk-cli/SKILL.md
backend/super-magic/agents/skills/html-api-sdk/SKILL.md
backend/super-magic/agents/skills/lark-cli/SKILL.md
backend/super-magic/agents/skills/micro-app-architect/SKILL.md
backend/super-magic/agents/skills/self-media-composer/SKILL.md
backend/super-magic/agents/skills/skill-creator/SKILL.md

Metadata

Files
0
Version
f9973c5
Hash
4c6bc680
Indexed
2026-07-25 09:29

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 11:19
浙ICP备14020137号-1 $Гость$