neuromechanist/research-skills/document-processing

Claude Code and agent skill by neuromechanist/research-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

This skill should be used when the user says \"process documents\", \"extract text from PDF\", \"OCR this document\", \"convert PDF to markdown\", \"extract emails from documents\", \"parse document\", \"document conversion\", \"batch OCR\", \"extract structured data from PDF\", \"read PDF\", \"extract tables from PDF\", \"convert Word document\", \"convert docx to markdown\", or wants to extract, convert, or process documents and scanned images.

Install

npx vskill@latest install neuromechanist/research-skills/document-processing

SKILL.md

Document Processing

Extract, convert, and structure content from PDFs, images, and other document formats. Handles OCR, text extraction, markdown conversion, email extraction, and structured data output.

When to Use

  • Converting scanned documents to searchable text
  • Extracting text from PDFs (native or scanned)
  • Converting documents to markdown for further processing
  • Extracting emails, addresses, or other structured data from documents
  • Batch processing document collections

Processing Pipeline

Step 1: Identify Document Type

Determine the processing approach:

InputMethodTool
Native PDF (has text layer)Direct extractionpdftotext, pymupdf
Scanned PDF (images only)OCRMistral OCR API, tesseract
Image files (PNG, JPG, TIFF)OCRMistral OCR API, tesseract
Word documents (.docx)Conversionpython-docx, pandoc
HTMLConversionpandoc, beautifulsoup4

Detection:

bash
# Check if PDF has text content
pdftotext input.pdf - | head -20
# If output is empty or garbled, it's a scanned PDF -> use OCR
Step 2: Extract Content
Native PDF Extraction
python
import pymupdf
doc = pymupdf.open("input.pdf")
for page in doc:
text = page.get_text("markdown") # or "text", "html"
print(text)
OCR with Mistral (for scanned documents)

Requires MISTRAL_API_KEY environment variable. Falls back to tesseract for offline processing if unavailable.

python
import base64
import httpx
def ocr_page(image_path: str, api_key: str) -> str:
with open(image_path, "rb") as f:
image_data = base64.b64encode(f.read()).decode()
response = httpx.post(
"https://api.mistral.ai/v1/chat/completions",
headers={"Authorization": f"Bearer {api_key}"},
json={
"model": "mistral-ocr-latest",
"messages": [{
"role": "user",
"content": [
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{image_data}"}},
{"type": "text", "text": "Extract all text from this image. Preserve formatting, tables, and structure. Output as markdown."}
]
}]
}
)
return response.json()["choices"][0]["message"]["content"]
OCR with Tesseract (offline fallback)
bash
# Single page
tesseract input.png output -l eng --oem 3 --psm 6
# PDF to text via tesseract
pdftoppm input.pdf page -png
for f in page-*.png; do tesseract "$f" "${f%.png}" -l eng; done
cat page-*.txt > output.txt
Step 3: Structure Output

Convert extracted text to structured formats:

Markdown cleanup
  • Fix OCR artifacts (broken words, spurious line breaks)
  • Reconstruct tables from aligned text
  • Identify headers from font size/weight changes
  • Preserve list formatting
Structured data extraction
python
# Extract emails
import re
emails = re.findall(r'[\w.+-]+@[\w-]+\.[\w.]+', text)
# Extract dates
dates = re.findall(r'\b\d{1,2}[/-]\d{1,2}[/-]\d{2,4}\b', text)
# Extract phone numbers
phones = re.findall(r'\b\d{3}[-.]?\d{3}[-.]?\d{4}\b', text)
Step 4: Output

Save results in the requested format:

  • Markdown (.md) - default for text content
  • JSON - for structured data extraction
  • Plain text (.txt) - for simple text extraction

Batch Processing

For document collections:

bash
# Process all PDFs in a directory
for pdf in /path/to/docs/*.pdf; do
name=$(basename "$pdf" .pdf)
pdftotext "$pdf" "/path/to/output/${name}.txt"
done

For large collections, track progress:

  1. Create a manifest of input files
  2. Process each file, recording success/failure
  3. Report summary (processed, failed, skipped)

Quality Checks

After extraction, verify:

  • [ ] Text is readable (not garbled encoding)
  • [ ] Tables preserved their structure
  • [ ] No pages were skipped
  • [ ] Special characters rendered correctly
  • [ ] Headers and sections identified

Additional Resources

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/neuromechanist/research-skills/document-processing/badge)](https://verified-skill.com/skills/neuromechanist/research-skills/document-processing)

Something wrong with this skill or its page? Tell us.