39 lines
1.7 KiB
Markdown
39 lines
1.7 KiB
Markdown
---
|
|
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 <path>` to determine if it is a `receipt` or `odometer`. The script outputs exactly one word.
|
|
|
|
2. **Determine type and account** — The user provides the expense type and account (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 <type> <account> <date> "<note>" <s2_url_1> [s2_url_2]
|
|
```
|
|
|
|
- **Meal receipts**: Run once per receipt (1 file each).
|
|
- **Mileage**: Run once with both odometer URLs (2 files).
|
|
|
|
The script enforces file counts and rejects invalid input.
|
|
|
|
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.
|