expense-report

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Expense Report

费用报告

You scan a folder of receipts and produce two things: a categorized spreadsheet of every line item, and an HTML dashboard summarizing the period. The user drops receipts in a folder throughout the month; you handle the rest.
你需要扫描收据文件夹并生成两项内容:包含所有明细项的分类电子表格,以及汇总该时段支出的HTML仪表盘。用户只需整月将收据放入文件夹,其余工作由你完成。

Before you start

开始前准备

Identify the folder of receipts. The user may point at:
  • A dedicated
    receipts/
    or
    expenses/
    folder
  • A
    Downloads/receipts/
    folder
  • A specific date-range subfolder
  • A cloud-synced folder (Drive, Dropbox)
Check if
expense-config.md
exists. If yes, read it — it should define:
  • The user's expense categories (e.g., Software / SaaS, Travel, Meals, Marketing, Contractors, Office, Other)
  • Personal vs business split rules (if mixed)
  • Default currency
  • Tax-relevant categories (deductible, reimbursable)
  • Anything to auto-exclude (personal Amazon receipts, recurring subscriptions already tracked elsewhere)
If no config exists, run a one-time setup based on a sample of receipts:
  1. Scan 10–20 receipts to understand the user's spending shape
  2. Propose a category list
  3. Confirm with the user
  4. Save to
    expense-config.md
确定收据文件夹的位置。用户可能指向:
  • 专用的
    receipts/
    expenses/
    文件夹
  • Downloads/receipts/
    文件夹
  • 指定日期范围的子文件夹
  • 云同步文件夹(Drive、Dropbox)
检查是否存在
expense-config.md
文件。如果存在,读取该文件——其中应定义:
  • 用户的费用分类(例如:软件/SaaS、差旅、餐饮、营销、承包商、办公、其他)
  • 个人与商务支出的拆分规则(若混合存在)
  • 默认货币
  • 与税务相关的分类(可抵扣、可报销)
  • 需自动排除的项目(个人亚马逊收据、已在其他地方追踪的定期订阅)
如果不存在配置文件,则基于收据样本完成一次性设置:
  1. 扫描10-20张收据,了解用户的支出结构
  2. 提出分类列表建议
  3. 与用户确认
  4. 保存至
    expense-config.md

Process the receipts

处理收据

For each receipt file:
  1. Extract — vendor name, date, total amount, tax (if shown), payment method (if shown), individual line items if itemized
  2. Categorize — assign to one of the user's categories. If a vendor has been categorized before (e.g., AWS = Software), use the prior categorization for consistency.
  3. Flag — receipts that are unclear (image too dark, partially cropped, unclear total) get flagged for user review rather than guessed
  4. Detect duplicates — same vendor + same amount + within 3 days = likely duplicate. Flag, don't auto-merge.
If a receipt has multiple categories (e.g., a Costco run with both office supplies and personal items), either split into multiple line items or flag for the user to review.
针对每个收据文件:
  1. 提取信息——商家名称、日期、总金额、税费(若显示)、支付方式(若显示),若为明细收据则提取单个明细项
  2. 分类——将其归入用户的某一分类。如果该商家此前已有分类(例如:AWS = 软件),则沿用之前的分类以保持一致性。
  3. 标记——信息不清晰的收据(图片过暗、部分裁剪、金额模糊)需标记为待用户审核,而非猜测分类。
  4. 检测重复项——相同商家+相同金额+时间间隔在3天内 = 疑似重复。标记该项目,不自动合并。
如果一张收据涉及多个分类(例如:Costco采购包含办公用品和个人物品),则要么拆分为多个明细项,要么标记为待用户审核。

Output 1: The spreadsheet

输出1:电子表格

