AIToday
Large Language ModelsAI Coding AssistantsZenn AI/MLPublished: Oct 11, 2026, 10:00 JST

Claude Code invoice skill splits AI from the math

Claude Code invoice skill splits AI from the math

The skill hands Claude Code one job — turn the conversation into a JSON file with client, items, quantities and unit prices — and no totals, tax or document numbers. A Node.js script then computes subtotals and consumption tax, lays out the pages and assigns numbers only when issued, such as E-2610-01 for October 2026's first estimate.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, in your inbox every morning.

Context & Analysis

The author frames the whole exercise around three concrete failures that show up when you ask Claude Code for a business document. Line items multiply and the subtotal or consumption tax can drift, and a wrong invoice damages the relationship with the client. The layout shifts every time, with different margins and typefaces from the previous version. And because the AI cannot carry a number across separate conversations, document numbers collide.

The published setup answers each of those by moving responsibility rather than improving the prompt. Drafts are rendered with a 'draft' mark in the top left and no number at all, and the script counts whether content overflows the A4 page in Chrome's PDF output and stops if it does, pushing overflow to the next page automatically when there are many line items. Issued documents are recorded line by line in a file, the next number is taken after the largest one in the same month, and issued documents are never overwritten.

The author's general rule, drawn from building this, is that anything where a mistake is costly and anything that should be identical every time belongs in a script, while the AI is left only to read the intent out of the conversation. The stated reason is that instructions in a SKILL.md file — round down on consumption tax, number sequentially — are obeyed only by luck, whereas a script with tests behaves the same way each run.

FAQ
What does Claude Code actually produce in this setup?
Only a JSON file covering client, subject, items, quantity, unit price, delivery and payment terms. Totals, consumption tax and document numbers are deliberately left out.
When does an invoice or estimate get a real number?
Only when a person runs the issue command. Drafts carry no number and are marked as drafts, so they can be regenerated as many times as needed.
What is not supported?
Reduced 8% tax rates, cancellations, discounts and refunds, withholding tax fields, delivery notes and receipts. It was verified on Windows 10 with Node.js 24, and it does not make tax judgments.

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleByte Transformers beat subword models as scale grows