Invoice Organizer logo

Invoice Organizer

Community
OJY-lawyer
invoice-organizer

发票 PDF 批量整理归类与去重。解析中文电子发票的销售方、商品、金额、日期和发票号,按费用类目复核后重命名,生成归类报告;可生成 MD5 去重计划,经授权把重复副本送入 Windows 回收站。适用于整理发票、发票归类、增量整理及报销票据去重。

Overview

PublisherOJY-lawyer
Repositoryinvoice-organizer-skill
Skill nameinvoice-organizer
Stars
33
Forks
1
Bundled files
13
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 13 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by OJY-lawyer on GitHub. Read the source before you install it.

Installation

Install the Invoice Organizer AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/OJY-lawyer/invoice-organizer-skill/tree/main
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/OJY-lawyer/invoice-organizer-skill.git \
  .claude/skills/invoice-organizer
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Invoice Organizer in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Invoice Organizer on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Invoice Organizer is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

发票整理归类

通用脱敏发布版。

处理带可提取文本层的 PDF 电子发票,保留中文内容。执行前确认用户指定的发票目录和本批任务范围;费用归类使用费用类目指引,以 7 个常用类目为优先选项,其余 16 项为次要选项。

运行准备

  • 使用 Python 3.10 或更新版本和 pypdfium2,依赖版本见 requirements.txt。先复用用户已配置的解释器;需要安装依赖时按当前环境的授权规则处理。
  • 本版不绑定个人电脑、固定发票目录或 Agent 客户端。下列命令从本 Skill 目录执行,python 需替换为当前环境实际可用的解释器。
  • 所有业务命令必须显式传入一个已存在的发票目录;不以安装目录或当前工作目录作为默认业务目录。过程数据仍位于 <发票目录>/.workbuddy/temp/,这只是目录名,不要求安装 WorkBuddy。
  • 环境检查可运行 python -X utf8 -B -c "import pypdfium2; print('OK')"。原脚本在模块顶层运行业务流程,不用导入业务模块的方式做环境检查。
  • 回收站去重步骤仅适用于 Windows 本地磁盘。网络盘、映射盘、外接设备及未支持的平台,不自动尝试删除,保留去重清单交用户处理。

首次配置

购买方完整名称和税号由使用者提供,仅在当前进程环境中设置;不把真实配置写进公开源码。首次解析前填写 INVOICE_BUYER_NAME、INVOICE_BUYER_ID;使用餐饮本市/外地示例规则时,再设置 INVOICE_HOME_CITY。工作所在地未配置或票面地区不清时,保留餐饮待确认。

powershell
# 将空字符串换为本批真实配置,再执行解析命令。
$env:INVOICE_BUYER_NAME = ''
$env:INVOICE_BUYER_ID = ''
$env:INVOICE_HOME_CITY = ''

本版不含预设单位、税号、个人路径或真实业务记录。仅在票面实际出现买方信息时,将其记为识别结果;配置值只是解析锚点。

工作流

将下列示例中的发票目录替换为用户指定的绝对路径。先读取类目指引,再操作本批文件。

powershell
$invoiceRoot = '请填写已存在的发票目录绝对路径'

# 1. 提取票面字段,生成 invoices.json
python -X utf8 -B scripts/parse_invoices.py $invoiceRoot

# 2. 初步归类,生成 classified.json
python -X utf8 -B scripts/classify.py $invoiceRoot

# 3. 查重;增量批次先查重再重命名
python -X utf8 -B scripts/check_dupes.py $invoiceRoot

# 4. 如有重复,先只生成清单
python -X utf8 -B scripts/plan_dedupe.py $invoiceRoot

dedupe_plan.txt 是拟移除副本清单。先向用户展示删除项和对应保留项;执行前核实清单中的路径均为指定目录内的 PDF,保留副本仍存在且内容一致。取得覆盖本次清单的授权后,才运行:

powershell
python -X utf8 -B scripts/trash_dupes.py $invoiceRoot
python -X utf8 -B scripts/verify_trash.py $invoiceRoot

