Invoice extract
Personal Claude Code skills packaged as an installable plugin
npx -y skills add jiahao1553/personal-skills --skill invoice-extractAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Extract cost/price details from invoice PDFs in this project and build a verified Excel (xlsx) summary with a Summary sheet and a Line Items sheet. Use when the user asks to summarize invoices, extract invoice costs/prices, reconcile invoice numbers, or generate an invoice Excel report. Trigger phrases: "read all invoices", "summarize invoice costs", "invoice to excel", "/invoice-extract".
SKILL.md
3.7 KB, 759 tokens by cl100k_base, as published. Nobody here has run it
Invoice Extract & Summarize
Turns a folder of invoice PDFs into a verified Excel workbook (Summary + Line Items sheets).
Prerequisites
None — no MCP required. Only needs the openpyxl Python package (installed in step 4 if missing).
When to use
User wants invoice PDFs in the project directory read and turned into a cost/price summary table (Excel/xlsx). Rerun this any time new invoices are added — it re-extracts from scratch, it does not incrementally update an old workbook.
Steps
-
Find the invoices.
Glob **/*.pdf(or a narrower pattern like**/*[Ii]nvoice*.pdfif the user names one) under the target directory. Confirm the file list with the user only if it's ambiguous which PDFs are invoices vs unrelated PDFs. -
Batch and delegate extraction. For more than ~4-5 invoices, split into batches of 3-4 and spawn parallel
general-purposeAgent calls (not forks — these need no prior context). Each agent's prompt must:- List its exact batch of file paths (use forward-slash paths, e.g.
/c/repos/<project>/..., they work fine with Read). - Instruct it to Read each PDF and extract: invoice no, invoice date, visit date, department/clinic, vendor, patient/bill-to, every line item (description, qty/unit, amount before subsidy, amount after subsidy — or whatever the analogous discount/tax structure is), subtotal, subsidy/discount, pre-tax total, tax/GST amount, total payable, any Medisave/other deduction, amount paid, final amount payable.
- Tell it to double check every number against the actual PDF text (invoices have easy-to-transpose digits) and to return a plain-text or markdown structured block per invoice, not prose paragraphs, so you can parse it reliably.
- For small batches (<=5 total invoices), skip delegation and just Read the PDFs directly yourself.
- List its exact batch of file paths (use forward-slash paths, e.g.
-
Consolidate into JSON. Merge all batch results into one JSON object matching the schema documented at the top of
scripts/build_xlsx.py:{"invoices": [...], "line_items": [...]}. Write it to a scratch file (use the session scratchpad directory). -
Verify before building. Run
python scripts/build_xlsx.py <input.json> <output.xlsx>— it runs an arithmetic reconciliation pass first (line-item sum vs subtotal, subtotal+subsidy vs pre-tax total, 9%-style GST recompute vs stated GST) and prints any mismatches before saving. If it reports mismatches, do not report success to the user — go back to the source PDF for that invoice and correct the figure, don't just suppress the warning.- If the invoice's tax scheme isn't a flat percentage (no GST-style rate, or a different rate), skip the GST-recompute check but still verify the line-item-sum-vs-subtotal check, which is scheme-agnostic.
openpyxlmust be installed (pip install openpyxlif missing).
-
Report. Tell the user the output path, invoice count, sheet names, and call out anything that needed manual correction during verification (don't silently fix without mentioning it).
Notes
- Works on whatever project directory Claude is invoked in — point it at any folder of invoice PDFs.
- The build script is generic and reusable on its own: any caller that produces the JSON schema it expects can run it directly without re-deriving the xlsx-building code.