Feishu chat extractor

From wulaosiji/skills · View interactive version

Feishu chat extractor is an AI agent skill from the GitHub repository wulaosiji/skills. 提取并分析飞书群聊历史消息 / Extract and analyze historical chat messages from Feishu/Lark groups. 支持分页、时间范围过滤和内容提取,可生成用户反馈报告和话题分类。 Use when: "提取聊天记录", "extract chat history", "分析群消息", "analyze group messages", "飞书聊天导出", "feishu chat export", "消息历史检索", "message history retrieval", "用户反馈收集", "user feedback collec

How to use this skill

Skill file

Feishu Chat Extractor

提取并分析飞书群聊历史消息——支持分页、时间范围过滤和内容提取。

When to Use

Use this skill when:

Do NOT use this skill if:

Typical triggers:

Workflow

  1. 探查 (Probe)

确认目标群聊 ID、时间范围、是否需要关键词过滤。

  1. 约束 (Constrain)

务必使用 start_time 和 end_time 参数以确保完整提取,避免因保留策略导致分页遗漏。提取完成后检查 has_more 字段,确保所有分页已处理。不降级——数据不完整时报告错误。

  1. 证据 (Evidence)

确定提取范围(全部消息还是按关键词过滤),收集所有必要参数。

  1. 执行 (Execute)

运行提取和分析脚本:

# 提取聊天记录
python3 scripts/extract_chat.py --chat-id <CHAT_ID> --output chat_data.json

# 分析内容(如需要)
python3 scripts/analyze_content.py --input chat_data.json --keywords openclaw,clawdbot,cron,mcp

自动处理分页,确保完整消息检索跨所有时间范围。

  1. 验证 (Verify)

检查消息数量、时间覆盖范围和数据完整性。确认 has_more 为 false,所有分页已处理。

  1. 交付 (Deliver)

输出结构化报告并保存到工作区,返回提取摘要和分析结果。

Output

返回 JSON 格式的聊天数据和结构化分析报告,包含消息列表、时间范围、关键词统计和话题分类。

Guardrails

Anti-patterns

Constraints

Key Techniques

Time Range Extraction

params = {
    "container_id": chat_id,
    "container_id_type": "chat",
    "start_time": 1700000000,
    "end_time": 1700100000,
    "page_size": 50
}

Pagination Handling

all_messages = []
page_token = None
while True:
    params["page_token"] = page_token
    result = fetch_messages(params)
    all_messages.extend(result["items"])
    if not result["has_more"]:
        break
    page_token = result["page_token"]

Related Skills

About UniqueClub

Part of the UniqueClub toolkit.

🌐 https://uniqueclub.ai

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.