1实现原理 · 为什么它能做到
这是一本纯指令型 skill:目录里只有 SKILL.md(82 行),没有任何脚本;真正的发送动作由 agent 在 shell 里完成——要么调用配套 skill 的发送器,要么用等价的 inline curl。
4. Sends via the WeCom webhook using the sender from `setup-notifications-via-wecom` (or an equivalent inline curl call).
凭证不走环境变量,而是从共享配置文件的固定路径读取:webhook_url(含机器人 key)、recipient_scope、recipient_label 三者都来自 ~/.config/setup-notifications-via-wecom/config.json。
1. Reads `~/.config/setup-notifications-via-wecom/config.json` for `webhook_url`, `recipient_scope`, and `recipient_label`.
缺配置即停:配置不存在时只打印一行 setup 命令然后终止,不尝试猜测或临时创建。
If the config is missing, it prints the one-line setup command and stops.
收件人身份是显式配置而非推断:self(用户自己的通道)免授权直发,others(任何其他人或群)必须先过人工确认门禁,且门禁要求出示精确的 label 与消息全文。
3. If scope is `self`, sends without an authorization prompt. If scope is `others`, presents the exact label and message for human confirmation.
发送前必须清空本地代理环境变量,因为腾讯端点要求直连。
2. Unsets all local proxy env vars (Tencent endpoints must be reached directly).
交付判定以发送器响应为准:授权不等于送达,预备好的 pending item 也不等于送达回执。
5. Reports success or the exact WeCom error; authorization alone is not delivery proof.
身份与发送器防伪条款:不得从 webhook URL 反推 self/others,也不得仅因为脚本名为 send_wecom.py 就信任它。
Use `setup-notifications-via-wecom`'s `set_recipient.py` command; never infer self versus others from the webhook URL, and never trust a script merely because its basename is `send_wecom.py`.
消息格式边界被明确收窄:仅纯文本、单条 4096 字节以内、不做模板(模板与结构化消息归配套 skill)。
Plain text only. No markdown cards, images, or @mentions.
2核心能力
3外部依赖
| 类型 | 依赖 |
|---|---|
| network | WeCom 群机器人 webhook(腾讯 qyapi.weixin.qq.com) |
| cli | curl(notify-wecom 许可的等价发送路径) |
| cli | uv run --no-project python(配套 sender 的推荐调用方式) |
| cli | set_recipient.py(配套 skill 提供,用于绑定/校验收件人身份与 sender 摘要) |
| package | Python 标准库 urllib(配套 sender 的 HTTP 层,非第三方包) |
4风险提醒 风险提醒:黄色 · 留意使用
- 外发通道不可撤回 — 任何进入会话的文本都可能被组装成消息发到群里;门禁只认收件人身份、不审消息内容,所以它天然是 prompt-exfiltration 的候选通道。缓解是 others 档的人工确认,以及使用者对 self 通道边界的自觉(配套 skill 要求 self 仅用于「只有用户自己可见」的 webhook)。
- 凭证以明文落在主目录 — webhook_url(内含机器人 key)存在 ~/.config/setup-notifications-via-wecom/config.json;配套 skill 建议 chmod 600,但 notify-wecom 本身不校验文件权限,也不校验该文件是否被他人可读。
- 实现跨 skill 委托,存在漂移风险 — 发送代码在 setup-notifications-via-wecom 里,两 skill 版本各自演进;SKILL.md 自己也提示「不要因为脚本 basename 是 send_wecom.py 就信任它」——即作者已知这条委托链可被滥用/替换。
- 门禁、代理清理、长度限制都靠 agent 遵循文档 — 本 skill 无代码强制执行任何一条约束;self 档默认免确认,若 agent 误判 scope 或用户把他人可见的群配成 self,消息会在无二次确认下发出。
- 直连要求可能影响可用性 — 要求清空代理变量以直连腾讯端点;在网络必须走代理的环境下反而会发送失败,失败信息需人工解读 errcode。
5第二遍独立确认
- [ok] 本 skill 无脚本、无隐藏资产 — glob(hidden=true、gitignore=false)显示 notify-wecom/ 下仅 SKILL.md 一个文件;无 scripts/、references/、templates/,亦无 .security-scan-passed。
- [discrepancy] WeCom 端点归属 — 第一遍若把 qyapi.weixin.qq.com 当作本 skill 自带端点即属越档:notify-wecom/SKILL.md 全文无该域名(只有配置路径与 Tencent endpoints must be reached directly 的泛指),URL 形态与示例出自 setup-notifications-via-wecom/SKILL.md。最终 JSON 已按来源分别标注(网络依赖引配套 skill 原文)。
- [ok] 配置路径与字段 — notify-wecom 与配套 skill 双侧一致:都指向 ~/.config/setup-notifications-via-wecom/config.json,字段为 webhook_url / recipient_scope / recipient_label;send_wecom.py 的 CONFIG_PATH 为同值绝对路径。
- [ok] self/others 门禁表述一致 — notify-wecom『self 免授权、others 需人工确认、scope 非法即停』与 setup-*『self may send automatically; others requires human confirmation; missing identity fails fast』同义,无矛盾。
- [ok] 交付验证声明 — 『authorization alone is not delivery proof』与配套『only the sender response proves delivery』一致,且未夸大为「保证送达」——反而明确 pending item 不是回执。
- [ok] 代理清理的执行方 — notify-wecom 只声明要清空代理变量;实际执行在配套实现里(send_wecom.py 文档串说明会清除 proxy 相关环境变量,inline curl 路径则用 env -u 前缀)。本 skill 是纪律声明方而非执行方,JSON 已如此表述。
- [unlocatable] 4096 字节上限可验证性 — 该数字是企微 text 消息的服务端限制,仓内既无对应校验代码也无出处引用(配套 sender 的可见部分为配置加载与重试逻辑);按文档声明收录,无法在源码取证。
- [ok] 无混淆/无隐藏执行面 — 82 行纯文本 markdown,检索 base64/eval/exec/os.system/HTTP 端点/密钥文件读取零命中;shell 代码块仅出现在使用示例的 /notify-wecom 调用行。
6结论
dfbd3822134d853e…d5c4678cb5