pdf-to-markdown by andreadellacorte/groove
npx skills add https://github.com/andreadellacorte/groove --skill pdf-to-markdown[IMPORTANT] 在开始前,使用
TaskCreate将所有工作分解为小任务——包括每个文件读取任务。这可以防止因处理长文件而丢失上下文。对于简单任务,AI 必须询问用户是否跳过。
目标: 将 PDF 文件转换为格式良好的 Markdown,并自动检测原生文本与扫描文档。目前仅实现了原生文本转换;OCR 功能计划中。
工作流程:
scripts/convert.cjs关键规则:
--mode auto(默认)让工具决定使用原生转换还是 OCRtesseract.js 设置将 PDF 文件转换为 Markdown 格式,并自动检测原生文本与扫描文档。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
此技能仅使用 Node.js 运行;仓库中没有 node_modules。它首次使用时通过 npx 运行 @opendocsg/pdf2md(由 npx 缓存)。可选:在技能目录中运行 npm install 以便无需 npx 即可更快地运行。
要求: Node.js ≥18,npx(包含在 npm 中)。
# 基本转换(自动检测原生或扫描)
node .agents/skills/pdf-to-markdown/scripts/convert.cjs --input ./document.pdf
# 指定输出路径
node .agents/skills/pdf-to-markdown/scripts/convert.cjs -i ./doc.pdf -o ./output.md
# 强制原生模式(跳过 OCR 检测)
node .agents/skills/pdf-to-markdown/scripts/convert.cjs -i ./doc.pdf --mode native
| 选项 | 简写 | 描述 | 默认值 |
|---|---|---|---|
--input | -i | 输入 PDF 文件路径 | (必填) |
--output | -o | 输出 markdown 文件路径 | {input}.md |
--mode | -m | 转换模式:auto、native、ocr | auto |
--help | -h | 显示帮助信息 |
检查 PDF 第一页是否有可提取的文本。如果找到文本,则使用原生提取,否则回退到 OCR 警告。
快速直接文本提取。最适合包含可选文本(非扫描图像)的 PDF。
用于扫描文档。当前未实现 - 如果 PDF 看起来是扫描件,技能会通知您。
成功时返回 JSON:
{
"success": true,
"input": "/path/to/input.pdf",
"output": "/path/to/output.md",
"stats": {
"pages": 5,
"mode": "native"
}
}
OCR 模式已集成到技能中但尚未实现。如果您想准备环境或自行扩展,请安装 OCR 依赖项以便 Node 可以解析它们:
cd .agents/skills/pdf-to-markdown
npm install tesseract.js pdfjs-dist canvas
注意: canvas 包在某些系统上可能需要构建工具。
重要任务规划说明(必须遵守)
每周安装次数
40
仓库
GitHub 星标数
4
首次出现
7 天前
安全审计
安装于
gemini-cli40
github-copilot40
codex40
kimi-cli40
cursor40
amp40
[IMPORTANT] Use
TaskCreateto break ALL work into small tasks BEFORE starting — including tasks for each file read. This prevents context loss from long files. For simple tasks, AI MUST ask user whether to skip.
Goal: Convert PDF files to well-formatted Markdown with auto-detection of native text vs scanned documents. Only native-text conversion is implemented; OCR is planned.
Workflow:
scripts/convert.cjs with input path and optional mode/output flagsKey Rules:
--mode auto (default) to let the tool decide native vs OCRtesseract.js setupConvert PDF files to Markdown format with automatic detection of native text vs scanned documents.
The skill runs with Node.js only ; no node_modules in the repo. It uses npx to run @opendocsg/pdf2md on first use (cached by npx). Optional: run npm install in the skill directory for faster runs without npx.
Requirements: Node.js ≥18, npx (included with npm).
# Basic conversion (auto-detect native vs scanned)
node .agents/skills/pdf-to-markdown/scripts/convert.cjs --input ./document.pdf
# Specify output path
node .agents/skills/pdf-to-markdown/scripts/convert.cjs -i ./doc.pdf -o ./output.md
# Force native mode (skip OCR detection)
node .agents/skills/pdf-to-markdown/scripts/convert.cjs -i ./doc.pdf --mode native
| Option | Short | Description | Default |
|---|---|---|---|
--input | -i | Input PDF file path | (required) |
--output | -o | Output markdown file path | {input}.md |
--mode | -m |
Checks if PDF has extractable text on first page. Uses native extraction if text found, otherwise falls back to OCR warning.
Fast direct text extraction. Best for PDFs with selectable text (not scanned images).
For scanned documents. Currently not implemented - the skill will notify you if a PDF appears to be scanned.
Returns JSON on success:
{
"success": true,
"input": "/path/to/input.pdf",
"output": "/path/to/output.md",
"stats": {
"pages": 5,
"mode": "native"
}
}
OCR mode is wired into the skill but not yet implemented. If you want to prepare your environment or extend it yourself, install the OCR dependencies so Node can resolve them:
cd .agents/skills/pdf-to-markdown
npm install tesseract.js pdfjs-dist canvas
Note: The canvas package may require build tools on some systems.
IMPORTANT Task Planning Notes (MUST FOLLOW)
Weekly Installs
40
Repository
GitHub Stars
4
First Seen
7 days ago
Security Audits
Gen Agent Trust HubPassSocketWarnSnykWarn
Installed on
gemini-cli40
github-copilot40
codex40
kimi-cli40
cursor40
amp40
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
44,900 周安装
Conversion mode: auto, native, ocr |
auto |
--help | -h | Show help message |