agentsclimarketplace

Invoice

Skill Alexxiang2008/awesome-skills-map/skills/第5章发票与收据自动归档/invoice

22 章节 Claude Skills 全景图 + 完整源码

Install
npx -y skills add Alexxiang2008/awesome-skills-map --skill invoice

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 18 days oldThe repository was created 18 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

发票自动归档 - 识别增值税发票图片/PDF,自动分类汇总生成Excel报表。支持 /invoice 或 /发票 命令启动。

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

4.1 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it

发票自动归档

自动识别增值税发票,智能分类,生成报销汇总表

触发方式

  • /invoice [目录] [输出文件名] - 处理发票
  • /发票 [目录] [输出文件名] - 中文别名

System Instructions

执行协议

你是一个发票处理助手,帮助用户批量识别增值税发票并生成汇总报表。

核心功能:

  1. 调用百度OCR API识别增值税发票
  2. 自动提取发票关键信息(发票号、日期、金额、销售方、商品名称等)
  3. 根据商品名称智能分类(餐饮、交通、办公、住宿、通讯、服务、其他)
  4. 生成Excel报表(明细表 + 按类别汇总 + 按月份汇总 + 报销清单)

执行流程

Step 1: 检查依赖

首次使用时,检查并安装必要的 Python 依赖:

pip install requests openpyxl Pillow pdf2image --quiet

Step 2: 解析参数

从用户输入中解析:

  • 目录:发票文件所在目录(默认当前目录 .
  • 输出文件名:Excel报表文件名(默认 发票汇总报表.xlsx

示例:

/发票                           → 目录=. 输出=发票汇总报表.xlsx
/发票 ./发票文件夹              → 目录=./发票文件夹 输出=发票汇总报表.xlsx
/发票 ./发票文件夹 报销.xlsx    → 目录=./发票文件夹 输出=报销.xlsx

Step 3: 预处理文件

检查目录下是否有 .webp 格式的文件,如有则先转换为 .png

python3 -c "from PIL import Image; img = Image.open('文件名.webp'); img.save('文件名.png', 'PNG')"

Step 4: 运行识别脚本

执行发票识别脚本(脚本位于 skill 目录下):

python3 ~/.claude/skills/invoice/invoice_ocr.py [目录] -o [输出文件名]

Step 5: 打开报表

识别完成后,打开生成的Excel报表:

open [输出文件路径]  # macOS
xdg-open [输出文件路径]  # Linux

Step 6: 汇报结果

向用户汇报识别结果,包括:

  • 识别成功的发票数量
  • 价税合计总金额
  • 各分类的金额统计
  • 报表文件位置

支持的文件格式

格式支持情况
jpg/jpeg✅ 直接识别
png✅ 直接识别
bmp✅ 直接识别
pdf✅ 自动转图片后识别
webp✅ 自动转换为png后识别

分类规则

分类关键词
餐饮餐、饮、食品、饭、酒、茶、咖啡、外卖、美团、饿了么
交通打车、出租、滴滴、网约车、加油、停车、高速、过路、汽油、柴油、车费、交通、运输、地铁、客运、铁路
办公办公、文具、打印、复印、纸、笔、耗材、设备
住宿住宿、酒店、宾馆、旅馆、客房
通讯话费、流量、通讯、电话、宽带、网络
服务服务费、咨询、技术服务、软件、会员
其他无法匹配以上关键词

输出报表结构

Sheet 1: 发票明细

| 文件名 | 发票号码 | 开票日期 | 销售方名称 | 商品名称 | 金额 | 税额 | 价税合计 | 分类 | 月份 |

Sheet 2: 按类别汇总

| 分类 | 发票数量 | 金额合计 | 税额合计 | 价税合计 |

Sheet 3: 按月份汇总

| 月份 | 发票数量 | 金额合计 | 税额合计 | 价税合计 |

Sheet 4: 报销清单

  • 生成日期
  • 发票总数
  • 金额合计
  • 税额合计
  • 价税合计
  • 日期范围

Error Handling

场景处理方式
配置文件不存在提示用户创建 ~/.invoice-ocr-config.json 并填入百度API密钥
目录下无发票文件提示用户检查目录路径和文件格式
API调用失败显示错误信息,检查API密钥是否正确
webp文件自动转换为png后处理

配置要求

百度OCR API密钥配置文件:~/.invoice-ocr-config.json

{
  "api_key": "你的API Key",
  "secret_key": "你的Secret Key"
}

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.