shiyin-li

wechat-daily-report-skill

生成微信群聊日报。优先用 jackwener/wx-cli 获取本地微信聊天记录,再输出新版日报 HTML 和 PNG,包含今日剧情、聊天气泡、资料收纳、问答、成员观察和成员过滤。

shiyin-li 0 Updated 2w ago

Resources

16
GitHub

Install

npx skillscat add shiyin-li/wx-daily-reports

Install via the SkillsCat registry.

SKILL.md

WeChat Daily Report Skill

目标:把微信群聊天记录整理成一份可读、可分享、可归档的日报。

最终产物优先输出:

  • report.html:可交互网页,支持侧边栏导航和成员过滤
  • report.png:可发群、可放 Obsidian 的长图

工作流

0. 默认执行模式

当用户直接说“运行这个 skill”“生成日报”“拉取昨天群消息并发日报”,且没有明确要求只预览、不提交或不推送时:

  • 默认优先运行 scripts/run_daily_report_once.py
  • 默认会自动生成 stats.jsonai_content.jsonreport.htmlreport.png
  • 默认会自动执行 git commitgit push
  • 默认按 Asia/Shanghai 时区处理“昨天整天”

如果用户没有指定群名,并且当前上下文也没有别的约束,默认群名使用:

agent 交流沟通群

只有在用户明确说“不要推送”“只生成文件”“先别提交”时,才改用 --skip-push--skip-commit

1. 确认数据来源

优先根据用户已有数据选择路线:

  • 用户希望用 jackwener/wx-cli:使用 scripts/wx_cli_to_report.py
  • 用户给了本地 wechat-cli-pkg.tar.gz:解压后用 scripts/wx_cli_to_report.py --binary <wechat-cli>
  • 已有 stats.jsonai_content.json:直接渲染
  • 已有聊天文本、WeFlow 导出、其他 JSON:先整理为 stats.json,再按 references/ai_prompt.md 生成 ai_content.json
  • 要读本机微信数据库:执行本仓库内置解密和分析脚本

不要默认承诺“安装到 Obsidian 后自动打通微信”。本 skill 负责生成日报素材;Obsidian 侧是归档和浏览。

2. wx-cli 路线

对于“直接运行完整日报流程”的请求,优先不要手工拆步骤,直接执行:

python3 scripts/run_daily_report_once.py \
  --chatroom "agent 交流沟通群"

这条命令默认会自动推送到 GitHub。

wx sessions
python3 scripts/wx_cli_to_report.py \
  --chatroom "<群名或 chatroom id>" \
  --date YYYY-MM-DD \
  --limit 5000 \
  --output-stats stats.json \
  --output-text simplified_chat.txt

产物:

  • stats.json
  • simplified_chat.txt

如果使用本地 wechat-cli 包:

python3 scripts/wx_cli_to_report.py \
  --binary "<解压后的 wechat-cli 二进制路径>" \
  --chatroom "<群名或 chatroom id>" \
  --date YYYY-MM-DD \
  --limit 5000 \
  --output-stats stats.json \
  --output-text simplified_chat.txt

3. 生成 AI 内容

必须读取:

  • references/ai_prompt.md
  • stats.json
  • simplified_chat.txt 或所有 simplified_chat_*.txt

必须产出:

  • ai_content.json

要求:

  • 只能保存合法 JSON
  • 不要保存 Markdown 代码块
  • talker_profiles 的 key 必须和 stats.json 里的 top_talkers[].name 完全一致
  • dialogues[].messages[].name 必须尽量使用真实群昵称,成员过滤依赖这些名字

4. 渲染 HTML

python3 scripts/generate_report.py \
  --stats stats.json \
  --ai-content ai_content.json \
  --output report.html

5. 渲染 PNG 长图

python3 scripts/generate_report.py \
  --stats stats.json \
  --ai-content ai_content.json \
  --output report.png \
  --viewport-width 1180 \
  --viewport-height 1400 \
  --device-scale-factor 2

示例自检

在改模板或发布前,至少跑一次:

python3 -m py_compile scripts/*.py
python3 scripts/wx_cli_to_report.py \
  --input-json examples/wx_cli_history_sample.json \
  --chatroom "Dont哥 对谈群" \
  --date 2026-04-30 \
  --output-stats examples/wx_stats_from_sample.json \
  --output-text examples/wx_simplified_chat_sample.txt
python3 scripts/generate_report.py \
  --stats examples/sample_stats.json \
  --ai-content examples/sample_ai_content.json \
  --output examples/qun-ribao-demo.html
python3 scripts/generate_report.py \
  --stats examples/sample_stats.json \
  --ai-content examples/sample_ai_content.json \
  --output examples/qun-ribao-demo.png

输出风格

  • 像一份“聊天现场复盘”,不要像普通统计海报
  • 重点保留对话上下文、人物、时间和资料价值
  • 优先生成可回看的事件线:发生了什么、谁说了什么、结论是什么
  • HTML 适合托管和交互,PNG 适合发群和归档