lark-docx2md
Skill33 starsChanged 7 months agoISCView on GitHub
读取飞书 Wiki 文档或电子表格(`https://*.feishu.cn/wiki/...`、`https://*.feishu.cn/sheets/...`)内容。当需要读取、导入、归档、分析或处理飞书 wiki 或 sheets 链接的内容时使用。
In this repositoryOne other file it gives its agents.
- release-versionSkill
The file
Files
lark-docx2md
将飞书文档或电子表格 URL 转换为本地 Markdown 文件。
适用范围
- 适用链接类型:
https://*.feishu.cn/{wiki,docx,docs,sheets}/...(含?sheet=xxx)。 - 适用任务类型:读取、导入、归档、分析、抽取飞书文档内容,并提供给后续实现或生成任务使用。
wiki/docx/docs:支持整篇读取与按标题/章节定向读取。sheets:默认按整表读取,不做标题筛选。- 不适用于:非飞书链接、纯本地文件解析、需要直接写回飞书文档的场景。
工作流程
第一步:识别链接类型(必须先做)
- 若 URL 含
/sheets/:判定为电子表格。 - 若 URL 含
/wiki/、/docx/、/docs/:判定为文档。
第二步:按类型分支处理
A. 电子表格(/sheets/)
电子表格不做标题识别,直接下载整表:
npx -y lark-docx2md@latest dl --agent local --url "<url>"B. 文档(/wiki/、/docx/、/docs/)
先从用户请求中识别
title:- 显式关键词「标题/章节/小节/部分/节选/只要/其中的」+ 名词短语。
- 成对引号
""''“”‘’「」《》包裹的短文本。 - 介词结构:
X 中的 Y、X 里的 Y、X 那一段、关于 X 的内容。 - 多级路径:
A 下/中/里的 B、A > B、A/B、A → B→ 取为有序路径[A, B, ...]。
抽到的标题文本:去首尾空白与包裹引号;保留原文大小写、标点、空格、中英文;不翻译/改写/补全。
- 如果成功识别到
title,则需要进一步获取<blockId>:
npx -y lark-docx2md@latest get-titles --agent local --url "<url>"根据 get-titles 输出的所有标题信息,匹配 title 获取对应的 <blockId>。若没有明确的匹配项或存在多个匹配项,则必须让用户参与决策。
- 根据识别结果查询:
有 <blockId>:
npx -y lark-docx2md@latest dl --agent local --filter-title-block-id "<blockId>" --url "<url>"无 <blockId>:
npx -y lark-docx2md@latest dl --agent local --url "<url>"读取结果
从 dl 的 stdout 解析 Markdown 绝对路径并读取该文件;同时必须读取其中引用的所有图片(含画板内图片,路径形如 static/xxx.png)。
重要事项
dl必须带--agent local;get-titles必须带--agent local。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

