# I Open-Sourced a PDF Invoice Skill for Coding Agents

> I open-sourced a PDF invoice skill for coding agents. One prompt updates days, discount, fees, and the balance due on a generated PDF.

- Author: Kai Wang (AI Kai)
- Published: 2026-09-10
- Updated: 2026-09-10
- Topic: Agent Workflows
- Tags: agent-skills, pdf, invoice, coding-agents, open-source
- Canonical: https://hqman.me/blog/pdf-invoice-skill/

Every week I opened a PDF editor, changed a few numbers, then checked the totals by hand. Days, discount, service fee, deposit, and the balance due. Miss one line and the invoice is wrong.

I turned that chore into a PDF invoice skill for my coding agent and open-sourced it. The public repo uses a fictional invoice, so you can run the workflow without anyone's real billing data.

<video controls preload="metadata" poster="/media/blog/pdf-invoice-skill/pdf-invoice-skill-poster.jpg" width="100%">
  <source src="/media/blog/pdf-invoice-skill/pdf-invoice-skill-demo.mp4" type="video/mp4" />
  <a href="/media/blog/pdf-invoice-skill/pdf-invoice-skill-demo.mp4">Download the PDF invoice skill demo</a>
</video>

## The demo

The sample bills three event services by the day: setup, on-site coordination, and pack-down. A percentage discount comes next, then a 3% service fee on the discounted subtotal, then the paid deposit.

The clip starts at 3 days of on-site coordination and a 12.5% discount. Balance due: USD 1,254.65.

I sent this:

```
The client extended on-site coordination from 3 to 5 days. Give them a 15% discount instead, keep everything else the same, and open the updated invoice.
```

The agent kept the daily rates and the deposit. It rewrote the day count, line amount, subtotal, discount, service fee, total, and balance. New balance: USD 1,691.76.

## Try it

The code is in [hqman/invoice-workflow](https://github.com/hqman/invoice-workflow).

Python 3.10+ and reportlab. Copy `skills/invoice-workflow/` into your agent's skill folder, or open the project and tell the agent to read `SKILL.md`.

```
Read skills/invoice-workflow/SKILL.md. Use its fictional sample to generate a PDF. Show me the discount, service fee and balance due.
```

Put names, day counts, rates, discount, and fee in JSON. The generator refuses to overwrite an existing PDF, so each revision gets a new file.

The folder is small: one `SKILL.md`, a JSON sample, and a script. I used the same pattern in the [Humanizer skill](https://hqman.me/blog/humanizer-skill/) post.

## Limits

This skill draws a fresh PDF from JSON. It does not patch an arbitrary existing layout, and it does not copy metadata from an old invoice. Currency is a label, not a conversion. Tax and credit notes are out of scope.

If you have a stack of similar PDFs that need the same kind of number changes on a schedule, start from this sample and adapt the JSON to your template.

## Sources

- [invoice-workflow on GitHub](https://github.com/hqman/invoice-workflow)
- [Humanizer skill](https://hqman.me/blog/humanizer-skill/)
