Document-Processing Skills: Contracts, Invoices & Sheets
Every cross-border shipment generates a pile of documents—commercial invoices, packing lists, bills of lading,…
The Problem: Documents That Cost You Hours and Errors
Every cross-border shipment generates a pile of documents—commercial invoices, packing lists, bills of lading, supplier quotations. An operator’s day fills with copy-pasting invoice numbers, cross-checking weights against packing lists, and manually spotting mismatched incoterms. We made our share of false assumptions from blurry scans and inconsistent supplier formats before we built a reusable fix.
The real cost isn’t just time. It’s the errors nobody catches:
- A supplier changes column order and the HS code lands in the description field.
- OCR misreads “7,200 kg” as “7.2 kg” and the freight forwarder underbooks.
- A bilingual invoice hides the payment terms in one language while the header says another.
When you handle 50–100 documents a month, those gaps add up. We learned that document processing needs more than a one-off AI query. It needs a repeatable, versioned skill that normalizes input, extracts what matters, validates it, and hands the result to a human for a quick final check.
The Operator's Answer: A Reusable Document-Processing Skill
We turned our own ground-up process into a 365Skill—a structured, installable agent skill that lives in a simple SKILL.md file. It sits on top of any capable LLM, grabs your documents (PDF, scan, Excel), and delivers a clean review table you can audit in under two minutes. No black-box automation that silently feeds errors downstream.
Here’s the four-part workflow that saved our ops team 6+ hours a week:
- Input normalization – Convert PDF, image, or Excel to a uniform text representation. Runs OCR when needed with a clear confidence flag so you know which fields might be shaky.
- Field extraction – A template lists exactly which fields to pull from each document type: invoice number, date, total, incoterms, vessel name, container count, HS codes, etc. Validation rules catch impossible values (e.g., net weight exceeding gross weight).
- Exception handling – When a field is missing, the scan is too blurry, or the language mix breaks the extractor, the skill records an “EXCEPTION” with a reason instead of guessing.
- Human review export – All results get dumped into a structured table (CSV or audit spreadsheet). You scan the exceptions, spot-check a few totals, and approve. Only then does the data flow into your ERP or shipping dashboard.
Anatomy of a SKILL.md for Document Handling
Every 365Skill is defined in a plain-text SKILL.md file. No coding required. A document-processing skill typically contains these sections:
- Name & version – So you know which revision you’re running. V1.2 might handle DDP invoices better than V1.0.
- What it does – A plain-language description. “Extract key fields from commercial invoices and packing lists, validate against shipping rules, and output a review spreadsheet.”
- Input requirements – Which fields are mandatory or optional, and what formats trigger the normalization step (PDFs, JPGs, .xlsx).
- Extraction template – The checklist of fields per document type, with validation rules. Example: “Gross weight must be a positive number; if greater than 30,000 kg and incoterms is EXW, flag for review.”
- Exception-handling rules – When to mark a field as “UNRELIABLE” (OCR confidence below 80%) or “MISSING,” and what to do if the document language doesn’t match the expected set.
- Output shape – A table describing the columns the skill will generate: field name, extracted value, confidence flag, rule-violation note, and a link back to the source document page.
- Review step – A checklist for the human operator: check all EXCEPTION rows, verify at least one weight/total against a calculator, then sign off.
Step-by-Step: Building Your First Invoice Extraction Skill
Let’s walk through creating a skill for a supplier commercial invoice + packing list pair. I’ll describe the action, not the code, since this is an operator’s playbook.
Step 1: Collect 10–15 real examples – Grab invoices and packing lists from different suppliers. The variety will expose format variants you need to cover. You’ll see that one supplier puts HS codes in a separate column, while another buries them in the product description.
Step 2: Define the field checklist
- Invoice number
- Invoice date
- Seller & buyer company names
- Total amount (currency)
- Incoterms
- Port of loading / port of discharge
- Container number (from packing list)
- Gross weight (kg)
- HS codes (list)
Add validation rules: e.g., “Invoice date must not be in the future,” “Total amount must match the sum of line-item prices within 2%.”
Step 3: Write the SKILL.md – Fill in each section from the anatomy above. Use plain language. Include a line that says: “When OCR is required, attach a confidence score. If a field is extracted from an image, note the page number.”
Step 4: Test with a mix – Run the skill against your 15 documents. Count how many extraction errors or false exceptions you see. Iterate the validation rules. You’ll quickly discover edge cases: a French supplier uses “poids brut” instead of “gross weight”; a combined invoice/packing list puts all tables on one page. Adjust the skill to recognize synonyms and layout patterns.
Step 5: Lock a version and use it daily – Publish it as a named skill (e.g., “invoice-packlist-extract-v1.3”). From then on, every new document runs through the same pipeline. When a new format appears, you update the skill, bump the version, and all future operations benefit.
Real Workflow: From a Messy Invoice to a Clean Review Table
Earlier this week, we received a scanned commercial invoice from a new Turkish supplier. The scan was slightly skewed, the table headers were in Turkish, and the HS code column had merged cells. Four minutes after dropping the PDF into the skill, we had this on screen:
| Field | Extracted Value | Confidence | Flag |
|---|---|---|---|
| Invoice number | IST2024-00871 | HIGH | |
| Invoice date | 2024-12-14 | HIGH | |
| Total amount | 18,430 EUR | MEDIUM (OCR 83%) | sum check: line items total 18,425 EUR – within tolerance |
| Gross weight | 6,210 kg | HIGH | |
| HS codes | 9403.20, 9403.60 | HIGH | |
| Incoterms | FOB | HIGH | |
| Container number | MSCU1234567 | LOW (blurred) | Operator: cross-check with booking confirmation |
Two exceptions needed a human: the total amount flagged as medium confidence required a quick line-by-line addition (it matched), and the container number needed a cross-check. The rest was ready to copy into our shipment dashboard. No more manual retyping, no more second-guessing whether the HS code came from the right line.
If you handle other document types, the same skill pattern applies to contract clause comparisons (extract payment terms, penalty clauses, jurisdiction) or quotation sheets (structure product specs into a consistent table).
Layer It with Tools You Already Use
This document skill fits into a larger workflow. Combine it with other free tools from our operator toolkit:
- Use the invoice generator to create clean proforma invoices from the extracted data—saves re-typing for pre-shipment documents.
- Feed extracted supplier quotations into the AI Product Sourcing Analyst to compare prices and specs across sources without manual spreadsheet wrangling.
- Store the skill itself in the 365Skill library to version it, share it with your team, and update it once instead of updating everyone’s prompt strings.
FAQ
Can the skill handle handwritten or poorly scanned documents?
Yes, but it will flag low-confidence fields. The OCR step measures its own reliability and attaches a confidence score. When that score drops below a threshold (e.g., 80%), the output marks the field for human review. You never get a silent error.
How do I ensure extracted numbers like totals are correct?
The skill includes validation rules, such as comparing the total amount to the sum of line items, checking that net weight is less than gross weight, or verifying container numbers against standard formats. Any field that fails a rule appears with a flag in the review table. A quick spot check of the flagged rows catches the rest.
What if my documents mix English and another language?
The extraction template can define a list of acceptable synonyms or field label translations. For example, “gross weight” might also appear as “poids brut” or “brüt ağırlık.” You add these aliases to the skill once; it picks the right field regardless of language. If the language isn’t recognized, the exception handler notes it so a bilingual team member can review.
---
Stop letting invoices and packing lists eat your afternoon. Grab the document-processing skill template from the 365Skills library, drop in your team’s document examples, and build a pipeline that catches errors before they reach the forwarder. Then try the invoice generator to turn those clean extractions into polished proforma invoices—seconds, not spreadsheets.