aminer-pdf-ocr
Skill81 starsChanged 7 days agoMITView on GitHub
[Activation] Use when the user provides a PDF and requests OCR, Markdown conversion, or structured experiment extraction. [Scope] Submit the PDF to the AMiner PDF OCR open platform (`/api/v3/paper/pdfocr/*`), poll the asynchronous job, download and unpack its ZIP, then let the Agent extract experiments from result.md using references/experiment_prompt.md. [Routing] Use pdf-citation-verifier for citation verification and aminer-academic-search / aminer-free-academic for literature search.
- Reads credentials
In this repository21 other files it gives its agents.
- aminer-academic-searchSkill
- aminer-daily-paperSkill
- aminer-deep-searchSkill
- aminer-experiment-to-paperSkill
- aminer-exp-extractionSkill
- aminer-free-academicSkill
- aminer-grant-applicationSkill
- aminer-paper-deep-readingSkill
- aminer-paper-writingSkill
- aminer-patent-tech-intelligenceSkill
- aminer-thesis-writingSkill
- aminer-topic-advisor-selectionSkill
- baseline-finderSkill
- citation-faithfulnessSkill
- deep-researchSkill
- paper-source-traceSkill
- pdf-citation-verifierSkill
- related-work-auditSkill
- scientific-taxonomySkill
- sota-finderSkill
- structured-reference-auditSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
Do not use success, HTTP status, or code alone to decide success.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PDF OCR + Experiment Extraction
The Python wrapper validates a PDF, uploads it to the AMiner PDF OCR open platform, handles queue backoff, polls the asynchronous job, downloads the temporary result ZIP, and writes compatible local artifacts. The Agent then reads result.md and follows references/experiment_prompt.md to create experiments.json.
Pre-flight
- Confirm
AMINER_API_KEYexists (same token as other AMiner skills). If missing, stop and send the user to https://open.aminer.cn/open/board?tab=control. Never print its value.OPEN_PLATFORM_TOKENis accepted only as a deprecated fallback. - Install
requestsandpypdffromrequirements.txt. - Confirm the input is a local PDF or an HTTP(S) URL. The open platform accepts only unencrypted PDFs of 1-30 pages and at most 10 MiB. Refuse localhost / private-network URLs.
Run
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/ocr.py" --input "/abs/path/to/paper.pdf"Options include --output-dir, --request-timeout, --poll-timeout, --max-upload-attempts, --no-save-images, and --output. The old local parser, backend, page-range, formula, and table options are not supported.
API contract
- Endpoints:
POST /api/v3/paper/pdfocr/uploadandGET /api/v3/paper/pdfocr/resultonhttps://datacenter.aminer.cn/gateway/open_platform. - Upload and polling use the same token (
AMINER_API_KEY) and sendAuthorization,X-Platform(current host:claude-code/cursor/codex/openclaw;unknownif it cannot be determined),X-Skill-Name: aminer-pdf-ocr, andX-Skill-Version(this file's frontmatterversion). - Upload
code: 202means queued, not completed. A reused upload may returncode: 200; always use its returnedjob_id. - Do not use
success, HTTP status, orcodealone to decide success. Inspectdata.statusanddata.is_finish. preparing,queued, andrunningare polled.successdownloads the ZIP.failed,timeout,queue_timeout,expired, andunknownstop.data.queue_fullis retried with bounded backoff usingretry_after_seconds.- The temporary download URL is fetched directly without Authorization and is not saved in
response.json. - ZIP entries are discovered by
.mdand_middle.jsonsuffixes;document/is not a protocol.
Experiment extraction
Unless OCR-only is explicitly requested, read the complete result.md, follow references/experiment_prompt.md, write one JSON object to experiments.json, and show the same full JSON in the response. Do not add justification fields or invent unsupported experiments, datasets, metrics, or scores. If OCR fails, report the error and do not fabricate extraction output.
Real example
The default local sample is data/pdf/applsci-14-11736.pdf (untracked; place it yourself). The live test is opt-in: set RUN_PDFOCR_LIVE=1 together with AMINER_API_KEY. It is skipped by default and never runs without both the credential and fixture.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

