maolai7/agent-skills/wechat-watch
Claude Code and agent skill by maolai7/agent-skills
- community
Checking that the SKILL.md file is still in the repository.
微信公众号文章订阅与推送。自动部署 wechat-download-api 服务,定时轮询关注的公众号,检测新文章后总结并推送到飞书。触发条件:用户提到"公众号订阅"、"微信文章推送"、"wechat watch"、"公众号更新"等,或由 cron 定时任务触发。前置条件:用户需要有微信公众号(订阅号/服务号均可)用于扫码登录。
Install
npx vskill@latest install maolai7/agent-skills/wechat-watchSKILL.md
微信公众号订阅与推送
功能
- 自动部署 wechat-download-api 服务
- 获取登录二维码供用户扫码
- 定时轮询已订阅公众号
- 检测新文章,调用 API 获取完整内容
- 总结文章内容,合并推送到飞书
目录结构
前置条件
用户必须有微信公众号(订阅号或服务号均可),用于扫码登录获取凭证。
凭证有效期约 4 天,过期后需要重新扫码。
执行流程
步骤 0:首次使用引导
当用户首次使用此 skill 时:
- 检查服务是否已部署(检查
services/wechat-download-api/app.py是否存在) - 如果未部署,询问用户是否有微信公众号
- 如果有,自动部署服务
- 启动服务后,获取登录二维码并发送给用户
- 等待用户扫码确认
- 登录成功后,引导用户订阅公众号
步骤 1:检查服务状态
如果返回非 200,说明服务未启动,需要启动服务。
步骤 2:检查登录状态
如果未登录:
- 调用
/api/login/session/{sessionid}创建会话 - 调用
/api/login/getqrcode获取二维码 - 将二维码图片发送给用户(使用 MEDIA: 语法)
- 轮询
/api/login/check等待登录成功
步骤 3:管理订阅
添加订阅:
- 调用
/api/public/searchbiz?query=公众号名称搜索公众号 - 获取
fakeid - 调用
/api/rss/subscribe添加订阅
查看订阅:
取消订阅:
整体架构
核心设计:利用项目缓存,避免重复请求微信 API
定时任务配置
每天两次检查,按时间段筛选:
| 任务时间 | 查询范围 | |
|---|---|---|
| 每天 10:00 | 前一天 18:00 ~ 当天 10:00 | |
| 每天 18:00 | 当天 10:00 ~ 当天 18:00 |
时间段筛选逻辑:
文章数据有 publish_time 字段(Unix 时间戳),按以下方式筛选:
步骤 4:检查文章更新(定时任务)
从 SQLite 缓存读取,不请求微信 API:
流程:
- 运行脚本:
python <skill-dir>/scripts/check_articles.py - 脚本输出飞书格式的文章内容
- 发送给用户:
- 有飞书环境 → 通过飞书通道发送给用户
- 无飞书环境 → 直接在对话中展示内容
- 更新
data/pushed_articles.json - 无更新时也要发送:"暂无新文章更新"
步骤 5:推送格式
有新文章时:
无新文章时:
API 接口汇总
| 接口 | 方法 | 说明 | |
|---|---|---|---|
/api/health | GET | 健康检查 | |
/api/admin/status | GET | 登录状态 | |
/api/login/session/{sessionid} | POST | 创建登录会话 | |
/api/login/getqrcode | GET | 获取登录二维码 | |
/api/login/check | GET | 检查扫码状态 | |
/api/public/searchbiz | GET | 搜索公众号 | |
/api/public/articles | GET | 获取文章列表 | |
/api/article | POST | 获取文章内容 | |
/api/rss/subscribe | POST | 添加订阅 | |
/api/rss/subscriptions | GET | 获取订阅列表 | |
/api/rss/subscribe/{fakeid} | DELETE | 取消订阅 |
部署命令
检查环境
Docker 部署(推荐)
Python 部署(无 Docker)
数据文件
pushed_articles.json
记录已推送的文章 ID 和上次检查时间,避免重复推送:
{ "accounts": [ { "fakeid": "MzA1MjM1ODk2MA==", "nickname": "人民日报", "alias": "rmrbwx" } ] }
运行检查脚本
bash <skill-dir>/scripts/check_articles.sh
获取多篇文章内容时,每次请求后 sleep 5
for url in "${urls[@]}"; do curl -s -X POST "http://localhost:5000/api/article" \ -H "Content-Type: application/json" \ -d "{\"url\":\"$url\"}" sleep 5 # 必须! done
{ "agentId": "info_collector", "name": "公众号文章推送 - 早", "schedule": { "kind": "cron", "expr": "0 10 *", "tz": "Asia/Shanghai" }, "sessionTarget": "isolated", "wakeMode": "now", "payload": { "kind": "agentTurn", "message": "运行公众号文章检查脚本:python3 <skill-dir>/scripts/check_articles.py\n\n脚本会自动从 SQLite 缓存读取指定时间段的文章,输出飞书格式的推送内容。定时任务框架会自动将输出推送到配置的目标用户。" }, "delivery": { "mode": "announce", "channel": "feishu", "to": "user:你的飞书_USER_ID" } }
{ "agentId": "info_collector", "name": "公众号文章推送 - 晚", "schedule": { "kind": "cron", "expr": "0 18 *", "tz": "Asia/Shanghai" }, "sessionTarget": "isolated", "wakeMode": "now", "payload": { "kind": "agentTurn", "message": "运行公众号文章检查脚本:python3 <skill-dir>/scripts/check_articles.py\n\n脚本会自动从 SQLite 缓存读取指定时间段的文章,输出飞书格式的推送内容。定时任务框架会自动将输出推送到配置的目标用户。" }, "delivery": { "mode": "announce", "channel": "feishu", "to": "user:你的飞书_USER_ID" } }
📰 公众号文章更新(X 篇) 查询时间范围:2026-03-24 10:00 ~ 2026-03-24 18:00
【公众号名称】
- 文章标题:XXX
- 内容总结:XXX...
- 原文链接:链接
📰 公众号文章更新 查询时间范围:2026-03-24 10:00 ~ 2026-03-24 18:00
暂无新文章更新。
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingwechat-watch/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/maolai7/agent-skills/wechat-watch)