← Back to Document Data Extraction
SKILL.md
v1.0.0 · 2263 B · text/markdown
--- name: document-data-extraction description: Use when reading or generating PDF, DOCX, or XLSX files - work from the actual file structure instead of guessing contents, so output reflects what's really in the document --- # Document Data Extraction Summarizing or editing a document by pattern-matching its filename or a partial preview invites hallucinated content. This skill's rule: read the actual structure before making any claim about what's in a document, and edit through structure-aware operations, not blind text replacement. ## Reading - **PDF**: extract actual text content (and note where a page is image-only and would need OCR rather than silently skipping it or guessing its content). - **XLSX**: read actual cell values and formulas, not just what a preview shows — a formula's computed value and its underlying formula can both matter depending on the task. - **DOCX**: parse the real document structure (headings, tables, styles), not just a flattened text dump — structure often carries meaning (a table's columns, a heading's level). ## Generating and editing - **Never fabricate contents to fill a template** — if a required field's value isn't available, say so explicitly rather than inventing a plausible-looking placeholder that looks like real data. - **Edit existing files by modifying their structure**, not by regenerating the whole document from scratch — a full regeneration risks losing formatting, styles, or content outside what was explicitly asked to change. - **For spreadsheets, preserve formulas where the task doesn't require changing them** — overwriting a formula cell with its current computed value silently breaks the sheet's behavior on future edits. ## Verification After generating or editing a document, re-read the actual output file before declaring the task done — confirm the change landed correctly in the real file, not just that the generation step didn't error. ## What this isn't for Simple, single-value lookups from a short document don't need heavyweight structural parsing — reserve the full structural approach for anything where getting the content wrong would matter (financial data, contract terms, anything downstream systems will consume).