SKILL: OpenClaw PDF Supercharger with OpenDataLoader
0) Modular Map (.md)
To improve maintainability and allow targeted calls to specific .md files, this skill relies on helper documents:
- - CLI quick start: docs/quickstart-cli.md
- Security before install: docs/security-before-install.md
- OpenClaw ready profiles: docs/profiles-openclaw.md
- Hybrid + OCR: docs/hybrid-mode-ocr.md
- RAG and bounding-box citations: docs/rag-citations.md
- Troubleshooting: docs/troubleshooting.md
Usage rules:
- - If the task is setup/startup: load quickstart-cli.md
- Before any installation: load security-before-install.md
- If the task is command execution by scenario: load profiles-openclaw.md
- If the task involves scanned or complex table PDFs: load hybrid-mode-ocr.md
- If the task is RAG/citations: load rag-citations.md
- If there are errors: load troubleshooting.md
1) Goal
This skill maximizes PDF reading quality for OpenClaw in ClawHub using OpenDataLoader PDF.
Pillars:
- - Local extraction (no cloud) for privacy.
- High-quality reading order and structure (columns, tables, layout).
- RAG and LLM-ready outputs (json + markdown).
- Simple end-user flow (CLI, no MCP).
2) When to Use This Skill
Use this skill when the user needs to:
- - Extract clean text from PDFs.
- Improve table and multi-column parsing.
- Prepare data for RAG, embeddings, or coordinate-based citations.
- Process scanned PDFs with OCR.
- Describe images/charts to make them searchable.
Do not use this skill for:
- - OCR of standalone image files outside PDF workflows.
- Cloud-only pipelines where local Java execution is not allowed.
3) Core Architecture Rule (No MCP)
Since the MCP does not exist yet, this skill must operate with CLI only:
- - Client command: opendataloader-pdf
- Hybrid backend command: opendataloader-pdf-hybrid
Do not create complex wrappers or intermediate services unless strictly needed.
4) Robust Prerequisites
Always validate before conversion:
- - Java 11+ in PATH.
- Python 3.10+.
- Package install policy:
- Do not use unpinned installs in production.
- Use isolated environments (venv/container/VM).
- Prefer pinned versions and verified sources.
- See: docs/security-before-install.md
Quick checks:
- - java -version
- pip index versions opendataloader-pdf
- pip show opendataloader-pdf
- opendataloader-pdf --help
If Java fails on Windows, reopen the terminal and verify PATH.
5) Standard OpenClaw Operating Flow
Step A: Classify user intent
- 1. General reading/summary -> markdown
- RAG with metadata and citations -> json,markdown
- Complex tables or scanned PDF -> hybrid docling-fast
- Charts with image descriptions -> hybrid + hybrid-mode full + enrich-picture-description
Step B: Run in batches (required)
Always process multiple files in a single invocation to avoid JVM startup overhead per call.
Recommended example:
opendataloader-pdf file1.pdf file2.pdf ./folder/ -o ./output -f json,markdown
Step C: Return a simple OpenClaw response format
Suggested response:
- 1. Status: ok or warning
- Processed files
- Output path
- Generated formats
- Suggested next action
Template:
"Processing completed. N PDFs were converted to ./output with json,markdown format. If you want, I can now extract specific pages or enable OCR for scanned files."
6) Ready-to-Use CLI Profiles
Profile 1: Fast LLM reading
opendataloader-pdf ./pdfs/ -o ./output -f markdown
Profile 2: Recommended for RAG
opendataloader-pdf ./pdfs/ -o ./output -f json,markdown
Profile 3: Specific pages only
opendataloader-pdf report.pdf -o ./output -f json --pages "1,3,5-7"
Profile 4: Sensitive data sanitization
opendataloader-pdf report.pdf -o ./output -f markdown --sanitize
Profile 5: Preserve line breaks
opendataloader-pdf report.pdf -o ./output -f markdown --keep-line-breaks
Profile 6: Embedded or external images
opendataloader-pdf report.pdf -o ./output -f json --image-output external
opendataloader-pdf report.pdf -o ./output -f json --image-output embedded
7) High-Precision Hybrid Mode
Use it when:
- - Tables are complex or borderless.
- PDFs are scanned.
- Multi-language OCR is required.
- Image/chart descriptions are required.
7.1 Start backend
Standard:
opendataloader-pdf-hybrid --port 5002
Forced OCR:
opendataloader-pdf-hybrid --port 5002 --force-ocr
Multi-language OCR:
opendataloader-pdf-hybrid --port 5002 --force-ocr --ocr-lang "es,en"
With image descriptions:
opendataloader-pdf-hybrid --port 5002 --enrich-picture-description
7.2 Use backend from client
Hybrid auto mode:
opendataloader-pdf --hybrid docling-fast file1.pdf file2.pdf ./folder/ -o ./output -f json,markdown
With timeout and fallback:
opendataloader-pdf --hybrid docling-fast --hybrid-timeout 120000 --hybrid-fallback file1.pdf ./folder/ -o ./output -f json
Image descriptions enabled (full required):
opendataloader-pdf --hybrid docling-fast --hybrid-mode full file1.pdf ./folder/ -o ./output -f json,markdown
Critical note:
If the backend starts with --enrich-picture-description, the client must use --hybrid-mode full to include descriptions in output.
8) Key Robustness Parameters
- - -f, --format: json, text, html, pdf, markdown, markdown-with-html, markdown-with-images
- --pages: page range (example: "1,3,5-7")
- --sanitize: anonymizes emails, phone numbers, IPs, cards, and URLs
- --reading-order xycut: keeps proper column reading order (recommended default)
- --use-struct-tree: improves extraction on tagged PDFs
- --table-method cluster: improves complex table detection
- --hybrid-url: backend endpoint (local by default)
- --hybrid-timeout: timeout in milliseconds (0 = no timeout)
- --hybrid-fallback: continue with Java mode if backend fails
9) Decision Matrix for OpenClaw
- 1. If the user wants speed and clean text: markdown.
- If precise positional citations are needed: json (with bounding box) or json,markdown.
- If output is empty/poor on scanned files: backend with --force-ocr.
- If tables are very complex: enable --hybrid docling-fast.
- If charts must be interpreted: backend with --enrich-picture-description and client with --hybrid-mode full.
10) Quick Troubleshooting
Problem: Java not found.
Solution: install Java 11+ and verify with java -version.
Problem: Hybrid backend connection error.
Solution: start opendataloader-pdf-hybrid in another terminal and verify port 5002.
Problem: Too slow.
Solution: process in batches, increase hybrid timeout, and verify backend RAM.
Problem: Mixed columns.
Solution: use default reading mode (xycut) and try --use-struct-tree for tagged PDFs.
Problem: Poor table quality.
Solution: use json output + hybrid mode.
11) Best Practices for ClawHub
- - Prioritize simple, predictable commands.
- Answer users with short, actionable steps.
- Recommend json,markdown as default for assistants and RAG.
- Keep safety filters enabled (do not disable content safety unless explicitly requested).
- Store output in run-specific folders for traceability.
12) Skill Quality Checklist
- - CLI-only architecture defined (no MCP).
- Clear installation and prerequisites.
- Execution profiles ready to copy/paste.
- Full hybrid flow with OCR and image descriptions.
- Fallback and troubleshooting strategy.
- Simple communication format for OpenClaw.
13) Credits
This skill uses and credits the excellent OpenDataLoader project:
https://opendataloader.org/
Official documentation used for this version:
https://opendataloader.org/docs
技能名称: pdf-extract-skill
详细描述:
技能:OpenClaw PDF 增强器(集成 OpenDataLoader)
0) 模块化地图 (.md)
为提高可维护性并允许针对特定 .md 文件进行调用,本技能依赖以下辅助文档:
- - CLI 快速入门:docs/quickstart-cli.md
- 安装前安全须知:docs/security-before-install.md
- OpenClaw 就绪配置文件:docs/profiles-openclaw.md
- 混合模式 + OCR:docs/hybrid-mode-ocr.md
- RAG 与边界框引用:docs/rag-citations.md
- 故障排除:docs/troubleshooting.md
使用规则:
- - 如果任务是设置/启动:加载 quickstart-cli.md
- 在任何安装之前:加载 security-before-install.md
- 如果任务是按场景执行命令:加载 profiles-openclaw.md
- 如果任务涉及扫描件或复杂表格 PDF:加载 hybrid-mode-ocr.md
- 如果任务是 RAG/引用:加载 rag-citations.md
- 如果出现错误:加载 troubleshooting.md
1) 目标
本技能旨在通过 OpenDataLoader PDF,最大化 ClawHub 中 OpenClaw 的 PDF 读取质量。
核心支柱:
- - 本地提取(非云端)以保护隐私。
- 高质量的阅读顺序与结构(分栏、表格、布局)。
- 面向 RAG 和 LLM 的输出(json + markdown)。
- 简单的终端用户流程(CLI,无需 MCP)。
2) 何时使用本技能
当用户需要以下操作时,使用本技能:
- - 从 PDF 中提取纯净文本。
- 改进表格和多栏解析。
- 为 RAG、嵌入或基于坐标的引用准备数据。
- 使用 OCR 处理扫描版 PDF。
- 描述图像/图表以使其可搜索。
以下情况请勿使用本技能:
- - 对 PDF 工作流之外的独立图像文件进行 OCR。
- 仅限云端且不允许本地 Java 执行的流程。
3) 核心架构规则(无 MCP)
由于 MCP 尚不存在,本技能必须仅通过 CLI 运行:
- - 客户端命令:opendataloader-pdf
- 混合后端命令:opendataloader-pdf-hybrid
除非严格必要,否则不要创建复杂的包装器或中间服务。
4) 稳健的先决条件
在转换前务必验证:
- - PATH 中包含 Java 11+。
- Python 3.10+。
- 包安装策略:
- 生产环境中不要使用未固定版本的安装。
- 使用隔离环境(venv/容器/虚拟机)。
- 优先使用固定版本和经过验证的源。
- 参见:docs/security-before-install.md
快速检查:
- - java -version
- pip index versions opendataloader-pdf
- pip show opendataloader-pdf
- opendataloader-pdf --help
如果在 Windows 上 Java 失败,请重新打开终端并验证 PATH。
5) 标准 OpenClaw 操作流程
步骤 A:分类用户意图
- 1. 通用阅读/摘要 -> markdown
- 带元数据和引用的 RAG -> json,markdown
- 复杂表格或扫描版 PDF -> hybrid docling-fast
- 带图像描述的图表 -> hybrid + hybrid-mode full + enrich-picture-description
步骤 B:批量运行(必需)
始终在单次调用中处理多个文件,以避免每次调用的 JVM 启动开销。
推荐示例:
opendataloader-pdf file1.pdf file2.pdf ./folder/ -o ./output -f json,markdown
步骤 C:返回简单的 OpenClaw 响应格式
建议的响应:
- 1. 状态:ok 或 warning
- 已处理的文件
- 输出路径
- 生成的格式
- 建议的下一步操作
模板:
处理完成。N 个 PDF 已转换为 ./output,格式为 json,markdown。如果需要,我现在可以提取特定页面或为扫描文件启用 OCR。
6) 即用型 CLI 配置文件
配置文件 1:快速 LLM 读取
opendataloader-pdf ./pdfs/ -o ./output -f markdown
配置文件 2:推荐用于 RAG
opendataloader-pdf ./pdfs/ -o ./output -f json,markdown
配置文件 3:仅特定页面
opendataloader-pdf report.pdf -o ./output -f json --pages 1,3,5-7
配置文件 4:敏感数据脱敏
opendataloader-pdf report.pdf -o ./output -f markdown --sanitize
配置文件 5:保留换行符
opendataloader-pdf report.pdf -o ./output -f markdown --keep-line-breaks
配置文件 6:嵌入或外部图像
opendataloader-pdf report.pdf -o ./output -f json --image-output external
opendataloader-pdf report.pdf -o ./output -f json --image-output embedded
7) 高精度混合模式
在以下情况下使用:
- - 表格复杂或无边框。
- PDF 为扫描件。
- 需要多语言 OCR。
- 需要图像/图表描述。
7.1 启动后端
标准:
opendataloader-pdf-hybrid --port 5002
强制 OCR:
opendataloader-pdf-hybrid --port 5002 --force-ocr
多语言 OCR:
opendataloader-pdf-hybrid --port 5002 --force-ocr --ocr-lang es,en
带图像描述:
opendataloader-pdf-hybrid --port 5002 --enrich-picture-description
7.2 从客户端使用后端
混合自动模式:
opendataloader-pdf --hybrid docling-fast file1.pdf file2.pdf ./folder/ -o ./output -f json,markdown
带超时和回退:
opendataloader-pdf --hybrid docling-fast --hybrid-timeout 120000 --hybrid-fallback file1.pdf ./folder/ -o ./output -f json
启用图像描述(需要 full 模式):
opendataloader-pdf --hybrid docling-fast --hybrid-mode full file1.pdf ./folder/ -o ./output -f json,markdown
关键说明:
如果后端使用 --enrich-picture-description 启动,客户端必须使用 --hybrid-mode full 才能在输出中包含描述。
8) 关键稳健性参数
- - -f, --format:json, text, html, pdf, markdown, markdown-with-html, markdown-with-images
- --pages:页码范围(示例:1,3,5-7)
- --sanitize:匿名化电子邮件、电话号码、IP、卡号和 URL
- --reading-order xycut:保持正确的分栏阅读顺序(推荐默认值)
- --use-struct-tree:改善带标签 PDF 的提取效果
- --table-method cluster:改善复杂表格检测
- --hybrid-url:后端端点(默认本地)
- --hybrid-timeout:超时时间(毫秒,0 表示无超时)
- --hybrid-fallback:如果后端失败,继续使用 Java 模式
9) OpenClaw 决策矩阵
- 1. 如果用户需要速度和纯净文本:markdown。
- 如果需要精确的位置引用:json(带边界框)或 json,markdown。
- 如果扫描文件输出为空/质量差:后端配合 --force-ocr。
- 如果表格非常复杂:启用 --hybrid docling-fast。
- 如果必须解释图表:后端配合 --enrich-picture-description,客户端配合 --hybrid-mode full。
10) 快速故障排除
问题:找不到 Java。
解决方案:安装 Java 11+ 并使用 java -version 验证。
问题:混合后端连接错误。
解决方案:在另一个终端中启动 opendataloader-pdf-hybrid 并验证端口 5002。
问题:速度太慢。
解决方案:批量处理,增加混合超时时间,并验证后端内存。
问题:混合列。
解决方案:使用默认读取模式 (xycut) 并尝试为带标签的 PDF 使用 --use-struct-tree。
问题:表格质量差。
解决方案:使用 json 输出 + 混合模式。
11) ClawHub 最佳实践
- - 优先使用简单、可预测的命令。
- 用简短、可操作的步骤回答用户。
- 推荐将 json,markdown 作为助手和 RAG 的默认格式。
- 保持安全过滤器启用(除非明确要求,否则不要禁用内容安全)。
- 将输出存储在特定于运行的文件夹中,以便追溯。
12) 技能质量检查清单
- - 定义了仅 CLI 的架构(无 MCP)。
- 清晰的安装和先决条件。
- 可复制粘贴的执行配置文件。
- 包含 OCR 和图像描述的