CRITICAL — Before starting, you MUST first use the Read tool to read ../lark-shared/SKILL.md, which contains authentication and permission handling
Applicable Scenarios
- "Help me summarize what was discussed in the project group chat today" / "group daily report"
- "Generate a weekly report for XX group" / "group message summary"
- "What important messages are in this group today" / "group chat summary"
- "Help me check if there are any important notices in the group today" / "today's group message review"
- "Generate a discussion summary for the product group this week"
Prerequisites
Only supports user identity. Ensure authorization before execution:
lark-cli auth login --domain im
# 如需保存文档,还需:
lark-cli auth login --domain im,docs
Workflow
{群名称/群ID + 时间范围}
│
├── im +chat-search ──────────────► 查找群聊(获取 chat_id)
│
├── im +chat-messages-list ───────► 拉取群消息(分页,max 50/页)
│ └── --start / --end 过滤时间范围
│
├── AI 分析消息 ──────────────────► 提取关键信息
│ ├── 话题分类
│ ├── 决策记录
│ ├── 待办事项
│ ├── 问题与风险
│ └── 重要通知
│
├── AI 生成结构化日报 ────────────► Markdown 格式
│
├── [可选] docs +create ──────────► 保存为飞书文档
│
└── [可选] im +messages-send ─────► 发送到群聊
Step 1: Find the group chat
If the user provided a group name, first get the chat_id:
lark-cli im +chat-search --query "<群名称>" --as user
Extract from the returned result chat_id(oc_xxx format). If the user directly provided a chat_id, skip this step.
Step 2: Fetch group messages
# 拉取指定时间范围内的消息(按时间倒序,最新在前)
lark-cli im +chat-messages-list \
--chat-id "<chat_id>" \
--start "2026-04-09T00:00:00+08:00" \
--end "2026-04-09T23:59:59+08:00" \
--page-size "50" \
--sort "asc" \
--as user
Pagination handling
Each page can contain at most 50 messages. If the returned result contains has_more: true, use --page-token to continue fetching:
# 第一页
lark-cli im +chat-messages-list --chat-id "oc_xxx" --start "..." --end "..." --page-size "50" --as user
# 返回 page_token 后,拉取下一页
lark-cli im +chat-messages-list --chat-id "oc_xxx" --start "..." --end "..." --page-size "50" --page-token "<token>" --as user
Note:
- If the message volume for a day exceeds 500, it is recommended to analyze only the most recent 200-300 messages to avoid exceeding the context
- Filter out pure emoji replies, system messages, and image/file messages (unless the user specifically requests them)
- Use
--sort ascto sort in chronological order, making it easier for the AI to understand the discussion flow
Step 3: AI generates the daily report
Hand the fetched messages to the AI for analysis, and generate the daily report according to the following structure:
## {群名} 日报 — {日期}
### 概览
- 消息总数:N 条
- 活跃成员:N 人
- 主要话题:{2-3个关键词}
### 重要决策
| 决策内容 | 提出者 | 时间 |
|---------|--------|------|
### 待办事项
| 事项 | 负责人 | 来源 |
|------|--------|------|
### 话题讨论
#### 1. {话题标题}
- **摘要**:一句话概括
- **参与人**:A、B、C
- **结论**:{如有}
#### 2. {话题标题}
...
### 问题与风险
| 问题描述 | 提出者 | 状态 |
|---------|--------|------|
### 其他通知
- {通知1}
- {通知2}
Analysis rules:
- Ignore meaningless chit-chat and pure emoji messages
- Focus on messages containing decisions, to-dos, and issues
- Preserve key context, but remove redundant discussion
- If the message contains
@某人reminder, mark it in the to-dos
Step 4: Output the daily report (optional)
Send to the group chat
lark-cli im +messages-send \
--chat-id "<chat_id>" \
--markdown "{日报内容}" \
--as bot
Send to an individual
lark-cli im +messages-send \
--user-id "<open_id>" \
--markdown "{日报内容}" \
--as bot
Save as a document
lark-cli docs +create \
--title "{群名} 日报 — {日期}" \
--markdown "{日报内容}" \
--as user
Fallback Strategy
| Scenario | Fallback Plan |
|---|---|
| Group chat not found | Prompt the user to confirm the group name, or use chat_id directly |
| No messages in the group | Return "No messages in the group during this period" |
| Message volume too large | Analyze only the most recent N messages, and collapse the rest as "N messages not analyzed" |
| im push failed | Output only to the conversation, and tell the user to send it manually |
| docs save failed | Output only Markdown to the conversation |
| Message content is an image/file | Mark "[image/file]" in the daily report, and suggest the user check it manually |
Permission Table
| Command | Required scope |
|---|---|
im +chat-search |
im:chat:readonly |
im +chat-messages-list |
im:message:readonly |
im +messages-send |
im:message |
docs +create |
docx:document:create |
References
../lark-im/SKILL.md— IM atomic operations../lark-doc/SKILL.md— document creation