Format-specific document extraction workflows
53
60%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Low
Low-risk findings worth noting
Fix and improve this skill with Tessl
tessl review fix ./.ai-rulez/skills/format-specific-extraction/SKILL.mdZIP archive → SecurityBudget → XML parsing → Text + tables + metadatalet budget = SecurityBudget::from_config(config); (extractors/security.rs), plus
config.security_limits…max_files_in_archive as the member cap. The Office path does
not use ZipBombValidator — that is the archive/iWork/HWPX path.zip::ZipArchive::new(cursor) and read the parts
(word/document.xml, ppt/slides/*.xml, content.xml).quick-xml::Reader (streaming), threading &mut budget through the recursive
walkers so a hostile document exhausts a budget instead of memory.crate::extraction::office_metadata — see the helper table below. There is no
extract_metadata().extractors/docx.rs, extractors/pptx.rs, extractors/odt.rs.Bytes → xberg_native_pdf → Per-page text + OCR fallback → Tables → Metadataxberg_native_pdf::PdfDocument::from_bytes(content.to_vec())? — the engine takes an owned
Vec<u8>, not a slice.config.force_ocr (whole document) or config.force_ocr_pages
(Option<Vec<u32>>); otherwise pages with no extractable text route to OCR.config.pages: Option<PageConfig> controls per-page output — it does not gate tables.#[cfg(feature = "pdf")]; the backend is PdfConfig.backend
(native default, pdfium behind pdf-pdfium).extractors/pdf/mod.rs.ZipBombValidator → per-format metadata → per-format text contentZipBombValidator::new(limits).validate(&mut archive)? before any extraction.extraction/archive/:
extract_{zip,tar,7z,gzip}_metadata, extract_{zip,tar,7z,gzip}_text_content,
extract_{zip,tar,7z}_file_bytes. There is no build_archive_result().extractors/archive.rs, extraction/archive/{zip,tar,sevenz,gzip}.rs.Single StructuredExtractor covers several MIME types: parse with the format library,
pretty-print to text. See extractors/structured.rs.
Parse headers → extract body (text/html) → process attachments. Message-in-message nesting is
bounded by the SecurityBudget's SecurityLimits-derived DepthValidator, the same counter
every other format uses. See extraction/email.rs, extractors/email.rs, extractors/pst.rs.
| Helper | Location |
|---|---|
extract_core_properties() | extraction/office_metadata/core_properties.rs |
extract_custom_properties() | extraction/office_metadata/custom_properties.rs |
extract_{docx,xlsx,pptx}_app_properties() | extraction/office_metadata/app_properties.rs |
extract_odt_properties() | extraction/office_metadata/odt_properties.rs |
cells_to_markdown() | extraction/markdown.rs (pub(crate)) |
SecurityBudget, SecurityLimits | extractors/security.rs |
ZipBombValidator, DepthValidator | extractors/security.rs |
StringGrowthValidator | extractors/security.rs |
The security types are pub(crate): in-crate extractors can use them, out-of-crate plugin
authors cannot.
FormatEntry to the FORMATS registry in core/mime.rs. EXT_TO_MIME and
SUPPORTED_MIME_TYPES are derived from it — do not hand-edit either. See
mime-detection-routing for the full procedure, including the count assertion to bump.InternalDocumentExtractor (not DocumentExtractor).supported_mime_types() and priority() (default 50).extractors/mod.rs → register_default_extractors().#[cfg(feature = "my-format")].SecurityBudget / SecurityLimits to any user-supplied content.#[cfg_attr(alef, alef(skip))] to the extractor struct or the binding regen aborts.test-corpus skill for where fixtures come from).04336bd
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.