pdf-batch

pdf-batch is a skill for Claude Code, Codex from MrSGSA/math-modeling-skill-dify. It costs 82 tokens per session (740 once invoked), scanned A, original, MIT.

A batch converter for PDFs, Word documents, presentations, spreadsheets, and images. It creates Markdown for Dify text knowledge bases and packages original images for image-based search.

In plain words
What is it for?
Use it to prepare papers and other documents for Dify, preserve LaTeX formulas and source images, create multimodal packages, and produce conversion lists.
Why use it?
It converts many document types while retaining text, tables, formulas, and images, including scanned pages that need OCR, or optical character recognition.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/mrsgsa/math-modeling-skill-dify/pdf-batch
Any agent
npx skills add MrSGSA/math-modeling-skill-dify --skill pdf-batch
Clone the repo
git clone --depth 1 https://github.com/MrSGSA/math-modeling-skill-dify

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pdf-batch

README.md
[![agentmods](https://agentmods.dev/badge/skills/mrsgsa/math-modeling-skill-dify/pdf-batch.svg)](https://agentmods.dev/skills/mrsgsa/math-modeling-skill-dify/pdf-batch)
Your own site
<a href="https://agentmods.dev/skills/mrsgsa/math-modeling-skill-dify/pdf-batch"><img src="https://agentmods.dev/badge/skills/mrsgsa/math-modeling-skill-dify/pdf-batch.svg" alt="Measured on agentmods" height="20"></a>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 740 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00082 $0.00740
Opus 5 $0.00041 $0.00370
Sonnet 5 $0.00016 $0.00148
Haiku 4.5 $0.00008 $0.00074

Measured 4d ago against content hash e923c87ec376, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pdf-batch scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/batch_convert.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/math-modeling/tools/pdf-batch/SKILL.md · 46 lines

What it actually says

文档批量转 Markdown

调用 scripts/batch_convert.py 和 MinerU。保持输入文档只读,将结果写入 PROJECT_ROOT。旧式 .doc 先转换为 .docx

输入目录、Markdown 输出目录和多模态包输出目录必须彼此分离,既不能相同也不能互相嵌套;否则递归发现可能把上次产物再次当作输入,工具会拒绝运行。

环境与运行

MinerU 在 Windows 上要求 Python 3.10 至 3.12。本机默认 Python 可以用于启动批处理,但 MinerU 应使用 uv 建立的独立 Python 3.12 工具环境:

uv tool install --python 3.12 "mineru[all]"

安装体积较大,未经用户同意不要自动安装或下载模型。在 PROJECT_ROOT 中运行:

python <SKILL_ROOT>\tools\pdf-batch\scripts\batch_convert.py --input knowledge_inbox\pdf --output knowledge_ready

默认使用支持纯 CPU 的 pipeline 后端。可用 --backend auto 切换默认后端,--dry-run 只检查计划,--force 强制重新转换。

推荐单次高精度转换同时生成文本库与图片库成品:

python <SKILL_ROOT>\tools\pdf-batch\scripts\batch_convert.py --input <文档目录> --output <多模态包目录> --markdown-output <Markdown目录> --backend auto --effort high --image-analysis --dify-multimodal

此模式对每份文档只调用一次 MinerU,同时发布:

  • 纯 Markdown:保留公式和图表分析文字、移除无法上传的本地图片链接,用于现有文本知识库。
  • .dify-mm.zip:包含 manifest.jsondocument.md 和唯一命名的原图,用于配套 Dify 插件和统一多模态图片库。该包只索引含图片的块,正文仍由文本库负责。

只有两份成品都存在且不早于源文档时才跳过。中间 JSON、布局结果和临时目录在单篇完成后自动清理。

只需要一个 Markdown 时仍可使用 --md-only

输出与检查

  • 图片名包含源文档哈希、图序号和图片哈希;插件再按清单路径与 SHA-256 校验,避免跨论文串图。
  • 同名且同扩展名的源文档会在输出名中加入内容哈希,避免覆盖。
  • batch_report.json 记录源文件 SHA-256、命令、状态、耗时和输出。
  • dify_upload_list.txt 列出成功生成的 Markdown,供用户手动上传。
  • conversion.log 保存每篇文档的 MinerU 输出。

重复运行时跳过未变化且两份成品均已存在的文件。文本 Markdown 上传普通知识库;.dify-mm.zip 只上传统一多模态图片库。

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 46 lines · 82 tokens per session scan A e923c87ec376

Subscribe to this mod's changes

pdf-batch is a skill published in the GitHub repository MrSGSA/math-modeling-skill-dify (4 stars, last pushed 1mo ago), licensed MIT. It adds 82 tokens to every session and 740 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

markdown-exporter

Convert Markdown text to DOCX, PPTX, XLSX, PDF, PNG, SVG, HTML, IPYNB, MD, CSV, JSON, JSONL, XML files, and extract code blocks in Markdown to Python, Bash,JS and etc files.

bowenliang123/markdown-exporter · 57 tokens

liteparse

Parse documents into LLM-ready content entirely on the local machine — PDF / DOCX / XLSX / PPTX / images → Markdown, structured JSON (with bounding boxes), or page screenshots, via the lit CLI. No cloud, no LLM, works offline. Use whenever the user attaches or points to a document that must be read before reasoning…

Prismer-AI/PrismerCloud · 90 tokens

office-artifacts

Generate real DOCX, PPTX, XLSX, PDF, CSV files using python-docx / python-pptx / openpyxl / reportlab by writing them into the dispatch artifacts dir, then explicitly deliver each one with cloud deliver . Use whenever the user asks for documents, slides, spreadsheets, reports, or PDFs.

Prismer-AI/PrismerCloud · 75 tokens

cli-anything-wps

WPS Office CLI — JSON数据驱动PPT自动生成 + 命令行操控WPS文字/表格/演示文稿.

yb2460/harness-anything · 37 tokens

feishu-cli-docs

飞书文档统一入口,覆盖读取和分析 docx/wiki/sheet、创建与编辑文档、Markdown 导入、 docx/wiki/sheet 导出 Markdown/PDF/Word/Excel,以及云盘原生 .md 文件 CRUD。用户要求阅读、 总结、创建、追加、覆盖、替换或删除文档内容,把 Markdown 导入飞书并转换 Mermaid/PlantUML/SVG、 下载图片或导出本地文件、 比较、覆盖或查找替换原生 Markdown 时必须使用本 Skill。 本 Skill 只处理正文内容和文档/Markdown 文件转换。明确禁止用于文档评论、二进制文件导入、 云盘目录和权限管理,这些使用…

riba2534/feishu-cli · 212 tokens

doc-cleaner

Convert PDF, DOCX, XLSX, and text files to clean, structured Markdown. CJK-friendly, table-friendly, privacy-first.

notoriouslab/doc-cleaner · 32 tokens