Convert PDF files into structured Chinese Markdown text. Use this skill only when the user explicitly requests 'convert PDF to Markdown/MD/document'.
当出现以下任一情况时,可以考虑启用本 Skill:
如果用户只是一般性阅读 / 总结 PDF,而不要求导出 Markdown,可以直接阅读 PDF 文本或使用其他技能。
在当前示例项目中,本 Skill 所在目录如下:
workspace/
skills/
pdfmd/
SKILL.md
pdf_extract.py
其中:
SKILL.md 为本说明文件pdf_extract.py 是一个 Python 脚本,仅负责从 PDF 中提取纯文本(不调用任何大模型),
再由当前 Agent 使用已有的大模型配置完成翻译和 Markdown 转换。注意:本 Skill 假设在执行环境中已经安装了 Python 以及依赖:
pypdf
当你判断应当使用本 Skill 时,请按以下顺序操作:
确认 PDF 文件路径
docs/report.pdf),先确认该路径在当前工作区内。./docs/),并记住实际路径。选择输出路径
docs/report.pdfdocs/report.md使用 Bash 调用 Python 脚本提取 PDF 文本
使用 Bash 工具执行 Python 脚本来读取 PDF 内容,例如(注意:命令在沙箱工作目录 workspace/ 下执行,因此路径从 skills/ 开始):
python skills/pdfmd/pdf_extract.py \
--input "<PDF 文件路径>" \
--pages "<页码范围,可选,如 1-3,5>"
说明:
--input:要读取的 PDF 文件路径(必填)--pages:可选页码范围,例如 "1-3,5"Bash 工具的返回中:
ok: 命令是否执行成功(exit code 为 0)output: 包含脚本的标准输出(即提取出的 PDF 文本)在当前对话中使用大模型进行转换
在拿到 Bash 的输出后,不需要在 Skill 或脚本中直接调用任何外部大模型 API。
而是:
output 字段中的内容视为原始 PDF 文本;所有大模型调用由 SDK 的 provider/router 统一负责,自动使用当前 Agent 配置好的模型和路由策略, Skill 不负责管理 API Key 或模型选择。
使用 Write 将 Markdown 保存到文件(如用户有此需求)
如果用户明确要求生成 Markdown 文件,可以在得到最终 Markdown 文本后,调用 Write 工具写入文件:
{
"path": "<输出 Markdown 文件路径>",
"content": "<模型生成的中文 Markdown 文本>"
}
然后可以通过正常的文件系统操作(如下载或后续处理)使用该文件。
根据用户需求做二次加工(可选)
若 Python 脚本执行失败(Bash 返回 ok == false 或 exit code 非 0):
pypdf 依赖。若生成的 Markdown 明显缺失内容或大量乱码:
Google Workspace CLI for Gmail, Calendar, Drive, Contacts, Sheets, and Docs.
Manage Apple Notes via the `memo` CLI on macOS (create, view, edit, delete, search, move, and export notes). Use when a user asks OpenClaw to add a note, list notes, search notes, or manage note folders.
Work with Obsidian vaults (plain Markdown notes) and automate via obsidian-cli.
Use when you need to control Slack from OpenClaw via the slack tool, including reacting to messages or pinning/unpinning items in Slack channels or DMs.
Manage Apple Reminders via remindctl CLI (list, add, edit, complete, delete). Supports lists, date filters, and JSON/plain output.
Manage Trello boards, lists, and cards via the Trello REST API.
Category:productivity