Automates the full workflow of turning a pile of receipt images and PDFs into clean, submission-ready expense claim packages — sorted by date and category, with currency conversions and a summary table.
Run these five phases in order. Never skip a phase.
text
Phase 1 → Ingest & Parse all uploaded files
Phase 2 → Classify each bill (date, vendor, category, currency, amount)
Phase 3 → Generate per-day per-category PDFs
Phase 4 → Generate the expense spreadsheet (XLSX)
Phase 5 → Output summary tables for manual form entry
/mnt/user-data/uploads/.png, .jpg, .jpeg): read visually — extract date, vendor,
amount, currency, bill number, and any GST/VAT breakdown.pdf): use pypdf to extract text; if text is sparse, treat
as scanned and read visuallyMap every bill to this schema:
text
date : DD-Mon-YY (e.g. 13-Feb-26)
vendor : string
location : city / airport / country
category : one of the TCS categories below
currency : INR | USD | EUR | GBP | SGD | AED | ...
amount_orig : float (as printed on bill)
bill_no : string (from receipt; use "attached" if none)
notes : brief description of items
TCS CategoryWhat goes hereTravel Expenses – ConveyanceUber, Ola, Lyft, taxis, local cabs, airport transfersTicket Expenses – Air TicketsAirline tickets, excess baggage fees (keep SEPARATE per bill)Ticket Expenses – Train TicketsRail bookingsTicket Expenses – Bus TicketsBus / coach bookingsHotel AccommodationHotel folios, checkout invoices (NOT room dining — that's Meal)Travel Expenses – MealAll food, beverages, airport snacks, restaurant bills, delivery (Zomato/Swiggy), cafe receiptsClient Entertainment – TravelMeals/entertainment where clients were presentCar ExpensesFuel, parking, tollsCommunication ExpensesSIM cards, roaming, internet donglesConference and Training CoursesRegistration fees, course materials
Read /mnt/skills/public/pdf/SKILL.md before running this phase.
Naming convention:
text
DD_Mon_YYYY_<TCS_Category_Underscored>.pdf
Examples:
text
13_Feb_2026_Travel_Expenses_Conveyance.pdf
13_Feb_2026_Travel_Expenses_Meal.pdf
13_Feb_2026_Ticket_Expenses_Air_Tickets.pdf
20_Feb_2026_Hotel_Accommodation.pdf
Script to use: scripts/build_pdfs.py
img2pdf + Pillowpypdf/mnt/user-data/outputs/bills_by_category/Run: python3 scripts/build_pdfs.py
Present all generated PDFs to the user using present_files.
Read /mnt/skills/public/xlsx/SKILL.md before running this phase.
Script to use: scripts/build_xlsx.py
The spreadsheet has two sheets:
Columns: #, Date, Vendor, Location, Category, Currency, Amount (Original), Amount (INR equiv.), Notes
Color coding:
Rows = TCS categories; Columns = Category, # Items, Original Amounts, INR Equiv.
Plus a Grand Total row with all-in USD equivalent.
Currency conversion — use rates from references/fx_rates.md or fetch live
rates if web search is available. Always show the rate used and its date.
Output to /mnt/user-data/outputs/expense_claim.xlsx
Always output three tables in chat so the user can fill their expense portal directly:
Bill Date | From Location | To Location | Bill No | Currency | Amount | Remarks
Bill Date | Name of Hotel/Restaurant | Bill No | Currency | Amount | Remarks
Bill Date | From Date | To Date | Bill No | Currency | Amount | Remarks
Bill Date | Bill No | Currency | Amount | Remarks
Date | Conveyance | Air Ticket | Hotel | Meal (local currency) | Day Total (USD)
— Include a GRAND TOTAL row at the bottom.
See references/fx_rates.md for standard rates.
Before finishing, confirm all of these exist:
/mnt/user-data/outputs/bills_by_category/expense_claim.xlsx with both sheetsProblemActionCan't read a receiptNote it, ask user to confirm amount manuallyDate missing from billInfer from surrounding bills or ask userCurrency ambiguousDefault to country of purchase; flag for userBill number not on receiptUse "attached"Multiple receipts same vendor same dayMerge into one line, note qty
references/fx_rates.md — Standard FX rates for common travel corridorsreferences/tcs_categories.md — Full TCS category eligibility rulesscripts/build_pdfs.py — PDF generation scriptscripts/build_xlsx.py — Excel generation script