去重后重新运行解析和归类,再应用本批已确认的类目修正。未发生去重时继续使用本批数据。核对销售方、价税合计、票据数量和类目;把必要的分类修正写入本批 classified.json,不要为一次归类更改共享规则。

重命名前检查源文件、最终文件名及目标占用情况,确认执行范围仅含已确认的记录。“其他”、提取失败、金额不清或用途有争议的记录保留待确认,不进入本次重命名。已经带类目前缀的历史文件按增量规则跳过。

powershell
# 5. 按已复核的 category 添加「类目_」前缀
python -X utf8 -B scripts/do_rename.py $invoiceRoot

# 6. 生成发票归类报告
python -X utf8 -B scripts/make_report.py $invoiceRoot

配置与归类

scripts/config.py 包含买方锚点、可选开票人映射和 KNOWN_CATS 前缀清单。KNOWN_CATS 包含全部 23 个费用类目;这不表示规则引擎已实现 23 类自动判断。次要类目依赖明细和已知用途进行复核。

常用优先选项为业务招待费、差旅费、交通费、办公费、车辆费用、中介机构费、福利费。餐饮地区及租车、服装等归类口径以本批明确要求为准;默认示例规则不代表任意单位的报销制度。

保留的解析与操作要点

  1. 双层 PDF 直接提取文本,逐页拼接,必要时展平换行后匹配。扫描图片、缺失文本层、异常布局应列为待复核,不把缺失字段补成事实。
  2. 销售方定位结合买方名称和税号锚点、销售方信息标签、名称与税号配对、可选开票人映射;拒绝“统一社会信用代码”等标签碎片。两列布局里的公司名匹配需避免非贪婪规则截断名称。
  3. 中文字符匹配覆盖 CJK 兼容字符区;日期兼容特殊月、日字符;JSON 和 Markdown 明确使用 UTF-8。
  4. 价税合计优先匹配大写中文金额后的数字金额,不能把不含税合计当报销总额。现有兜底提取仍可能需要人工核验。改动金额解析时可用 compare_amounts.py 对比修改前后的 invoices.json。
  5. 机票代订关键词可能在商品子类,需结合航班、乘机人等备注;航空人身险需确认与乘机关联;铁路电子客票及铁路退票费按交通费示例口径。
  6. 已有类目前缀的文件跳过,防止前缀重复。两步重命名不等于整批事务,运行前完成冲突检查,异常后核对实际文件状态再继续。
  7. MD5 用于识别字节内容相同的副本,不等同于识别所有重复报销或税务查验。优先保留已分类版本;全未分类时保留排序第一份。回收站操作返回成功、文件离开原目录、实际可恢复是不同证据。verify_trash.py 提供回收站条目线索,完整原路径、对应内容和本次操作时点还需核实;核实不足时不宣称已证明可恢复。
  8. 已有手工文件名如果缺少类目后的下划线,应单独列出并核实,不能直接批量重命名历史文件。

交付

  • 已整理的 PDF 文件及 发票归类报告.md。
  • 报告说明类目分布、每张票的日期、销售方、金额和备注,另列重复线索、待确认事项及本批人工修正依据。
  • 发票、运行 JSON、报告和个人配置均留在用户指定的本地目录;不随 Skill 分享或上传仓库。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Invoice Organizer AI skill do?

发票 PDF 批量整理归类与去重。解析中文电子发票的销售方、商品、金额、日期和发票号,按费用类目复核后重命名,生成归类报告;可生成 MD5 去重计划,经授权把重复副本送入 Windows 回收站。适用于整理发票、发票归类、增量整理及报销票据去重。

Why use Invoice Organizer on TypingMind?

Because you install it once and use it with any model. Invoice Organizer is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Invoice Organizer in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/OJY-lawyer/invoice-organizer-skill/tree/main. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Invoice Organizer?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Invoice Organizer?

As many as you like. As long as a model supports skills, you can use Invoice Organizer with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Invoice Organizer AI skill free?

It is published on GitHub by OJY-lawyer. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