/superRA:mistral-pdf-to-markdownfrom superRA
Converts PDFs to Markdown via Mistral OCR API, preserving structure and extracting embedded images. Works on scanned and image-based PDFs.
Ships in superRA. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Convert PDF documents to Markdown via Mistral's OCR API, preserving headers and structure and extracting embedded images. OCR makes it work on scanned, image-based PDFs.
<skill-dir> in the commands below is the directory containing this SKILL.md — substitute the real path.
# Convert entire PDF
uv run --script <skill-dir>/scripts/convert_pdf_to_markdown.py input.pdf output.md
# Convert specific pages
uv run --script <skill-dir>/scripts/convert_pdf_to_markdown.py input.pdf output.md --pages "1-5"
uv run --script <skill-dir>/scripts/convert_pdf_to_markdown.py input.pdf output.md --pages "1,3,5"
Each conversion is a self-contained folder. Passing Output/PDFConversions/paper_alpha.md creates Output/PDFConversions/paper_alpha/paper_alpha.md, with extracted images beside it under images/ as JPEGs, referenced relatively:
Output/PDFConversions/
├── paper_alpha/
│ ├── paper_alpha.md # references images/img-N.jpeg
│ └── images/
│ ├── img-0.jpeg
│ └── img-1.jpeg
└── paper_beta/
├── paper_beta.md
└── images/
├── img-0.jpeg
└── ...
An existing foldered markdown path such as Output/PDFConversions/paper_alpha/paper_alpha.md is kept as given. A directory creates <directory>/<input-pdf-stem>.md.
from pathlib import Path
import subprocess
# Run conversion script
result = subprocess.run([
"uv", "run", "--script",
"<skill-dir>/scripts/convert_pdf_to_markdown.py",
"input.pdf",
"Output/PDFConversions/output.md",
"--pages", "1-10"
], capture_output=True, text=True)
print(result.stdout)
A Mistral API key (below), plus mistralai, python-dotenv, pypdf, and pyyaml — declared inline in the script's PEP 723 header.
The script checks these locations in order (first match wins):
MISTRAL_API_KEY — recommended for personal use (e.g. export MISTRAL_API_KEY=your-key in secrets.sh).claude/agent-contract.yaml or ~/.config/agent-contract/config.yaml under paper-reader.mistral_api_keyNotes/.env — add MISTRAL_API_KEY=your-key; gitignored but Dropbox-synced, so it travels with a shared project folderNever commit API keys to git. Use environment variables or Dropbox-synced
Notes/.envinstead.
API Key Not Found:
Error: Mistral API key not found
→ Configure it per API Key Setup above
Page Out of Range:
Warning: Page 100 out of range, skipping
→ Check the PDF page count and adjust the page selection
API Rate Limit: → Retry after a moment, or reduce the page count per request
--pages.pdf skill instead for local manipulation and plain text extraction with no OCR or API calls.references/reference.md for the OCR API surface, programmatic and batch usage, cost, and troubleshooting.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub fuzhiyu/superra --plugin superRA22 skills in this plugin
/academic-writingUse by default for .tex sources. In other formats, use for publication-quality writing such as manuscripts, exhibit notes, footnotes, appendices, and response letters. Covers proofreading, polishing, drafting, reviewing, and citation or consistency checks./agent-orchestrationCoordinate superRA agents and handoffs. Requires superRA:using-superra. Use to dispatch roles, run parallel agents, choose reviewers, or preserve workflow state./communicateCommunication discipline for writing, rewriting, distilling, and reviewing any text meant for human reading, including conversation, task files, planning updates, results, reports, reviews, handoffs, documentation, and interactive HTML pages. Use for every message or artifact a human will read; Must load for superRA who produces human-facing text./econ-data-analysisEconomic data-analysis discipline. Use for importing, cleaning, merging, filtering, variables, aggregation, summary stats, regressions, or figures on economic, financial, or panel data./handoff-docDEPRECATED. Redirects to task-tree and the role skills./implement-taskImplementer role protocol for a superRA task — execute the objective, self-check, write results into the task file, commit, and return status. Load when a dispatch assigns you an implementer seat or when you fill one yourself.Other plugins' skills for the same job