pdf-to-markdown by duc01226/easyplatform
npx skills add https://github.com/duc01226/easyplatform --skill pdf-to-markdown[IMPORTANT] 在开始前务必使用
TaskCreate将所有工作拆分为小任务——包括每个文件的读取任务。这可以防止因处理长文件而丢失上下文。对于简单任务,AI 必须询问用户是否跳过。
目标: 将 PDF 文件转换为格式良好的 Markdown,并自动检测原生文本与扫描文档。
工作流程:
scripts/convert.cjs关键规则:
--mode auto(默认)让工具决定使用原生模式还是 OCR 模式tesseract.js 设置保持怀疑态度。运用批判性思维、顺序性思维。每个主张都需要可追溯的证据,并给出置信度百分比(想法应超过 80%)。
将 PDF 文件转换为 Markdown 格式,自动检测原生文本与扫描文档。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
此技能需要 npm 依赖项。 运行以下命令之一:
# 选项 1:通过 ClaudeKit CLI 安装(推荐)
ck init # 运行 install.sh 以处理所有技能
# 选项 2:手动安装
cd .claude/skills/pdf-to-markdown
npm install
依赖项: @opendocsg/pdf2md(原生 PDF),pdfjs-dist(PDF 解析)
注意: 扫描版 PDF 的 OCR 需要额外设置(见 OCR 部分)。
# 基本转换(自动检测原生或扫描)
node .claude/skills/pdf-to-markdown/scripts/convert.cjs --input ./document.pdf
# 指定输出路径
node .claude/skills/pdf-to-markdown/scripts/convert.cjs -i ./doc.pdf -o ./output.md
# 强制原生模式(跳过 OCR 检测)
node .claude/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"
}
}
如需支持扫描版 PDF,请安装额外的依赖项:
npm install tesseract.js pdfjs-dist canvas
注意: 在某些系统上,canvas 包可能需要构建工具。
重要任务规划说明(必须遵守)
每周安装数
361
代码仓库
GitHub 星标数
5
首次出现
2026年1月24日
安全审计
安装于
opencode331
codex328
gemini-cli325
github-copilot317
cursor311
amp303
[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.
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 setupBe skeptical. Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence percentages (Idea should be more than 80%).
Convert PDF files to Markdown format with automatic detection of native text vs scanned documents.
This skill requires npm dependencies. Run one of the following:
# Option 1: Install via ClaudeKit CLI (recommended)
ck init # Runs install.sh which handles all skills
# Option 2: Manual installation
cd .claude/skills/pdf-to-markdown
npm install
Dependencies: @opendocsg/pdf2md (native PDFs), pdfjs-dist (PDF parsing)
Note: OCR for scanned PDFs requires additional setup (see OCR section).
# Basic conversion (auto-detect native vs scanned)
node .claude/skills/pdf-to-markdown/scripts/convert.cjs --input ./document.pdf
# Specify output path
node .claude/skills/pdf-to-markdown/scripts/convert.cjs -i ./doc.pdf -o ./output.md
# Force native mode (skip OCR detection)
node .claude/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"
}
}
For scanned PDF support, install additional dependencies:
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
361
Repository
GitHub Stars
5
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode331
codex328
gemini-cli325
github-copilot317
cursor311
amp303
Google Workspace CLI 团队负责人技能:自动化站会、任务协调与团队沟通工具
6,300 周安装
Python类型注解模式指南:现代类型提示与Typing最佳实践
24 周安装
Web应用安全模式指南:OWASP Top 10防护、输入验证、身份认证与授权最佳实践
25 周安装
task-runner任务运行器:使用just简化项目命令执行,替代make的跨平台工具
30 周安装
EdgeOne Pages 一键部署:无需账户,秒级将HTML文件发布到公共URL
35 周安装
Vibe Security 安全扫描器 - 多语言代码漏洞检测与AI智能修复工具
38 周安装
wechat-publisher:一键发布Markdown文章到微信公众号草稿箱工具
323 周安装
Conversion mode: auto, native, ocr |
auto |
--help | -h | Show help message |