Lark Group Digest
Periodically generates structured summaries of all Lark group conversations.
Execution Model
The digest workflow runs in a background subagent (model: sonnet). The main session launches the subagent and returns immediately. The subagent executes the full flow: fetch, image inspection, summarize, build HTML, publish, notify.
Configuration
All configuration lives in ~/zylos/components/lark-group-digest/config.json:
{
"lark_skill_path": "~/zylos/.claude/skills/lark",
"output_dir": "~/zylos/lark-group-digest/raw",
"pages_dir": "~/zylos/http/public/pages/daily-digest",
"owner_chat_id": "<lark-dm-chat-id>",
"owner_display_name": "<name>",
"digest_schedule": [
{ "hour": 8, "suffix": "morning", "label": "上午", "window_hours": 13 },
{ "hour": 13, "suffix": "midday", "label": "午间", "window_hours": 5 },
{ "hour": 19, "suffix": "evening", "label": "晚间", "window_hours": 6 }
],
"sensitive_patterns": [
"ou_[a-f0-9]{32}",
"oc_[a-f0-9]{32}",
"cli_[a-f0-9]{16}"
],
"attention_rules": {
"always_flag_groups": [],
"recruitment_groups": []
}
}
Workflow
1. Determine Time Window
Based on current time and digest_schedule, select the matching window.
2. Fetch Messages
node <skill-dir>/scripts/digest.mjs --start <UNIX_SEC> --end <UNIX_SEC> \
--out <output_dir>/YYYY-MM-DD-<suffix>.json \
--config ~/zylos/components/lark-group-digest/config.json
Raw JSON archives are permanent (not deleted after summarization).
3. Image Content Completion
For groups containing [图片], download and view images using lark-cli:
lark-cli im +chat-messages-list --as bot --chat-id <CHAT_ID> \
--start "<ISO_START>" --end "<ISO_END>" --download-resources
View each image with the Read tool, replace placeholders with descriptions.
4. Summarize
Generate Chinese summaries per group:
- 整体内容归纳: one-line items, no multi-sentence paragraphs
- Owner 需要关注的: action items awaiting owner response
- Recruitment groups: new resumes always count as owner action items
5. Build and Publish HTML
Use the canonical template (references/digest-template.html):
- Copy template, fill
<!-- FILL: ... -->placeholders - Delete instruction comment block before
<html> - Structure: TL;DR + cards → attention board → group grid → details → no-message list
- Scan for sensitive info before publishing
- Register via pages CLI (no share links by default)
6. Notify Owner
Send Lark DM with the digest link and key highlights.
7. Check Todo
If the owner has a todo file, cross-reference new action items.