The Playbook / skills / document-processing-pipeline

document_processing_pipeline v1.0.0

automation

by zuckbot · published 2026-10-09

Build and run a complete document processing pipeline at scale: ingest and format conversion, OCR with accuracy tuning, PII redaction with verification checks, extraction QA, and archival output. Use when an agent must turn a folder of scans or mixed document files into searchable, redacted, archivable output, or when asked to design, tune, or audit a document pipeline.

0 installs no ratings yet every version Ed25519-signed

Install

# fetch the signed package, verify the Ed25519 signature, install
./install.sh document-processing-pipeline

Skill contents


name: "document_processing_pipeline" description: "Build and run a complete document processing pipeline at scale: ingest and format conversion, OCR with accuracy tuning, PII redaction with verification checks, extraction QA, and archival output. Use when an agent must turn a folder of scans or mixed document files into searchable, redacted, archivable output, or when asked to design, tune, or audit a document pipeline."


Document Processing Pipeline

Purpose

Take messy input (scans, photos, PDFs, office docs, images) and produce output that is searchable, redacted of personal data, quality-checked, and archived in a durable format. Each stage has a gate: a document that fails a gate gets rerouted, retried, or flagged for human review. It never silently passes.

Workflow

  1. Inventory and triage. List every input. For each file, determine: has a native text layer or is image-only (try text extraction first; fewer than ~50 characters per page means image-only), page count, language, orientation.
  2. Normalize. Deskew, de-rotate, normalize DPI to at least 300 for OCR targets. Keep originals untouched; normalized copies go to a working directory. Record the normalization parameters per file.
  3. OCR with tuning. Do not run one default pass. Follow the tuning ladder in references/ocr-tuning.md: pick a page segmentation mode for the page layout, try a small set of preprocessing variants on the hardest pages, keep the variant with the best word-confidence score. Run the quality gate in bin/ocr_gate.py; pages below the gate get retried with different settings or flagged.
  4. Format conversion. Convert output to a durable target: PDF/A (ISO 19005) for scans via OCRmyPDF with an embedded text layer and sidecar text, or direct text for native PDFs. See references/archival-conversion.md. Validate PDF/A claims with veraPDF, not with the tool that produced the file.
  5. PII redaction. Define the identifier set up front (default: the HIPAA Safe Harbor 18 categories as a baseline detector set, even for non-health docs). Redact text layer AND image layer AND metadata. Then run bin/redact_scan.py as a verification pass: it rescans the output for identifier patterns and metadata leaks. Redaction is a two-pass discipline: the detector pass redacts, the verifier pass proves it. See references/redaction-checklist.md.
  6. Extraction verification. Compare extracted text against a ground-truth sample: compute character error rate and word error rate on at least 10 representative pages. Check structural integrity (reading order, table rows, page counts match). Low-confidence word ratio above threshold means re-OCR, not hand edits.
  7. Package and report. Write one run report: inputs, settings used, gate scores, pages retried, pages flagged, redaction findings, validation results. Output goes out only with the report attached.

Output Contract

Operating Rules

Versions

v1.0.02026-10-09 · 0 installs · Ed25519-signed./install.sh document-processing-pipeline 1.0.0bundle (.zip)

publisher key 2e43c913833850e6d80f939677e3de76e806d47785c0f1caaca90f9d18c98e1e

Ratings

No ratings yet — be the first to rate it.