---
name: receipt-ingest
title: "Receipt Ingest"
description: "Process a single receipt or invoice file: vision/OCR + structured extraction → TransactionDraft."
category: finance
status: active
model_tier: capable
priority: 7
triggers:
  - "process this receipt"
  - "ingest invoice"
  - "scan this bill"
  - "extract from receipt"
  - "ingesting receipt"
  - "process expense"
tools_granted:
  - ingest_receipt
  - query_finance
  - query_knowledge
language:
  output_policy: source
---

## What this skill is

Owns step 1 of the `receipt-processing` workflow: take ONE file from `agntspace-finance/inbox/`, route it through the file-type registry (`receipt-image` for jpg/png/heic, `receipt-pdf` for digital + scanned invoices), structure the LLM output into a `TransactionDraft`, and write it to `agntspace-finance/pending/{txn_id}.md` for downstream skills.

This skill DOES NOT commit anything to the ledger. It only produces drafts. Commit happens at the workflow's `stage` step after the user approves.

## When to use

- A new file appears in `agntspace-finance/inbox/` and the watcher dispatches the workflow.
- The user explicitly says "process this receipt" with a file path.
- Re-extracting an existing source via the `↑ Upgrade extraction` button on a transaction's source page.

## Flow

1. Call `ingest_receipt(path)` with the inbox file path.
2. The tool routes through the file-type registry, runs vision/OCR + structured extraction, and returns `{draft_id, merchant_raw, total, currency, item_count, audit_flags}`.
3. Surface the result as a one-line acknowledgement (`Drafted transaction at <merchant> for <total> <currency> (<N> items). Pending review at /finance.`).
4. Do NOT call `commit_transaction` from this skill — categorization and project attribution happen in subsequent workflow steps before commit.

## Hard rules — anti-fabrication

- NEVER invent a merchant name, line item, total, or date that the receipt doesn't actually show. If the field is illegible or absent, mark it empty in the draft and flag `audit_flags: ["unreadable_<field>"]`.
- NEVER include a card PAN or CVV in any output. Mask payment methods to last-4 digits only (`card-ending-1234`) — the receipt-image / receipt-pdf prompt_focus already enforces this.
- If totals don't reconcile (sum of items + tax ≠ total), DO NOT round to make them match. Add `totals_mismatch` to `audit_flags` and let the auditor decide.
- NEVER pre-categorize line items here — that's the `transaction-categorize` skill's job in the next step. Leaving them empty is correct.

## Examples

- input: |
    Process the receipt at finance/inbox/2026-04-25-coffee.jpg
  output: |
    [Calls tool: ingest_receipt with {"path": "finance/inbox/2026-04-25-coffee.jpg"}]
    Drafted transaction at Blue Bottle Coffee for $8.50 USD (2 items). Pending review at /finance.

- input: |
    Run skill `receipt-ingest` with arguments:
    {"path": "finance/inbox/aws-2026-04-invoice.pdf"}
  output: |
    [Calls tool: ingest_receipt with {"path": "finance/inbox/aws-2026-04-invoice.pdf"}]
    Drafted transaction at Amazon Web Services for $342.18 USD (12 line items). Tax line reconciles. Pending review at /finance.

- input: |
    Run skill `receipt-ingest` with arguments:
    {"path": "finance/inbox/blurry-restaurant.jpg"}
  output: |
    [Calls tool: ingest_receipt with {"path": "finance/inbox/blurry-restaurant.jpg"}]
    Drafted transaction with audit flags [unreadable_merchant, totals_mismatch]. The merchant name was illegible and items don't sum to total. Pending manual review at /finance.
