← 返回 Skills 市场
ganguagua

feishu-weekly-report-merger

作者 ganguagua · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ⚠ suspicious
87
总下载
0
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install feishu-weekly-report-merger
功能描述
飞书周报文档合并工具。当用户提供若干飞书文档链接(或通过多维表格权限检查后发现的有权限文档),读取每个文档内容,按固定五个章节(Part1~Part5)维度将原文顺序拼接,不修改、不总结、保留原文格式,最终生成一个新的飞书云文档。触发词:合并周报、合并文档、拼接文档、文档合并、周报拼接。
使用说明 (SKILL.md)

Feishu Weekly Report Merger

将多份飞书周报文档按章节合并为一份新文档。

核心原则

原文一字不改,合并完全由脚本执行,AI 无法干预内容。

工作流程

Step 1:读取所有源文档

对每个文档 URL,调用 feishu_fetch_doc 获取完整 Markdown 内容:

feishu_fetch_doc(doc_id="\x3Cdoc_id>")
  • doc_id 从 URL 路径段提取(docx 或 wiki token 均可)
  • 需要记录每个文档的归属人姓名(从标题或 URL 中识别)

Step 2:保存原文到临时文件

将每份文档的 markdown 字段原始内容写入独立临时文件:

/tmp/merge_doc_0.md   ← 文档1原文
/tmp/merge_doc_1.md   ← 文档2原文
/tmp/merge_doc_2.md   ← 文档3原文
...

重要:写入时不做任何修改、不压缩、不总结,原文是什么就写什么。

Step 3:调用合并脚本

使用 exec 工具运行 Python 脚本:

python3 ~/workspace/agent/skills/feishu-weekly-report-merger/scripts/merge.py \
  "姓名1/姓名2/姓名3" \
  "姓名1" /tmp/merge_doc_0.md \
  "姓名2" /tmp/merge_doc_1.md \
  "姓名3" /tmp/merge_doc_2.md

脚本路径:~/workspace/agent/skills/feishu-weekly-report-merger/scripts/merge.py

Step 4:创建新文档

调用 feishu_create_doc,将脚本 stdout 输出作为 markdown 传入:

feishu_create_doc(
  markdown="\x3C脚本stdout输出>",
  title="[AIO]-[姓名列表]-周报合并-YYYY-MM"
)

标题格式:[AIO]-[姓名1/姓名2/姓名3]-周报合并-YYYY-MM,日期取当前月份。

脚本工作原理

merge.py 按以下规则拼接:

  1. 章节识别:用正则 ^#\s*\*?Part\s*([1-5])\s*【 匹配 Part1~Part5 标题行
  2. 按 Part 切分:每个文档切分为 5 个 Part 原始文本块
  3. 原地拼接:每个 Part 下,按参数顺序依次放入各文档该 Part 的原文,不做任何修改
  4. 格式完整保留lark-tablelark-tdlark-tr 等飞书标签,以及所有 Markdown 语法全部保留

权限与安全

  • 只处理 owner 有权限读取的文档
  • 合并后的文档创建到 owner 的飞书云空间
  • 不在群聊中暴露文档内容

常见问题

场景 处理方式
某文档某 Part 缺失 该 Part 下只展示有内容的员工,缺失 Part 直接跳过
feishu_fetch_doc 返回 forBidden 跳过该文档,继续处理其他文档
feishu_fetch_doc 触发频率限制 等 3 秒重试一次;失败超过 2 次则跳过该文档
文档内容为空 跳过该文档
Wiki vs Docx 两者 token 格式相同,feishu_fetch_doc 均支持,直接提取路径段作为 doc_id

合并顺序

严格按照用户在消息中列出的文档顺序(URL 出现顺序)依次拼接,不做字母序或部门排序。

