---
name: document-productivity-workflows
description: "Umbrella for document and office workflows: PDFs/OCR, slide decks, Teams meeting summaries, and workspace document automation."
version: 1.0.0
author: Hermes Agent
license: MIT
metadata:
  hermes:
    tags: [documents, pdf, ocr, powerpoint, slides, teams, meetings, productivity]
---

# Document Productivity Workflows

Use for document-centric tasks where the deliverable is an edited file, extracted text, slide deck, meeting summary, or office automation result.

## Triage

- **PDF text edits / metadata fixes**: use nano-pdf style targeted edits and verify the resulting PDF.
- **OCR / scanned documents**: extract text from PDFs or scans with pymupdf/marker-style pipelines; keep page references. For post-migration or fresh-machine checks, use `references/document-ocr-toolchain-verification.md`: verify both Python packages and system binaries, because Docling can be present while Tesseract/OCR language packs are still missing.
- **Photographed school exams / worksheets**: when importing page-by-page HEIC/JPEG exam photos into a learning archive, use `references/photographed-school-exam-ocr-assembly.md`. Preserve raw originals, convert/preprocess images, smoke-test Docling, prefer Docling with explicit Tesseract engine plus standalone Tesseract fallback, optionally add PaddleOCR for title/topic search, and keep vision usage sparse during archive mode; reserve systematic vision QA for later removal of student answers/red teacher annotations. If cleanup of a filled photographed worksheet makes text unreadable/pixelated or white boxes cover tasks, stop retouching and recreate a clean practice worksheet with the same/analogous task structure instead.
- **Scanned insurance policies**: if policy PDFs produce empty/minimal `pdftotext` output, use `references/scanned-policy-pdf-ocr.md` for the `ocrmypdf --sidecar` workflow and structured extraction checklist.
- **Insurance policy/offer comparisons and cancellation deadlines**: extract both the current policy and new offer, compute deltas with real dates/amounts, distinguish coverage classes (e.g. Gebäudewasser/Flüssigkeiten und Gas ≠ Elementar), and cite authoritative legal sources for cancellation rules. For Swiss VVG questions, quote Fedlex VVG Art. 35a directly: ordinary cancellation is possible at the end of the third or following year with a 3-month notice period; Art. 47 limits tacit renewals to one year. When the user asks a narrow deadline/fristen question, answer the deadline first in one line, then provide the supporting table/source.
- **PowerPoint decks**: create, inspect, or edit `.pptx` files; preserve templates, notes, and slide structure.
- **PowerPoint decks**: create, inspect, or edit `.pptx` files; preserve templates, notes, and slide structure.
- **Teams meeting pipeline**: inspect, replay, or operate the meeting-summary pipeline and Graph subscription lifecycle.
- **Audio/video protocol generation**: use `references/audio-video-protocol-generation-codexcli.md` for WhisperX transcription + ChatGPT/CodexCLI protocol generation + DOCX export; prefer this when the user wants CodexCLI/GPT-5.5 rather than local Ollama/Qwen.
- **ERNE protocol formatting**: when creating polished ERNE AG Holzbau DOCX/PDF protocols from transcripts/templates/CD manuals, use `references/erne-protocol-docx-pdf-formatting.md` for the learned typography, table, pagination, and LibreOffice-PDF verification workflow.
- **Workspace documents**: use Google Workspace, Notion, Airtable, or other SaaS-specific integrations when the task targets those systems directly.
- **Shared email archives with PDF attachments**: for SharePoint/OneDrive/Google Drive folders or ZIPs of saved emails (`.eml`/`.msg`) that must be extracted into a local learning/document structure, first verify real download access before building an extraction pipeline. If SharePoint shows Microsoft secure-link verification and then an organization login rejects the invited Gmail account (e.g. “Kein Konto mit diesem Benutzernamen gefunden”), stop and report the access blocker; ask for an anonymous “anyone with link” share, a ZIP upload, or direct `.eml`/`.msg` files. If Google Drive access goes through `gog`, remember that encrypted file-keyring token files still require `GOG_KEYRING_PASSWORD`; without it, ask for the env var or a direct upload rather than claiming the Drive ZIP can be fetched. When a ZIP of Outlook `.msg` files is available, follow `references/saved-msg-email-archive-pdf-extraction.md`: parse with `extract-msg` in a local `uv` venv, recurse into nested `.msg`, dedupe attachments by SHA-256, write an inventory CSV/README, verify PDF headers, and resume large Drive uploads by listing existing children once per folder. Do not claim extraction succeeded without actually downloading, parsing, and verifying the messages.

## Workflow

1. Identify input files, output format, and whether edits are destructive or should produce a copy.
2. Inspect the real document structure before editing: pages/slides/metadata, text layer, images, notes, and tables.
3. Run the smallest reliable tool for the job; avoid manual binary editing.
4. When the user supplies a corporate-design manual, color sheet, or Word template, extract the actual design constraints before formatting: office font, title casing, primary/secondary colors with HEX/RGB, table/header/footer conventions, and any existing header/footer parts in the template. For Word deliverables, start from the provided template when possible, but verify template styles exist before assigning them (`Table Grid`, `List Bullet`, etc. may be absent); fall back to direct XML/formatting rather than failing.
5. For branded DOCX/PDF pairs, generate both from the same structured content, apply the brand palette consistently (e.g. headings, table headers, alternating rows, footer line), and render at least the first and last PDF pages to images for visual QA: check legibility, row clipping, overlap, page footer, and whether dense tables remain readable.
4. Verify by reopening/parsing the produced file, not only by trusting command success. For advisor-style PDF reports with charts/tables, use a three-part verification pass: `pdfinfo` for page count/metadata, `pdftotext` spot checks for key numbers/claims, and page render or vision review for overlap, clipped tables, chart legends, and footer collisions.
5. When the user supplies or edits a DOCX template and also wants a PDF, treat the final DOCX as the source of truth and convert that exact file to PDF (e.g. `libreoffice --headless --convert-to pdf`). Do not leave the PDF on an older generated state. Re-render/visually inspect key pages after conversion, especially header/footer clearance, section page breaks, large tables, and the last page.
6. For formal Word/PDF protocols or reports, encode layout intent in the DOCX before conversion: increase header/footer clearance when corporate headers are present, use keep-with-next/keep-together for section blocks that must not split, add spacing between sections, and set table rows to not split. If one large table row or final pendenz orphans onto a new page, try reduced table font/cell margins before accepting the ugly break.
7. When generating PDFs programmatically, keep layout primitives explicit: in ReportLab, append `PageBreak()` to the story (`story.append(PageBreak())`) rather than calling it bare; use deliberate page breaks before large sections/charts to avoid half-rendered tables. If chart libraries are unavailable, deterministic Pillow-rendered charts are acceptable for static report artifacts, but still verify rendered pages visually.

9. If the user complains about duplicate/overlong chat output, switch to artifact-first delivery: concise acknowledgement + `MEDIA:/path` only, with one-line verification summary. Do not paste the full analysis again.
10. Return file paths, summary of changes, and limitations (e.g. scanned image quality, missing fonts, unsupported PDF operators).

## Preserved source packages

Full packages copied under `references/absorbed-packages/`: `nano-pdf`, `ocr-and-documents`, `powerpoint`, and `teams-meeting-pipeline`.
