with one click
pdfmd
将 PDF 文件转换为结构化的中文 Markdown 文本。只在用户明确要求“把 PDF 转成 Markdown/MD/文档”时使用本技能。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
将 PDF 文件转换为结构化的中文 Markdown 文本。只在用户明确要求“把 PDF 转成 Markdown/MD/文档”时使用本技能。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | pdfmd |
| description | 将 PDF 文件转换为结构化的中文 Markdown 文本。只在用户明确要求“把 PDF 转成 Markdown/MD/文档”时使用本技能。 |
| allowed-tools | ["Bash","Write"] |
| triggers | [{"type":"keyword","keywords":["pdf 转 markdown","pdf 转 md","pdf 转 文本","把 pdf 变成 markdown","把 pdf 变成 md","从 pdf 中提取内容"]}] |
当出现以下任一情况时,可以考虑启用本 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 明显缺失内容或大量乱码: