document-extraction
Skill0 starsChanged 4 months agoMITView on GitHub
Pull structured data out of invoices, receipts, contracts and forms — PDF or scan — into a validated schema, with a confidence flag per field. Use when asked to read a document, extract invoice or receipt fields, digitise a stack of PDFs, or turn documents into rows.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Happy-Technologies-LLC/happy-platform-skillstheir own version, first seen Nov 1, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Happy-Technologies-LLC/happy-platform-skills★ 41same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- brand-voiceSkill
- image-genSkill
- linkedin-carouselSkill
- nextjs-conventionsSkill
- og-generatorSkill
- pharosSkill
- seo-auditSkill
- skill-distributionSkill
- supabase-migrationsSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 70
2. Totals that do not reconcile: Always check sum(lines) == subtotal and subtotal + sum(vat) == total.
- Distinctive: line 78
4. Multi-page documents where the total is on page 3: Do not extract page 1 and stop.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
Get text out of the file first. Decide which kind of document you have:
python3 scripts/extract.py detect invoice.pdfIt reports
text(a digital PDF with a real text layer),scan(images only, needs OCR), ormixed.Extract.
python3 scripts/extract.py run invoice.pdf --schema invoice --jsonFor a scan, the script shells out to
pdftotext/tesseractwhen they are installed and tells you plainly when they are not. Do not silently return empty fields.- 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.
- 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 — see below |
due_date | ISO date, null | Often expressed as "30 dagen" and must be computed |
supplier.name | string | The party being paid |
supplier.vat_number | string, null | Validate the country prefix and length |
supplier.iban | string, null | Checksum it |
customer.name | string | |
lines[] | array | description, quantity, unit_price, line_total |
subtotal | decimal | |
vat[] | array | rate + amount per rate. Multiple rates are normal |
total | decimal | |
currency | ISO 4217 | Infer from the symbol only when it is unambiguous |
The four mistakes that cost real money
1. Date order. 03/04/2026 is 3 April in the Netherlands and 4 March in the US. Do
not guess from the number alone. Resolve it from: an explicit month name elsewhere in the
document, the supplier's country, or another date in the same document where the day
exceeds 12. If none of those settle it, return the raw string and flag it. A silently
wrong invoice date lands the payment in the wrong quarter.
2. Totals that do not reconcile. Always check sum(lines) == subtotal and
subtotal + sum(vat) == total. When it does not add up, the extraction is wrong, not the
invoice. Report the discrepancy rather than the numbers.
3. Credit notes read as invoices. A negative total, or the words "creditnota" / "credit note", flips the sign of the whole document. Booking one as a payable is a real error with a real cost.
4. Multi-page documents where the total is on page 3. Do not extract page 1 and stop. Concatenate first, extract second.
Reporting
invoice.pdf → invoice
✓ invoice_number 2026-0417
✓ total 1.234,56 EUR
✓ reconciles lines 1.020,30 + btw 214,26 = 1.234,56
⚠ due_date null — "betaling binnen 30 dagen" found, but no invoice_date
to compute from. Needs a human.Files
scripts/extract.py— detection, text extraction, field parsing, reconciliation.references/schemas.md— the field sets for invoice, receipt, contract and packing slip.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