安全使用建议
Key points before installing or using this skill: - Expectation mismatch: The SKILL.md promises 'do not modify original text', but scripts/merge.py normalizes Part headers, trims some newlines, removes separator lines, and inserts its own headers/separators. If you need byte-for-byte preservation, review and modify merge.py (or reject the skill). - Temporary files: The workflow writes original markdown to /tmp/merge_doc_*.md. /tmp files can be readable by other local users on multi-user systems and are subject to race conditions. Ensure the agent runtime runs with appropriate user isolation, cleanups (rm -f /tmp/merge_doc_*.md), or update the skill to use secure temp files (e.g., mkstemp) and immediate removal after use. - Confirm Feishu connector behavior: The skill uses feishu_fetch_doc and feishu_create_doc provided by the agent/platform. Verify what Feishu credentials and scopes the agent grants to these calls and that merged docs are created only in the intended owner's cloud space. - Review and test: Inspect and test merge.py on non-sensitive sample documents to see how headers, tables, code blocks, and other formatting are transformed. If exact fidelity is required, request or implement changes in the script (avoid header normalization and whitespace trimming). - If you have limited sysadmin control over the agent runtime, consider not installing or only enabling this skill after a code audit that ensures it meets your preservation and privacy requirements.
功能分析
Type: OpenClaw Skill Name: feishu-weekly-report-merger Version: 1.1.0 The skill automates merging Feishu documents by fetching content and executing a local Python script (`scripts/merge.py`) via the `exec` tool. It is classified as suspicious due to a potential shell injection vulnerability in the `SKILL.md` instructions, which direct the AI agent to construct shell commands using strings extracted from document titles (e.g., user names) without explicit sanitization. While the script logic appears legitimate and lacks intentional malicious code, the workflow's reliance on shell execution with external, untrusted data poses a significant security risk.
能力评估
Purpose & Capability
Name/description (merge multiple Feishu weekly reports by Part1~Part5) matches provided artifacts: SKILL.md describes using feishu_fetch_doc/feishu_create_doc and a local merge.py script (present). No unrelated environment variables, binaries, or install steps are requested.
Instruction Scope
SKILL.md repeatedly states '原文一字不改' (do not modify original text). However, scripts/merge.py performs normalization (normalize_part_header) which rewrites part headers to a canonical '# **PartN:【...】**' format, strips leading/trailing newlines, removes part-level separator lines, and inserts separators/section headers. These are content modifications that contradict the 'no modification' guarantee. The SKILL.md also instructs writing originals to /tmp and running a script via exec — that is expected, but temporary files in /tmp may be readable to other local users unless securely created/cleaned. The references note cleanup (rm -f /tmp/merge_doc_*.md) but SKILL.md's main workflow doesn't enforce or show the cleanup step.
Install Mechanism
Instruction-only skill with an included script file; there is no install spec, no downloads, and no archive extraction. This is low-risk from an install mechanism perspective.
Credentials
The skill declares no required env vars or credentials. It relies on platform-provided feishu_fetch_doc/feishu_create_doc functionality (expected). There are no extra unrelated credentials requested.
Persistence & Privilege
always is false and the skill is user-invocable. The skill does not request persistent system-wide privileges or modify other skills' config. It runs a local script and creates temporary files under /tmp.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install feishu-weekly-report-merger
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /feishu-weekly-report-merger 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.0
Add support for wiki doc format; improved merge script
v1.0.1
通过 Python 脚本执行原文合并,AI 无法干预内容
v1.0.0
首发版本:按章节维度拼接多篇周报文档
元数据
Slug feishu-weekly-report-merger
版本 1.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 3
常见问题

feishu-weekly-report-merger 是什么?

飞书周报文档合并工具。当用户提供若干飞书文档链接(或通过多维表格权限检查后发现的有权限文档),读取每个文档内容,按固定五个章节(Part1~Part5)维度将原文顺序拼接,不修改、不总结、保留原文格式,最终生成一个新的飞书云文档。触发词:合并周报、合并文档、拼接文档、文档合并、周报拼接。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 87 次。

如何安装 feishu-weekly-report-merger?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install feishu-weekly-report-merger」即可一键安装,无需额外配置。

feishu-weekly-report-merger 是免费的吗?

是的,feishu-weekly-report-merger 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

feishu-weekly-report-merger 支持哪些平台?

feishu-weekly-report-merger 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 feishu-weekly-report-merger?

由 ganguagua(@ganguagua)开发并维护,当前版本 v1.1.0。

💬 留言讨论