extracting-pdfs — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited extracting-pdfs (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Extract PDF content to clean, organized markdown.
python /mnt/skills/user/extracting-pdfs/scripts/extract_pdf.py \
/mnt/user-data/uploads/{filename}.pdf \
/home/claude/extracted/For scanned PDFs or problematic extractions, use --method pymupdf. For page ranges, use --pages 1-10. To filter small icons, use --min-image-size 100.
Output:
/home/claude/extracted/
├── {filename}.md # Raw markdown with YAML frontmatter
├── metadata.json # Structured metadata
└── images/ # Extracted images (if any)Read the extracted markdown:
cat /home/claude/extracted/{filename}.mdCheck YAML frontmatter for:
extraction_method — Which extractor was usedtotal_pages — Document lengthhas_outline — Bookmarks exist (helps with structure)total_images — Number of imagesIdentify issues requiring cleanup:
Manual cleanup only. Do not write scripts, sed/awk commands, or regex replacements. Read the content and write a clean version directly.
Process:
Load references as needed:
Repeated elements & source-specific patterns: See cleanup-patterns.md
Text fragmentation: See sentence-reflow.md
Table issues: See table-formatting.md
Image handling: See image-handling.md
While writing the clean output, apply these formatting principles:
# → ## → ### consistentlyConvert markers to proper markdown:
<!-- Before -->
<!-- IMAGE: images/page003_img001.png (450x280px) -->
<!-- After -->
View each image with view tool to write accurate alt text.
After reading and mentally processing the extracted content, write the clean markdown directly to a file:
# Write clean content to file (Claude creates this content)
cat > /mnt/user-data/outputs/{filename}_clean.md << 'EOF'
# Document Title
[Clean content goes here - written by Claude, not copied]
EOFOr use the create_file tool to write the clean content directly.
mkdir -p /mnt/user-data/outputs/images/
cp -r /home/claude/extracted/images/* /mnt/user-data/outputs/images/Review the clean output against this checklist. If issues found, fix and re-check:
Quality Checklist:
- [ ] No repeated footers/headers
- [ ] No standalone page numbers
- [ ] No watermarks or branding
- [ ] Sentences properly rejoined
- [ ] Tables intact and readable
- [ ] Images converted to markdown syntax
- [ ] Heading hierarchy logicalIf any item fails, revise the content and verify again before delivering.
Include:
images/ folder requirement)| Error | Cause | Solution |
|---|---|---|
| "File not found" | Wrong path | Check /mnt/user-data/uploads/ |
| "Invalid PDF header" | Not a PDF | Inform user file is invalid |
| "Extraction failed" | Protected/corrupted | Try --method pymupdf |
| Empty output | Scanned PDF | Inform user, suggest OCR |
If extraction_method shows pymupdf (fallback) with minimal text:
Consider extracting in ranges:
python extract_pdf.py doc.pdf ./out1/ --pages 1-25
python extract_pdf.py doc.pdf ./out2/ --pages 26-50Verify reading order makes sense. pymupdf4llm handles columns reasonably but may interleave incorrectly.
Final markdown structure:
# {Document Title}
## {First Section}
{Clean content...}
## {Second Section}
{Clean content...}
---
*Source: {filename}.pdf | Extracted: {date}*~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.