Command Palette

Search for a command to run...

YepAPI
Free · All Tools

Invoice Generator Agent Skill

PDF invoice generation, tax calculations, multi-currency, line items, and payment status.

invoicespdfbillingtax

The Skill

Full content, every format. Copy it, download it, or install with one command.

SKILL.md
---
description: PDF invoice generation, tax calculations, multi-currency, line items, and payment status.
homepage: https://yepapi.com/skills/invoice-generator
metadata:
  tags: [invoices, pdf, billing, tax]
---

# Invoice Generator

## Rules

- PDF generation: use `@react-pdf/renderer` or `puppeteer` — React PDF for simple layouts, Puppeteer for pixel-perfect HTML-to-PDF
- Invoice number: sequential, unique, never reuse — format: `INV-2025-0001` — store a counter in the database
- Line items: array of `{ description, quantity, unitPrice, amount }` — amount = quantity * unitPrice, all in cents
- Tax calculation: calculate per line item or on subtotal depending on jurisdiction — store tax rate and tax amount separately
- Multi-currency: store `currencyCode` (ISO 4217) per invoice — format with `Intl.NumberFormat(locale, { style: 'currency', currency })`
- Payment status: enum `draft | sent | paid | overdue | void` — track `sentAt`, `paidAt`, `dueDate`
- Totals: subtotal (sum of line items), tax, discount, total — always recalculate from line items, never store only the total
- Due date: default net-30 from issue date — mark overdue automatically via cron when `dueDate < now AND status = 'sent'`

## Invoice Schema

```sql
CREATE TABLE invoices (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  invoice_number TEXT UNIQUE NOT NULL,
  customer_id UUID NOT NULL,
  status TEXT DEFAULT 'draft',
  currency_code TEXT DEFAULT 'USD',
  subtotal_cents INTEGER NOT NULL,
  tax_cents INTEGER DEFAULT 0,
  discount_cents INTEGER DEFAULT 0,
  total_cents INTEGER NOT NULL,
  due_date DATE,
  sent_at TIMESTAMP,
  paid_at TIMESTAMP,
  created_at TIMESTAMP DEFAULT NOW()
);

CREATE TABLE invoice_line_items (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  invoice_id UUID REFERENCES invoices(id),
  description TEXT NOT NULL,
  quantity INTEGER DEFAULT 1,
  unit_price_cents INTEGER NOT NULL,
  amount_cents INTEGER NOT NULL
);
```

## Avoid

- Floating point for currency — use integer cents, convert only for display
- Mutable invoice numbers — once assigned, never change
- Missing tax breakdown — required for compliance in most jurisdictions
- No PDF download — always provide a downloadable PDF alongside the web view

Install

Why Use the Invoice Generator Skill?

Without this skill, your AI guesses at invoice generator patterns. It might hallucinate deprecated APIs, use outdated conventions, or miss best practices entirely. With it, your AI follows a proven ruleset — every suggestion aligns with current standards.

Drop this skill into your project and your AI instantly knows the rules. Better code suggestions, fewer errors, faster shipping.

Try These Prompts

These prompts work better with the Invoice Generator skill installed. Your AI knows the context and writes code that fits.

"Build a PDF invoice generator with line items, tax calculations, and payment status tracking"

"Create an invoice system with sequential numbering, multi-currency, and email delivery"

"Add invoice management with draft/sent/paid workflows and overdue notifications"

Invoice Generator skill — FAQ

It provides PDF generation patterns, tax calculations, multi-currency support, and payment status tracking. Your AI builds invoice systems with proper line item math and status workflows.

Run `npx skills add YepAPI/skills --skill invoice-generator` in your project root. This copies the skill file into your repo where your AI coding tool can read it automatically.

It stores currency codes (ISO 4217) per invoice and uses Intl.NumberFormat for display formatting. All amounts are stored in cents to avoid floating-point precision issues.

Want more skills?

Browse all 110 free skills for builders.

See All Skills