invoice-coding
Skill8 starsChanged 4 months agoMITView on GitHub
Proposes GL account coding for vendor invoices from historical coding frequency and the chart of accounts, and routes every invoice that cannot be coded safely — new vendors, decommissioned accounts, low-confidence matches — to an exception queue instead of guessing. Use this whenever the user mentions invoice coding, GL coding of invoices, coding AP invoices, auto-coding vendor invoices, proposing account codes, invoice extraction and coding, or building a coded invoice register. Also trigger on "code these invoices," "propose GL coding," "what account does this vendor usually hit," "route invoices for approval," or when an invoice extract, chart of accounts, and historical coding file are provided together. This is the AP-side twin of receipts-to-expense (which handles employee receipts, not vendor invoices) and feeds three-way-match downstream once invoices are coded. Runs fully local — no vendor or invoice data leaves the machine.
- Installs packages
In this repository44 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- accrual-proposalsSkill
- ar-aging-tie-outSkill
- arr-waterfallSkill
- audit-samplingSkill
- audit-workpaperSkill
- balance-sheet-recon-packSkill
- bank-rec-reviewSkill
- bank-rec-to-glSkill
- bank-statement-to-excelSkill
- board-package-builderSkill
- budget-vs-actualSkill
- cash-applicationSkill
- cash-flow-tieoutSkill
- commission-recalcSkill
- consolidation-rollupSkill
- cutoff-and-unrecorded-liabilitiesSkill
- debt-covenant-checkSkill
- deferred-revenue-waterfallSkill
- depreciation-tie-outSkill
- dunning-draftsSkill
- duplicate-payment-scanSkill
- expense-policy-testingSkill
- filing-diffSkill
- flux-narrativeSkill
- fx-revaluationSkill
- intercompany-reconSkill
- journal-entry-anomaly-scanSkill
- k1-extract-summarizeSkill
- lease-schedule-tie-outSkill
- month-end-close-checklistSkill
- payroll-tax-reconciliationSkill
- pbc-assemblerSkill
- prepaid-amortizationSkill
- receipts-to-expenseSkill
- return-yoy-varianceSkill
- revenue-trace-to-sourceSkill
- sales-tax-reconciliationSkill
- tax-return-reviewSkill
- thirteen-week-cash-forecastSkill
- three-way-matchSkill
- trial-balance-integritySkill
- vendor-statement-reconSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are 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.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
An invoice is accounted for in neither bucket: Every invoice lands in exactly one of coded-with-confidence or exception — a reconciliation …
≈ “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
Invoice Extraction and GL Coding
This skill assumes invoice text has already been extracted into structured rows — it proposes coding from that structured data, it does not perform PDF or inbox parsing itself. Its job is the coding decision: which account, on what basis, and at what confidence — never a guess dressed up as a model score.
The gate
A proposal is not "coded" until it is earned by history and a usable account. The script refuses to produce a clean workbook when:
- An invoice is accounted for in neither bucket. Every invoice lands in exactly one of coded-with-confidence or exception — a reconciliation check enforces this and blocks the workbook if it ever fails.
- An amount or date does not parse. Reported as a named exception on the row it came from, never dropped or defaulted.
- A duplicate
invoice_idmakes the population ambiguous and is rejected outright.
A vendor with no historical coding, a proposed account that is missing or inactive in the chart
of accounts, and anything below --min-confidence are not gate failures — they are the
exception queue working as intended, and the workbook is written with them clearly flagged.
Inputs
- Invoice extract —
invoice_id, vendor, amount, invoice_date, line_description. - Chart of accounts —
account_code, account_name, active(active: y/n). - Historical coding —
vendor, account_code, invoice_count, a frequency table of how often each vendor was coded to each account historically.
Step 1 — Run the proposal
python3 scripts/invoice_coding.py --invoices invoices.csv --coa chart_of_accounts.csv \
--historical historical_coding.csv --min-confidence 60 \
--client "Northwind Systems Inc" \
--out "Northwind - Invoice Coding Register.xlsx"Omit --min-confidence only if you deliberately want no confidence floor — every
historically-coded vendor with an active account then gets auto-coded, and only brand-new
vendors or inactive/missing accounts land in the exception queue. Stating a floor explicitly is
the safer default for anything going straight to posting.
Step 2 — How confidence is computed
Confidence is a real, auditable statistic, not an invented score: it is the share of a vendor's
historical invoice count that went to the account being proposed. A vendor coded to one account
100% of the time in history gets 100% confidence; a vendor split 60/40 between two accounts gets
60% confidence on the majority account and the minority 40% is simply the alternative not taken.
The basis column on the register always shows the underlying count (8/10 historical
invoices to 6100), so a reviewer can second-guess the proposal without re-deriving it.
Deliver
Workbook tabs:
- Summary — population counts, coded vs. exception split, gate status.
- Coded Invoice Register — every auto-coded invoice with proposed account, confidence, and basis.
- Exception Queue — new vendors, inactive/missing accounts, below-floor confidence, and any parse failures, each with a stated reason.
- Vendor Coding History — the frequency table as supplied, for reference during review.
Then, in chat: the coded/exception split, the confidence floor applied, and anything that blocked the gate. Name the largest-dollar exceptions first — that's where review time belongs.
What to escalate
- A vendor whose historical coding has shifted materially (e.g., recently split differently than history suggests) — the script cannot detect intent behind a shift, only report the historical pattern.
- An invoice coded to an expense account that is unusually large relative to that vendor's historical invoice amounts — a dollar-size outlier even at high coding confidence.
- A chart of accounts with recently deactivated accounts still carrying heavy vendor history — may signal a chart cleanup that hasn't been communicated to AP.
- A new vendor whose name is a close variant of an existing vendor — possible duplicate vendor master record, not a coding question but worth flagging while the exception is in front of a reviewer.
Report each as a fact with the record reference. Do not characterize intent — describe what the data shows and let the reviewer decide.
Security posture
Fully local: standard library plus openpyxl. No network calls, no uploads, no telemetry.
Vendor and invoice data never leave the machine.
Dependencies
pip install openpyxlBuilt by Adopt AI — free to use and modify.
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.

