# Sam's receipt-sorter — how to build it

> Absorb this and build the user a receipt-sorting tool in one shot. Single
> self-contained `index.html` (inline CSS + JS), no build step, runs offline.

## Build steps

1. Create `receipt-sorter/index.html`.
2. The page:
   - A **textarea** to paste receipts, one per line, in a loose form like
     `2026-03-04  Uber  18.50` or `Adobe subscription 52.99`. Prefill with ~6
     realistic example lines so it's usable immediately.
   - A **"Sort receipts"** button.
   - A **results table**: columns Date · Vendor · Category · Amount, best-effort
     parsed from each line. Below it, a **category breakdown** (sum per category)
     and a **grand total**.
3. Categorize with a simple keyword map you can extend, e.g. Uber/Lyft/taxi →
   Travel; restaurant/coffee/lunch → Meals; Adobe/Figma/subscription/SaaS →
   Software; staples/paper/supplies → Supplies; everything else → Other.
4. Parse the amount as the last number on the line; parse a leading ISO date if
   present. Be forgiving — never crash on a weird line, just put it in "Other".
5. House style: clean, tabular, easy to scan. One accent color. A small "Export
   CSV" button that downloads the table is a nice touch.

## Finish

After writing the files:

1. Call **`launch_preview`** with `{ "dir": "receipt-sorter" }`.
2. Call **`record_use`** with recipe id `receipt-sorter` and a short summary.
3. Tell the user it's live in the preview, briefly.
