← Back to Skills Marketplace
ganguagua

feishu-weekly-report-merger

by ganguagua · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ⚠ suspicious
87
Downloads
0
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install feishu-weekly-report-merger
Description
飞书周报文档合并工具。当用户提供若干飞书文档链接(或通过多维表格权限检查后发现的有权限文档),读取每个文档内容,按固定五个章节(Part1~Part5)维度将原文顺序拼接,不修改、不总结、保留原文格式,最终生成一个新的飞书云文档。触发词:合并周报、合并文档、拼接文档、文档合并、周报拼接。
README (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 出现顺序)依次拼接,不做字母序或部门排序。

Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install feishu-weekly-report-merger
  3. After installation, invoke the skill by name or use /feishu-weekly-report-merger
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.1.0
Add support for wiki doc format; improved merge script
v1.0.1
通过 Python 脚本执行原文合并,AI 无法干预内容
v1.0.0
首发版本:按章节维度拼接多篇周报文档
Metadata
Slug feishu-weekly-report-merger
Version 1.1.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is feishu-weekly-report-merger?

飞书周报文档合并工具。当用户提供若干飞书文档链接(或通过多维表格权限检查后发现的有权限文档),读取每个文档内容,按固定五个章节(Part1~Part5)维度将原文顺序拼接,不修改、不总结、保留原文格式,最终生成一个新的飞书云文档。触发词:合并周报、合并文档、拼接文档、文档合并、周报拼接。 It is an AI Agent Skill for Claude Code / OpenClaw, with 87 downloads so far.

How do I install feishu-weekly-report-merger?

Run "/install feishu-weekly-report-merger" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is feishu-weekly-report-merger free?

Yes, feishu-weekly-report-merger is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does feishu-weekly-report-merger support?

feishu-weekly-report-merger is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created feishu-weekly-report-merger?

It is built and maintained by ganguagua (@ganguagua); the current version is v1.1.0.

💬 Comments