Save as
expenses-YYYY-MM.xlsx
(or
.csv
if Excel isn't available). Columns:
| Date | Vendor | Description | Category | Subcategory | Amount | Tax | Total | Payment method | Receipt file | Notes |
Sorted by date descending. Include a totals row at the bottom and subtotals by category in a second sheet.
Also include a "Flagged for review" sheet with anything you couldn't confidently categorize.
保存为
expenses-YYYY-MM.xlsx
(若无法使用Excel则保存为
.csv
)。列信息如下:
| 日期 | 商家 | 描述 | 分类 | 子分类 | 金额 | 税费 | 总计 | 支付方式 | 收据文件 | 备注 |
按日期降序排序。在表格底部添加总计行,并在第二个工作表中按分类添加小计。
同时添加一个“待审核标记项”工作表,包含所有无法确定分类的项目。

Output 2: The dashboard

输出2:仪表盘

Save as
expense-dashboard-YYYY-MM.html
. Interactive HTML dashboard with:
  1. Headline strip — total spend, vs prior period, count of receipts, average receipt size
  2. Spend by category — donut or bar chart, with totals and percentages
  3. Spend over time — line or bar chart showing daily/weekly spend in the period
  4. Top vendors — table, ranked by total spend, with count of receipts
  5. Trends — any category trending up or down vs prior period, with your read on why if obvious
  6. Tax-relevant subtotals — total of categories marked deductible/reimbursable
  7. Flagged items — anything that needs the user's eyes
保存为
expense-dashboard-YYYY-MM.html
。交互式HTML仪表盘包含以下内容:
  1. 标题栏——总支出、与上期对比、收据数量、平均单笔收据金额
  2. 分类支出占比——环形图或柱状图,显示各分类的总金额及占比
  3. 支出趋势——折线图或柱状图,展示该时段内每日/每周的支出情况
  4. 顶级商家——按总支出排序的表格,显示商家及对应的收据数量
  5. 趋势分析——与上期相比支出上升或下降的分类,若原因明显则说明原因
  6. 税务相关小计——标记为可抵扣/可报销的分类总金额
  7. 标记项——所有需要用户查看的项目

Output 3: A short chat summary

输出3:简短聊天摘要

In the chat reply, print:
📊 Expense report — [month/period]

Total spend: $X,XXX across [N] receipts
Biggest category: [Category] at $XXX ([%])
Notable: [one specific observation — "you tripled software spend this month," "5 meal receipts over $200 in 3 days," etc.]
Tax-relevant: $X,XXX deductible

Flagged for review: [N] items
Spreadsheet: [path]
Dashboard: [path]
在聊天回复中输出:
📊 费用报告 — [月份/时段]

总支出:$X,XXX,共[N]张收据
最大支出分类:[分类],金额$XXX(占比[%])
值得关注:[具体观察结果 — “本月软件支出增长至三倍”“3天内有5张超过200美元的餐饮收据”等]
税务相关:$X,XXX可抵扣

待审核标记项:[N]项
电子表格:[路径]
仪表盘:[路径]

Running on a schedule

定时运行

After the first manual run, suggest scheduling:
"Want me to run this every Sunday and roll up the week, then send you a Slack summary? At the end of the month, I'll produce the full report."
If yes, set up a recurring task. The weekly version is short (just the chat summary + spreadsheet update). The monthly version is the full dashboard + report.
首次手动运行后,建议设置定时任务:
“需要我每周日运行一次并汇总当周支出,然后向你发送Slack摘要吗?月末我会生成完整的报告。”
如果用户同意,则设置重复任务。周版本仅包含聊天摘要+电子表格更新,月版本则包含完整的仪表盘+报告。

Edge cases

边缘情况处理

  • Receipts in non-English languages — translate vendor and item descriptions but keep totals in original currency, then convert.
  • Receipts that are actually invoices — distinguish: a receipt = paid, an invoice = owed. Don't lump unpaid invoices into the expense report.
  • Crypto / unusual payment methods — extract what you can but flag.
  • Tips on restaurant receipts — include in the total, note tip separately if shown.
  • Subscription receipts (Stripe, etc.) — categorize as recurring software unless context suggests otherwise.
  • Sales tax handling — separate sales tax in its own column. Some jurisdictions need it reported separately for accounting.
  • 非英文收据——翻译商家和明细描述,但保留原货币单位的总金额,之后再进行货币转换。
  • 实为发票的收据——区分两者:收据=已付款,发票=待付款。不要将未付款的发票归入费用报告。
  • 加密货币/特殊支付方式——提取尽可能多的信息并标记。
  • 餐厅收据中的小费——将小费计入总金额,若单独显示则备注小费金额。
  • 订阅收据(Stripe等)——除非有其他上下文,否则归类为定期软件支出。
  • 销售税处理——将销售税单独列在一列。部分地区的会计要求单独申报销售税。

Why this works the way it does

设计思路

Most bookkeeping software requires manual entry or fragile OCR pipelines. By dropping receipts in a folder and having a skill that re-processes the whole folder every run, you get a system that's idempotent and self-correcting: if a categorization is wrong, re-run after editing
expense-config.md
and it'll re-categorize cleanly. The user owns the data (it's just files in a folder) and the dashboard is regenerable on demand.
大多数记账软件需要手动录入或依赖脆弱的OCR流程。通过将收据放入文件夹,由Skill每次运行时重新处理整个文件夹,你将获得一个幂等且可自我修正的系统:如果分类错误,编辑
expense-config.md
后重新运行,即可完成正确的重新分类。用户拥有数据所有权(仅为文件夹中的文件),且可按需重新生成仪表盘。

Rules

规则

  1. Don't guess when unsure. Flag for review. A flagged item is recoverable; a wrongly categorized expense compounds.
  2. Use consistent vendor naming. "Amazon," "amazon.com," and "AMZN Mktp US" should all be normalized to "Amazon." Maintain a vendor-name map in
    expense-config.md
    and grow it over time.
  3. Don't reprocess from scratch every run unless asked. Cache extracted data so re-runs are fast.
  4. Surface anomalies in the dashboard. A 5x jump in a category, an unusually large single receipt, a new vendor — these deserve a callout.
  5. Don't moralize. This is an accounting tool, not a financial advisor. If the user spent $4K on meals last month, report it; don't comment.
  1. 不确定时不要猜测——标记为待审核。标记的项目可修正,而错误分类的支出会产生连锁问题。
  2. 使用统一的商家命名——“Amazon”“amazon.com”和“AMZN Mktp US”应统一为“Amazon”。在
    expense-config.md
    中维护商家名称映射表,并随时间不断完善。
  3. 除非用户要求,否则不要每次运行都从头处理——缓存提取的数据,使重新运行更快。
  4. 在仪表盘中显示异常情况——某分类支出增长5倍、单笔收据金额异常巨大、新商家等,都需要特别标注。
  5. 不要进行道德评判——这是会计工具,而非财务顾问。如果用户上月在餐饮上花费4000美元,只需如实报告,不要发表评论。