format-specific-extraction

Extract text, tables, and metadata from Office, PDF, archive, and email documents.

9.2k|581|Updated Jan 31, 2025
One-click install
npx skills add https://github.com/kreuzberg-dev/kreuzberg --skill format-specific-extraction
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: format-specific-extraction
Source: https://github.com/kreuzberg-dev/kreuzberg/tree/main/.ai-rulez/skills/format-specific-extraction
Command: npx skills add https://github.com/kreuzberg-dev/kreuzberg --skill format-specific-extraction

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers building document extraction pipelines need format-specific guidance on how to parse DOCX, PPTX, ODT, PDF, archives, structured text, and email files while enforcing security budgets against hostile inputs like zip bombs and deeply nested messages.

Core Features & Use Cases

  • Office XML Extraction: Parse DOCX, PPTX, and ODT files via streaming quick-xml readers with SecurityBudget enforcement and metadata helpers for core, custom, and app properties.
  • PDF Processing: Extract per-page text with OCR fallback, page-range configuration, and pluggable native or pdfium backends.
  • Archive & Email Handling: Validate ZIP/TAR/7z/GZIP archives with ZipBombValidator before extraction and parse EML/MSG/PST messages with bounded nesting depth.
  • Use Case: When adding a new document format to the extraction pipeline, follow the registry-based workflow: add a FormatEntry to the FORMATS registry, implement InternalDocumentExtractor, register it, and apply SecurityLimits to user-supplied content.

Quick Start

Ask the AI to explain how to add a new document format extractor with security budget enforcement to the extraction pipeline.

Frequently Asked Questions about format-specific-extraction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract text and tables from DOCX or PPTX files?

Open the file as a ZIP archive, read parts like word/document.xml or ppt/slides/*.xml, and parse them with a streaming quick-xml Reader. Thread a SecurityBudget through the recursive walkers so hostile documents exhaust a budget instead of memory.

How do I add a new document format extractor in Rust?

Add one FormatEntry to the FORMATS registry in core/mime.rs, implement InternalDocumentExtractor with supported_mime_types and priority, register it in register_default_extractors, and apply SecurityBudget to user content. Feature-gate optional formats and add fixture-based tests.

Does PDF extraction support OCR for scanned pages?

Yes, pages with no extractable text route to OCR automatically. You can force OCR for the whole document with config.force_ocr or for specific pages with config.force_ocr_pages, and choose between native and pdfium backends.

How are zip bombs prevented during archive extraction?

ZipBombValidator validates the archive against configured security limits before any extraction occurs. Office formats instead use SecurityBudget with a max_files_in_archive member cap, and email nesting depth is bounded by DepthValidator.

Can plugin authors use the SecurityBudget types outside the crate?

No, SecurityBudget, SecurityLimits, ZipBombValidator, DepthValidator, and StringGrowthValidator are pub(crate). In-crate extractors can use them, but out-of-crate plugin authors cannot access these security types.