Claude CLI skill to translate PDF documents while preserving the original layout
SaferSkills independently audited pdf-babel (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.
Translate a PDF document while preserving the original layout (images, borders, fonts, positioning). Only the text changes.
Supported document types: blood_test, urine_test, breast_ultrasound, pet_ct, immunohistochemistry, mri, general_medical.
Read pdf_translate_config.yaml to understand the current settings. If it doesn't exist, create one:
source .venv/Scripts/activate && python -m pdf_translator.cli init-configKey config fields to review:
document_type — must match the PDF being translatedheader_detection / header_fixed_y — controls what's treated as non-translatable headerinstructions — free-text guidance tailored to the document typephrase_translations — additional phrase-level replacements for narrative text (ultrasound reports, etc.)do_not_translate_patterns — regex patterns for codes to preserve (e.g. BI-RADS)If the document type doesn't match, update the config before proceeding. For a new document type, see the manual at docs/adding-document-types.md.
The user provides a PDF path as the argument. If not given, translate all PDFs in the pdfs/ directory.
source .venv/Scripts/activate && python -m pdf_translator.cli pipeline "<PDF_PATH>"If no PDF_PATH argument was given:
source .venv/Scripts/activate && python -m pdf_translator.cli pipelineAfter the pipeline completes, check for untranslated text:
source .venv/Scripts/activate && python -m pdf_translator.cli check "<PDF_PATH>" --jsonIf the check returns an empty list [], the translation is complete — skip to Step 5.
If unknown terms are found, proceed to Step 4.
For EACH unknown term returned by the check command, ask the user for help. Format your question like this:
I found an untranslated term on Page {page} that I don't recognize:
>
Unknown text: {text}>
Surrounding context: ...{context_before} → `{text}` → {context_after}...
>
What does this mean? Should I: 1. Translate it to: _____ (please provide the translation) 2. Keep it as-is (it's a name, code, or shouldn't be translated)
Wait for the user to respond to ALL unknown terms before continuing.
After getting answers, decide where each translation belongs:
custom_translations in configphrase_translations in configdo_not_translate in configdo_not_translate_patterns in configIf many unknowns share a domain (e.g. a new type of medical report), consider adding a new dictionary section in pdf_translator/translate.py instead of piling entries into the config. See docs/adding-document-types.md for the full workflow.
Then re-run the pipeline:
source .venv/Scripts/activate && python -m pdf_translator.cli pipeline "<PDF_PATH>"Run the check again to verify no unknowns remain. Repeat if needed.
Tell the user:
Follow the instructions field from the config. Core rules:
name_translations are configuredphrase_translations from configheader_first_page_only: true in config when only page 1 has a header; set false if the clinic letterhead appears on every pagezone: rotated; include rotated in preserve_zones to skip it~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.