--- name: log-work-expense description: Log work expenses into MongoDB. Use when the user sends receipt images or odometer photos along with context, or says things like "log this expense", "record this receipt", "mileage for XYZ", "meals for XYZ", or provides any expense details for work reimbursement tracking. Triggers on any message that includes expense context (account, type, images of receipts or odometers). --- # Log Work Expense Log work expenses into `wip.work_expenses` via `scripts/log_expense.py`. ## Trigger Phrases - "log this expense", "record this receipt", "add this to my work expenses" - "mileage for XYZ", "meals for XYZ" ## Steps 1. **Classify images** — Run each image through `scripts/classify_image.py ` to determine if it is a `receipt` or `odometer`. The script outputs exactly one word. ⚠️ **Do NOT analyze receipt/odometer images yourself.** Do not extract merchant names, amounts, item details, or calculate mileage. Do not analyze odometer photos to figure out which image comes first. Do not analyze receipts to get dates from the receipts. You are only allowed to run the image classification script. Do not examine the images yourself. THIS IS LAW! 2. **Determine type and account** — The user provides the expense type and account in their verbal prompt to you (e.g. "meals and mileage for LTISD"). Ask if unclear. 3. **Upload images to S2** — Upload all images to S2 and collect the URLs. 4. **Insert via script** — Run the script once **per entry**: ```bash uv run --with pymongo ~/notes/skills/log-work-expense/scripts/log_expense.py "" [s2_url_2] [--route "stop1|stop2"] ``` - **Meal receipts**: Run once per receipt (1 file each). - **Mileage**: Run once with both odometer URLs (2 files). The order of start/end odometer images does not matter — just pass both URLs. The script enforces file counts and rejects invalid input. ### Mileage Routes For mileage entries, always include `--route` with the destination address(es). Separate multiple stops with `|`. Home (`11600 Minda Cir Austin, TX 78758`) is automatically prepended and appended — only provide the intermediate stop(s). - **One address**: `--route "123 Main St Austin, TX"` → route becomes `[home, "123 Main St Austin, TX", home]` - **Multiple addresses**: `--route "123 Main St Austin, TX|456 Elm St Austin, TX"` → route becomes `[home, "123 Main St Austin, TX", "456 Elm St Austin, TX", home]` If the user doesn't specify an address, ask for it. #### Shorthand Aliases When the user says a shorthand, expand it to the full address before building the route: | Shorthand | Full Address | |-----------|-------------| | `airport` or `AUS` | `3201 Presidential Blvd, Austin, TX 78719` | 5. **Confirm** — Brief summary of what was logged. ## Notes - Use `classify_image.py` for image classification — it calls the vision model and returns only "receipt" or "odometer". - Use the S2 upload endpoint from TOOLS.md for file uploads. - The log script hardcodes MongoDB connection details — do not pass credentials.