CommunitySchreiben & Editierengithub.com

shuangying0001-beep/wechat-notify

微信消息通知接入(企业微信机器人+公众号模板):5 分钟接消息推送。适合任何需通知用户的微信应用。

Was ist wechat-notify?

wechat-notify is a Claude Code agent skill that 微信消息通知接入(企业微信机器人+公众号模板):5 分钟接消息推送。适合任何需通知用户的微信应用。.

Funktioniert mit~Claude Code~Codex CLI~Cursor
npx skills add shuangying0001-beep/wechat-notify

Installed? Explore more Schreiben & Editieren skills: steipete/notion, affaan-m/seo, affaan-m/brand-voice · View all 6 →

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

微信通知接入

来源:亲子成长记施工包 AI要怎么做.md §3.3 微信/企业微信通知,已抽离项目名,成为通用接入规范。

这是什么

通知是大多数小程序的标配。本技能给两种最常用方案的接入规范与生成脚本:企业微信机器人(最简单,5 分钟)、公众号模板消息(需用户关注)。并强制密钥保管规则。

脚本自带 --self-test:打桩 httpx 验证三种发送的 payload 结构正确(text / markdown 卡片 / 模板消息),证明生成模块可用——无需真实 Webhook、无需联网。

何时使用

  • 用户说:"接入微信通知" / "企业微信机器人" / "公众号模板消息" / "微信消息推送"
  • 任何需要把系统消息推到微信(群 / 用户)的场景:任务提醒、状态通知、告警

方案一:企业微信机器人 Webhook(推荐,5 分钟接入)

  • POST {webhook_url} 发送 JSON:{"msgtype":"text","text":{"content":"消息内容"}}
  • 支持 markdown 格式,可带链接和图片
  • 无需申请,群管理员即可创建(群 → 添加机器人 → 复制 Webhook 地址)

方案二:公众号模板消息

  • 先获取 access_token(有效期 7200s,必须 Redis/内存缓存,禁止每次现取
  • POST https://api.weixin.qq.com/cgi-bin/message/template/send
  • 需要用户关注公众号,且模板需在公众号后台申请

安全要求(P0)

  • 企业微信机器人 Webhook URL 视同密钥,只存 .env,不出现在代码中
  • 公众号 AppSecret 只存服务端,不传给前端
  • 凭证绝不提交 Git;配合 wechat-miniprogram-devrules 安全边界使用

脚本用法(生成通知模块)

# 0) 先证明生成的发送结构正确(推荐第一次用前跑一次)
python gen_notify.py --self-test

# 1) 生成模块
python gen_notify.py --out ./notify_module

生成:

  • notify_module/wecom_bot.py —— 企业微信机器人发送(text / markdown,带限流重试,额外提供 markdown_card() 拼播报卡片)
  • notify_module/mp_template.py —— 公众号模板消息(access_token 缓存 + 发送,带限流重试
  • notify_module/.env.example —— 需填写的密钥字段

注意事项

  • 企业微信机器人适合"系统→群"告警/播报;公众号模板消息适合"系统→具体用户"的触达(如任务提醒、积分到账)
  • access_token 缓存键带过期时间并提前刷新,避免并发下重复获取触发频率限制
  • 模板消息内容受公众号类目与模板字段约束,发送前确认字段名匹配
  • 配合 ai-work-acceptance 验收:重点查 Webhook URL / AppSecret 未硬编码、未入库

Verwandte Skills

steipete/notion

Notion CLI/API for pages, Markdown content, data sources, files, comments, search, Workers, and raw API calls.

community

affaan-m/seo

Audit, plan, and implement SEO improvements across technical SEO, on-page optimization, structured data, Core Web Vitals, and content strategy. Use when the user wants better search visibility, SEO remediation, schema markup, sitemap/robots work, or keyword mapping.

community

affaan-m/brand-voice

Build a source-derived writing style profile from real posts, essays, launch notes, docs, or site copy, then reuse that profile across content, outreach, and social workflows. Use when the user wants voice consistency without generic AI writing tropes.

community

affaan-m/crosspost

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

community

affaan-m/x-api

X/Twitter API integration for posting tweets, threads, reading timelines, search, and analytics. Covers OAuth auth patterns, rate limits, and platform-native content posting. Use when the user wants to interact with X programmatically.

community

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

community