wecome-send-message: Integrating WeCom Messages and Contacts via Agent Skill

Introduction

Alerts, approval results, and scheduled task statuses—many teams eventually rely on WeCom (Enterprise WeChat) for these notifications. A common approach is to write separate scripts or set up an internal service layer to manually maintain access_tokens, look up UserIDs, and call sending interfaces. Every time you need to change the copy or switch recipients, you have to touch the code or modify configurations.

Below is an introduction to the community Skill wecome-send-message on SkillHub (installation coordinate: @user_6976792a/wecom-send-message). It encapsulates credential configuration for WeCom self-built applications, contact lookups, and various message types into a SKILL.md workflow, where the Agent calls tools/wecom_client.py according to the documentation to perform operations.

What is this

wecome-send-message targets WeCom message pushing and contact directory queries: Sending messages to specified users via WeCom self-built applications, and searching the contact directory by name, phone, email, etc.

  • Maintainer: SkillHub community publisher user_6976792a, source is community, category business-ops
  • Current Version: 1.0.0
  • SkillHub Page Data (subject to page display): Rating 100000, Downloads 2293, Installs 269; Tags include requires_api_key=true (actually requires configuring WeCom CorpID, AgentID, Secret, etc.)
  • Official Entry: SkillHub Skill Page, api.skillhub.cn Coordinate Page

The name field in the package’s SKILL.md is wecom-api, which is inconsistent with the store display name wecome-send-message; refer to the coordinate @user_6976792a/wecom-send-message for installation and reference.

Core Functions

The following capabilities are derived from the published SKILL.md and tools/wecom_client.py subcommands, which the Agent executes by calling the Python script via Bash.

  1. Credentials & Connection: check checks readiness; setup writes to a private .env in the Skill directory; verify validates API connection.
  2. Contact Directory: Fuzzy search by name, precise lookup by phone or email, get user details, list departments and department members (including recursion).
  3. Message Pushing: Send text, Markdown, and text cards to single or multiple UserIDs (separated by |); supports @all and a --preview / --yes confirmation flow for multi-person scenarios.
  4. Operations Support: history views recent sending audits; common WeCom error codes have corresponding handling instructions in the Skill documentation; tokens are cached in the Skill’s private .cache/ by default, and audits are written to .state/message_audit.json.

Prerequisites: Python 3, and pip install requests.

Installation and Activation

1. Install SkillHub CLI (if not already installed)

command -v skillhub && skillhub --version

If not installed, follow the SkillHub installation documentation (full installation example):

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

2. Install this Skill to the current Agent’s skills directory

When installing, you must use --dir to point to the skills directory recognized by the Agent; otherwise, it may default to ./skills/ and fail to load.

skillhub install @user_6976792a/wecom-send-message --dir <skills directory>

Common paths (from SkillHub installation documentation):

  • Cursor: ~/.cursor/skills/
  • Claude Code: ~/.claude/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ under the project

You can also give the following prompt to an AI to let it complete the installation according to the skillhub installation instructions:

Please install `@user_6976792a/wecom-send-message` according to https://skillhub.cn/install/skillhub.md.

3. Configure WeCom Credentials

Before first use, run a check in the Skill directory (replace ${CLAUDE_SKILL_DIR} with the actual installation path, e.g., ~/.cursor/skills/@user_6976792a/wecom-send-message):

python3 ${CLAUDE_SKILL_DIR}/tools/wecom_client.py check

If not ready, it is recommended to use setup to write to the Skill’s private .env:

python3 ${CLAUDE_SKILL_DIR}/tools/wecom_client.py setup \
  --corp-id "Your CorpID" \
  --agent-id "Your AgentID" \
  --secret "Your App Secret" \
  --contact-secret "Your Contact Secret"

The CorpID, AgentID, and Secret come from the WeCom admin console’s self-built application; contact-secret is optional and used for contact directory capabilities. If not configured, the documentation states it will fall back to the application Secret. You can also inject them via environment variables WECOM_CORP_ID, WECOM_AGENT_ID, WECOM_SECRET, WECOM_CONTACT_SECRET or via OpenClaw’s openclaw secrets set (see Skill documentation).

Verify after configuration:

python3 ${CLAUDE_SKILL_DIR}/tools/wecom_client.py verify

Typical Usage

The Skill declares triggers when users express intentions like “Send a WeCom message to XX”, “WeCom push”, “wecom send”, etc.; you can also use the /wecom-api style entry in the documentation (depending on how the Agent mounts the Skill).

Look up person by name and send text

python3 ${CLAUDE_SKILL_DIR}/tools/wecom_client.py search-name --name "Zhang San"

python3 ${CLAUDE_SKILL_DIR}/tools/wecom_client.py send-text \
  --to "zhangsan" \
  --content "Meeting tomorrow at 10 AM, please attend on time."

Multi-person sending (preview then confirm)

python3 ${CLAUDE_SKILL_DIR}/tools/wecom_client.py send-text \
  --to "zhangsan|lisi|wangwu" \
  --content "Reminder: Submit weekly report before leaving today" \
  --preview

python3 ${CLAUDE_SKILL_DIR}/tools/wecom_client.py send-text \
  --to "zhangsan|lisi|wangwu" \
  --content "Reminder: Submit weekly report before leaving today" \
  --yes

Department members and Markdown notifications

python3 ${CLAUDE_SKILL_DIR}/tools/wecom_client.py dept-list

python3 ${CLAUDE_SKILL_DIR}/tools/wecom_client.py dept-users --dept-id 1 --recursive

python3 ${CLAUDE_SKILL_DIR}/tools/wecom_client.py send-markdown \
  --to "zhangsan" \
  --content "## Meeting Notice\n> Time: Tomorrow 10:00\n\nPlease attend on time."

In environments like Cursor, you typically describe the intention in natural language, and the Agent reads SKILL.md to execute the above commands; SKILL.md specifies that allowed tools are Read, Write, Edit, and Bash.

Use Cases and Notes

Who it is for: Teams that have enabled self-built applications in WeCom and need to hand over “looking up people + sending messages” to a coding Agent; categorized as business-ops, suitable for operations notifications, collaboration reminders, and lightweight office automation.

Limitations and Notes:

  1. Recipients must be within the application’s visible range; otherwise, errors like 60020 may occur; contact directory queries depend on the corresponding Secret and permissions.
  2. Batch sending and @all require --preview first by default; add --yes after confirmation to avoid accidental sending.
  3. Secrets should not be written into code or logs; the Skill only reads the .env under its directory by default, and you can specify other env files via WECOM_ENV_FILE.
  4. The store name wecome-send-message coexists with the package Skill name wecom-api and slug wecom-send-message; when troubleshooting, refer to the installation directory and coordinate.

Conclusion

wecome-send-message consolidates the messaging and contact directory capabilities of WeCom self-built applications into an installable Agent Skill: localized credentials, reproducible command-line operations, and documentation containing error codes and security conventions. If you are already using SkillHub to manage Skills, you can install it via the coordinate and drive WeCom notifications via conversation after verify passes.

Official URL: https://www.skillhub.cn/skills/user_6976792a/wecom-send-message

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye