# Wecom Push

> 把智能体的最终回复通过「企业微信自建应用」API 推送到成员的企业微信（开启微信插件后个人微信同步收到提醒）。当用户要求「把回复/结果发到企业微信/微信」「推送结果」「通知我」时使用。统一入口 scripts/wecom-app-push.ps1。

- Skill: `andersonlin4/wecom-push` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add andersonlin4/wecom-push`
- Raw SKILL.md: https://api.skillmd.com/api/skills/andersonlin4/wecom-push/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: AndersOnLin4 (https://skillmd.com/u/andersonlin4)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/andersonlin4/wecom-push

---


# 企业微信自建应用推送

入口脚本 `scripts/wecom-app-push.ps1`（与 SKILL.md 同目录）。配置在**当前工作目录**的 `wecom.config.json`（字段：corpId / agentId / secret / touser）。

## 用法（pwsh 工具；每个新进程先执行第一句）

```powershell
$s = '<本 skill 目录>\scripts\wecom-app-push.ps1'   # 已设 DSH_HOME 时也可：Join-Path $env:DSH_HOME 'skills\wecom-push\scripts\wecom-app-push.ps1'
Set-ExecutionPolicy -Scope Process Bypass -Force

& $s -Action test                                          # 验证配置（可选）
$finalReply | & $s                                         # 推送最终回复（text，自动分段）
$finalReply | & $s -Markdown -Title '📊 任务结果'            # markdown 富文本
```

## 规则

1. **只在最终回复前推送一次**，不要推送中间过程或工具调用细节；内容就是给用户看的最终答案。
2. 推送失败时向用户说明原因（errcode 含义：`60020`=管理后台未配置企业可信IP、`40013`=corpId 错误、`40014`=secret 错误、`60111`=touser 用户不存在），不要暴露 token/secret 明文。
3. 内容长短无需处理：脚本自动按 text 2048 字节 / markdown 4096 字节分段，逐条发送。
4. 不要把 `wecom.config.json` 的内容、secret、access_token 写进对话、日志或代码仓库。
5. 用户没要求推送时**不要**擅自调用本技能。

