feat: 新增群消息智能助手技能 (chat-copilot) — 自动读取+摘要+优先级排序+建议回复,告别「开完会回来99+未读」
核心痛点
多名客户高管反馈,每天都在重复这样的场景:
开完会回来,发现微信/飞书/钉钉/企微里有 99+ 条未读群消息,其中还有好几条 @我 待办的事项。翻消息翻到眼花,重要的信息淹没在闲聊里,该回的没回,该办的漏了。
这是一个每天发生、覆盖几乎所有职场人的高频真刚需:
- 群太多、消息太多,人脑处理不过来
- 重要信息(@我、待办、决策需求)淹没在噪音中
- 回复压力大——每条都要看、都要想怎么回
- 高管尤其严重——管理群多、跨部门群多、信息密度大
本 Issue 提出一个 skill:chat-copilot,自动读取多个聊天平台的群消息,生成结构化摘要,排出优先级,给出建议回复,确认后一键发送。
方案设计:chat-copilot Skill
核心流程
定时拉取群消息 → 智能摘要+优先级排序 → 生成建议回复 → 用户确认 → 自动发送
各平台技术可行性评估
| 平台 | 读取群消息 | 发送消息 | 可行性 | 技术方案 |
|---|---|---|---|---|
| 飞书 | ✅ im:message.group_msg 可读全部群消息 |
✅ POST /open-apis/im/v1/messages,1000次/分钟 |
高 | 自建应用 Bot + Event Subscription (HTTP/WebSocket) |
| 钉钉 | ⚠️ 仅 @Bot 消息可接收 | ✅ 机器人发送群消息 API | 中 | Stream Mode Bot + @Bot 触发;限制:无法静默读取全部消息 |
| 企业微信 | ⚠️ 智能机器人(2026新增)可接收 @Bot 消息 | ✅ 应用消息 + appchat API | 中 | 智能机器人 + 长连接模式;限制:群聊消息接收仍有限 |
| 微信(个人) | ❌ 无官方 API | ❌ 无官方 API | 低 | 仅可通过手动转发/截图 → OCR 解析的变通方案 |
优先级策略:飞书先行(API 最完善) → 钉钉/企微跟进 → 微信变通方案
功能设计
1. 定时消息采集 (Fetch)
按配置的频率(默认每30分钟)自动拉取:
- 所有已加入群的新消息(自上次拉取后)
- 被 @我的消息(单独标记)
- 包含待办/决策关键词的消息(自动识别)
- 私聊消息(可选)
采集策略:
| 平台 | 采集模式 | 说明 |
|---|---|---|
| 飞书 | Event Subscription (WebSocket) | 实时推送,无需轮询 |
| 钉钉 | Stream Mode + 定时补拉 | @Bot 消息实时推送 + 历史消息补拉 |
| 企微 | 智能机器人长连接 | @Bot 消息接收 + 应用消息读取 |
| 微信 | 手动触发 / 转发助手 | 用户将群消息转发给 Bot,或截图 OCR 识别 |
2. 智能摘要 (Digest)
对采集到的消息做结构化处理:
📋 群消息日报 — 2026-04-28 08:00
🔴 紧急 (3条)
├─ [产品群] @你 张总要求明天前给出Q2排期 → 建议:「收到,今天下午给您Q2排期初稿」
├─ [客户群] 客户反馈线上bug,影响支付流程 → 建议:「已收到,正在排查,预计1小时内修复」
└─ [运维群] 服务器CPU告警,需要确认扩容方案 → 建议:「同意扩容方案B,请按流程执行」
🟡 重要 (5条)
├─ [设计群] 设计稿已更新,需确认终版 → 建议:「已确认,可以进入开发」
├─ [招聘群] HR确认3个候选人明后天面试 → 建议:「OK,周二下午有空档」
└─ ...
🟢 一般 (12条)
├─ [闲聊群] 各种非工作讨论...
└─ ...
📝 待办事项 (2项)
1. 明天前给张总Q2排期 [截止: 明天]
2. 确认服务器扩容方案 [截止: 今天]
摘要维度:
| 维度 | 说明 |
|---|---|
| 优先级排序 | 🔴紧急/🟡重要/🟢一般,基于@提及、关键词、发送者角色 |
| 按群分组 | 每个群的消息归类在一起 |
| 待办提取 | 自动识别「需要你做XX」「请确认XX」等待办语句 |
| 决策点标记 | 需要用户拍板的事项高亮 |
| 建议回复 | 为每条需要回复的消息生成 1-2 条建议回复 |
3. 优先级排序算法
priority_score = w1 × is_mentioned
+ w2 × sender_authority (发送者在组织中的层级权重)
+ w3 × urgency_keywords (紧急/今天/立刻/截止等)
+ w4 × is_action_item (包含待办/需确认/需审批)
+ w5 × thread_replies (讨论热度:回复数越多越重要)
+ w6 × time_decay (越新的消息权重越高)
权重可由用户自定义调整。
4. 建议回复生成 (Reply Suggestion)
基于 LLM 生成建议回复,遵循以下原则:
- 简洁专业:默认 1-2 句话,不啰嗦
- 语气匹配:根据群类型(正式/非正式)和发送者关系调整
- 可编辑:用户可修改建议内容后再发送
- 多选一:提供 2-3 个回复选项供选择
- 学习风格:基于用户历史回复习惯,逐步学习个人风格
5. 确认后自动发送 (Confirm & Send)
用户确认流程:
1. 查看摘要 → 选择要回复的消息
2. 阅读建议回复 → 编辑/选择/重写
3. 点击确认 → 自动发送到对应群/私聊
4. 记录已处理 → 下次摘要不再重复
安全机制:
- 所有回复必须经过用户确认,绝不自动发送
- 敏感群(如客户群、高管群)可设置「二次确认」
- 发送前预览最终消息内容
- 支持撤回(在平台允许的时间窗口内)
技术架构
┌───────────────────────────────────────────────────────────────────┐
│ chat-copilot Skill │
├───────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌───────────────────┐ │
│ │ Fetch Engine │───→│ Digest Engine│───→│ Reply Suggester │ │
│ │ │ │ │ │ │ │
│ │ · 定时拉取 │ │ · 消息去重 │ │ · LLM 生成回复 │ │
│ │ · Event订阅 │ │ · 优先级排序 │ │ · 多选项生成 │ │
│ │ · 增量同步 │ │ · 待办提取 │ │ · 风格学习 │ │
│ │ · 消息缓存 │ │ · 摘要生成 │ │ · 语气适配 │ │
│ └──────┬───────┘ └──────────────┘ └───────┬───────────┘ │
│ │ │ │
│ │ ┌──────────────┐ │ │
│ │ │ Confirm & │◄────────────┘ │
│ │ │ Send Engine │ │
│ │ │ │ │
│ │ │ · 确认流程 │ │
│ │ │ · 安全检查 │ │
│ │ │ · 发送消息 │ │
│ │ │ · 发送记录 │ │
│ │ └──────┬───────┘ │
│ │ │ │
├─────────┼──────────────────┼──────────────────────────────────────┤
│ │ Platform Adapters (复用 channels 模块基础设施) │
│ │ │ │
│ ┌──────▼───────┐ ┌──────▼───────┐ ┌──────────┐ ┌────────┐ │
│ │ Feishu │ │ DingTalk │ │ WeCom │ │ WeChat │ │
│ │ Adapter │ │ Adapter │ │ Adapter │ │ Fallback│ │
│ │ │ │ │ │ │ │ │ │
│ │ im:message │ │ Stream Mode │ │ 智能机器人│ │ 手动/ │ │
│ │ Event Sub │ │ + Bot API │ │ 长连接 │ │ 截图OCR │ │
│ └──────────────┘ └──────────────┘ └──────────┘ └────────┘ │
├───────────────────────────────────────────────────────────────────┤
│ Storage (复用 PowerMem + 本地文件) │
│ ~/.openclaw/chat-copilot/ │
│ ├── config.json # 平台配置+群列表+偏好 │
│ ├── cache/ # 消息缓存(避免重复处理) │
│ ├── digest-history/ # 历史摘要存档 │
│ ├── reply-templates/ # 用户回复风格模板 │
│ └── sent-log.jsonl # 发送记录(审计追踪) │
└───────────────────────────────────────────────────────────────────┘
与现有 channels 模块的协同:
项目的 channels 模块已支持飞书、钉钉、企微等 6+ 平台的配置管理(appId/appSecret/凭证等),chat-copilot 直接复用这些配置,无需重复输入。用户只需在 channels 里配置好平台凭证,chat-copilot 自动读取。
目录结构
bundled-skills/chat-copilot/
├── SKILL.md # 技能说明与工作流指引
├── _meta.json # 元数据
├── references/
│ ├── platform-apis.md # 各平台 API 端点与权限说明
│ ├── priority-algorithm.md # 优先级排序算法详解
│ └── reply-style-guide.md # 回复风格模板与学习机制
└── scripts/
├── fetch-messages.mjs # 消息采集(多平台适配)
├── generate-digest.mjs # 生成结构化摘要
├── prioritize.mjs # 优先级排序
├── suggest-replies.mjs # 建议回复生成
├── confirm-send.mjs # 确认并发送消息
├── learn-style.mjs # 学习用户回复风格
└── schedule-config.mjs # 定时任务配置
前端模块(配合):
packages/web/src/modules/chat-copilot/
├── index.ts # ClawModule 定义
├── ChatCopilotPage.tsx # 主界面
├── components/
│ ├── MessageDigest.tsx # 消息摘要视图
│ ├── PriorityList.tsx # 优先级排序列表
│ ├── ReplyEditor.tsx # 建议回复编辑器
│ ├── ConfirmSendDialog.tsx # 确认发送对话框
│ ├── DigestHistory.tsx # 历史摘要浏览
│ └── PlatformStatusCard.tsx # 各平台连接状态
SKILL.md 核心内容
---
name: chat-copilot
description: 群消息智能助手。Use when the user needs help processing a flood of unread group chat messages — auto-digest, priority ranking, suggested replies, and confirmed sending. Works with Feishu, DingTalk, WeCom, and WeChat.
metadata:
openclaw:
requires:
anyBins:
- node
---
# chat-copilot
Use this skill when the user returns to a flood of unread messages
across Feishu, DingTalk, WeCom, or WeChat groups and needs help
processing them efficiently.
This skill reads messages from configured chat platforms, generates
a structured digest with priority ranking, suggests replies, and
sends them after user confirmation.
## Critical Rule
- NEVER auto-send without explicit user confirmation
- ALWAYS show the final message content before sending
- Mark sensitive groups (customer-facing, executive) for double-confirm
## Commands
# 采集新消息并生成摘要
node ${SKILL_DIR}/scripts/fetch-messages.mjs --platform feishu --since last
# 生成优先级摘要
node ${SKILL_DIR}/scripts/generate-digest.mjs --summary --top 20
# 为待回复消息生成建议回复
node ${SKILL_DIR}/scripts/suggest-replies.mjs --message-id xxx --count 3
# 确认并发送回复
node ${SKILL_DIR}/scripts/confirm-send.mjs --message-id xxx --reply "确认收到" --platform feishu
# 学习用户回复风格
node ${SKILL_DIR}/scripts/learn-style.mjs --from-history
用户配置示例
{
"platforms": {
"feishu": {
"appId": "cli_xxx",
"appSecret": "***",
"mode": "websocket",
"groups": {
"include": ["产品群", "客户群", "运维群"],
"exclude": ["闲聊群"]
}
},
"dingtalk": {
"clientId": "xxx",
"clientSecret": "***",
"mode": "stream",
"groups": {
"include": ["*"],
"policy": "mentioned_only"
}
},
"wecom": {
"corpId": "xxx",
"agentId": "xxx",
"secret": "***"
}
},
"schedule": "*/30 * * * *",
"digest": {
"maxItems": 50,
"groupBy": "priority",
"showReplies": true
},
"reply": {
"autoSuggest": true,
"style": "professional",
"sensitiveGroups": ["客户群", "高管群"],
"requireDoubleConfirm": true
},
"priorityWeights": {
"isMentioned": 1.0,
"senderAuthority": 0.7,
"urgencyKeywords": 0.8,
"isActionItem": 0.9,
"threadReplies": 0.3,
"timeDecay": 0.5
}
}
实施路线
Phase 1 — 飞书 MVP
- 搭建
chat-copilotskill 目录结构和脚本框架 - 实现飞书适配器:Event Subscription (WebSocket) 接收群消息
- 实现基础消息采集 + 去重 + 增量同步
- 实现摘要生成(按群分组 + 优先级排序)
- 实现 @提及检测和待办提取
- 实现 LLM 建议回复生成
- 实现确认后发送流程(飞书 Bot 发送消息)
- 前端基础模块(ChatCopilotPage + MessageDigest + ReplyEditor)
Phase 2 — 钉钉 + 企微 + 多群管理
- 钉钉适配器:Stream Mode Bot + 历史消息补拉
- 企微适配器:智能机器人长连接 + 应用消息
- 多平台消息聚合视图
- 群过滤规则(include/exclude/policy)
- 回复风格学习(基于历史回复数据)
- 前端 PlatformStatusCard + DigestHistory
Phase 3 — 微信变通 + 智能增强
- 微信变通方案:转发助手 / 截图 OCR 解析
- 优先级权重用户可调
- 多选项回复(2-3 个候选)
- 周报/日报自动生成(与
clawprobe-cost-digest联动) - 飞书卡片消息交互(直接在卡片上确认/拒绝回复)
- 团队协作:多人共享群消息处理权限
关键设计决策
为什么「绝不自动发送」是核心原则?
客户高管对「AI 自动替我回复」有强烈的安全顾虑:
- 客户群发错消息可能造成商业损失
- 高管群语气不当可能引发内部问题
- 承诺/确认类回复需要人的判断力
因此本 skill 的核心原则是:AI 建议,人类决策,系统执行。
为什么复用 channels 模块?
项目 channels 模块已有完善的平台配置管理(凭证、策略、权限),chat-copilot 直接复用而非重建:
- 用户已在 channels 配置的飞书/钉钉/企微凭证,chat-copilot 自动读取
- channels 的
dmPolicy/groupPolicy策略自然适用于消息采集范围 - 新增平台适配器只需在 channels 注册,chat-copilot 自动支持
为什么飞书先行?
飞书 API 最完善:
im:message.group_msg可读取全部群消息(非仅 @Bot)- WebSocket 长连接无需公网 IP
- 1000次/分钟的高速率限制
- 企业级权限审批流程清晰
技术约束(遵循项目规范)
- 仅使用 Node.js v20+:不引入 Python、Bun 或其他运行时
- 无原生二进制依赖:纯 JS 实现
- 遵循 adapter 模式:每个平台适配器返回
AdapterResult<T> - 复用 channels 模块配置:不重复实现平台凭证管理
- 所有用户可见文本走 i18n:zh.ts / en.ts / ja.ts
- 采集脚本使用
exec执行:与clawprobe-cost-digest模式一致 - 消息缓存本地存储:
~/.openclaw/chat-copilot/cache/
与现有 Issue/Skill 的关系
| Issue/Skill | 关系 |
|---|---|
channels 模块 |
复用平台配置和凭证管理,chat-copilot 是 channels 的下游消费者 |
clawprobe-cost-digest skill |
摘要生成可复用其 --summary 模式;日报/周报可联动 |
content-draft skill |
回复风格学习可复用其内容生成能力 |
paddleocr-doc-parsing skill |
微信截图 OCR 解析可复用 |
| #49 LLM Wiki | 消息摘要可沉淀到 LLM Wiki 作为团队知识积累 |
| #110 evolving-wiki | 群消息中的高价值信息可自动沉淀到 evolving-wiki |
Acceptance Criteria
- [ ]
bundled-skills/chat-copilot/目录结构完整 - [ ] 飞书适配器:WebSocket 长连接接收群消息 + Bot 发送消息
- [ ] 摘要生成:按群分组 + 优先级排序(🔴🟡🟢)+ 待办提取
- [ ] 建议回复:LLM 生成 1-3 条候选回复
- [ ] 确认发送:所有回复必须用户确认后才发送,绝不自动发送
- [ ] 敏感群二次确认机制
- [ ] 消息去重和增量同步
- [ ] 定时自动采集(默认每30分钟)
- [ ] 复用 channels 模块的平台配置
- [ ] 钉钉适配器(Stream Mode Bot)
- [ ] 企微适配器(智能机器人)
- [ ] 回复风格学习
- [ ] 所有脚本仅依赖 Node.js v20+
- [ ] 用户可见文本走 i18n(zh/en/ja)
- [ ] 包含
__tests__/测试用例 - [ ] 本地
npm test通过
Handling the high volume of unread group messages is crucial to streamline workflow, especially when important information is buried in noise. I'd tackle this by developing a chat-copilot skill that integrates with Feishu first, using event subscriptions to fetch messages, summarize, prioritize, and suggest replies, before expanding to DingTalk and WeCom. I can have a prototype PR ready within 5 days. I've previously developed similar solutions for enterprise chat systems, ensuring robust integrations and effective user-driven automation.
Moved to discussion for broader design conversation: https://github.com/openmaster-ai/clawmaster/discussions/123