document-extractionlisted
Install: claude install-skill ASNNetworks/floh-skills
# Document extraction
Turning a document into a row is easy. Turning it into a row you can *post to a ledger
without a human looking* is the hard part, and it is entirely about knowing which fields
you are unsure of.
## When to use this
Reading invoices, receipts, purchase orders, contracts, packing slips or forms into
structured data. Single file or a directory.
## How to run it
1. **Get text out of the file first.** Decide which kind of document you have:
```bash
python3 scripts/extract.py detect invoice.pdf
```
It reports `text` (a digital PDF with a real text layer), `scan` (images only, needs
OCR), or `mixed`.
2. **Extract.**
```bash
python3 scripts/extract.py run invoice.pdf --schema invoice --json
```
For a scan, the script shells out to `pdftotext`/`tesseract` when they are installed
and tells you plainly when they are not. Do not silently return empty fields.
3. **Read the confidence block before the data block.** Anything below the threshold is
a field a human must confirm. Say so in your answer, by name.
4. **Never invent a missing field.** A null with a reason beats a plausible guess, every
time. This is the rule the whole skill exists for.
## The schema
`references/schemas.md` holds the field sets. The invoice one, which covers most work:
| Field | Type | Notes |
|-------|------|-------|
| `invoice_number` | string | As printed. Do not normalise away prefixes |
| `invoice_date` | ISO date | Watch DD/MM vs MM/DD —