invoice-generator
Skill0 starsChanged 7 months agoMITView on GitHub
Reads time sheet data for invoices directly from the Excel workbook, calculates the amounts, fills the HTML template, and converts it to PDF using html_to_pdf.py when the users requests for invoices to be generated.
- Installs packages
9 other projects use a version of this.
Adopted by
Most recently taken up by
- Cavada76/invoice-generatortheir own version, first seen Oct 3, 2026
- rickbauer327-cell/solo-stack-startertheir own version, first seen Sep 15, 2026
- THEROCKSSS/hermes-skills-portfoliotheir own version, first seen Aug 3, 2026
- Hassaan146/claude-skillstheir own version, first seen Jul 25, 2026
- GTMify/aigtmtheir own version, first seen May 25, 2026
- YepAPI/skillstheir own version, first seen Apr 12, 2026
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- claude-office-skills/skills★ 497same name
- GTMify/aigtm★ 25same name
- Hassaan146/claude-skills★ 18same name
- YepAPI/skills★ 8same name
- xcrrr/claude-skills★ 6same name
- rickbauer327-cell/solo-stack-starter★ 2same name
- THEROCKSSS/hermes-skills-portfolio★ 1same name
- Cavada76/invoice-generator★ 0same name
- vbrevik/claude_code_skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository2 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
The file
Show its rules and text
We split this skill into the rules it gives an agent
24 rules. 0 are common, 18 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
18
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Use this skill when the user asks to generate, create, or print an invoice.
- Distinctive: line 20
Create and activate a virtual environment (once per machine):
- Distinctive: line 39
If the user did not specify a month/year, use this logic:
- Distinctive: line 43
All other days → bill for the current month
- Distinctive: line 52
Always ask the user directly before generating the invoice:
- Very specific: line 62
remove characters invalid in Windows filenames (< > : " / \ | ?
- Very specific: line 63
keep only letters, numbers, -, and _
- Very specific: line 65
Use corporation_name in the invoice HTML and corporation_slug in the PDF filename.
- Distinctive: line 74
Do NOT write a Python script to do this: Run the one-liner directly in the terminal (or use your built-in file-reading tools) to extract …
- Distinctive: line 101
If Total Hours is present, use it directly.
- Very specific: line 102
If Total Hours is missing, calculate: hours = Amount ÷ hourly_rate
- Distinctive: line 103
If multiple rows match the same month across different years, prefer the nearest year to today.
- Distinctive: line 113
Default hourly rate: $150.00 CAD/hr (senior AI engineer contractor rate in Ontario).
- Distinctive: line 114
Use this unless the user provides a different rate — do not ask.
- Distinctive: line 128
Do NOT write a Python script to do this: Read the template file directly with your file-reading tools, do the string replacements in …
- Distinctive: line 169
Run the helper script (the only script in this skill).
- Distinctive: line 189
Before cleaning up, confirm the PDF was successfully generated:
- Distinctive: line 204
If the check passes (exit code 0), proceed to Step 9.
- Distinctive: line 205
If the check fails (exit code 1), stop and report the error to the user.
- Distinctive: line 206
Do not delete the HTML file.
- Distinctive: line 212
Delete the intermediate HTML file only after the PDF has been validated:
- Distinctive: line 229
No other scripts are needed — the agent handles data extraction, calculation, and template filling directly from the instructions above.
- Very specific: line 237
If the workbook is open in Excel, use the copy at .agents/skills/invoice-generator/references/Invoice Raised vs Received.xlsx.
- Very specific: line 240
Update references/invoice_template.html with your own business details before first use.
“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Invoice Generator Skill
Use this skill when the user asks to generate, create, or print an invoice.
Important: Do NOT create any Python files or helper scripts in the project root or anywhere else. The only allowed script is
html_to_pdf.pywhich already exists. Do all data reading, calculation, and file editing directly using your built-in tools.
Step 1 — Set up the environment
Create and activate a virtual environment (once per machine):
python -m venv .venvInstall the one dependency needed to read the Excel file:
python -m pip install openpyxl
weasyprintis optional. If it is not installed,html_to_pdf.pyfalls back to Chrome/Edge headless automatically.
Step 2 — Determine the billing period
If the user did not specify a month/year, use this logic:
- Last 7 days of the current month → bill for the current month
- First 7 days of the current month → bill for the previous month
- All other days → bill for the current month
Step 3 — Prompt for corporation name
The corporation name appears in two places: the company name in the invoice header and the PDF filename. It must match in both.
Always ask the user directly before generating the invoice:
What is the exact corporation name to show on this invoice?
Then derive:
corporation_name— exact user-provided value for the invoice header (for example:987123 ONTARIO INC.)corporation_slug— filename-safe value built fromcorporation_name:- replace whitespace with
- - remove characters invalid in Windows filenames (
< > : " / \ | ? *) - keep only letters, numbers,
-, and_
- replace whitespace with
Use corporation_name in the invoice HTML and corporation_slug in the PDF
filename.
Step 4 — Read the Excel workbook
File: .agents/skills/invoice-generator/assets/Invoice Raised vs Received.xlsx
Do NOT write a Python script to do this. Run the one-liner directly in the terminal (or use your built-in file-reading tools) to extract the values:
python -c "
import openpyxl, datetime
wb = openpyxl.load_workbook('.agents/skills/invoice-generator/assets/Invoice Raised vs Received.xlsx', data_only=True)
for sheet in wb.sheetnames:
ws = wb[sheet]
headers = [str(c.value).strip() if c.value else '' for c in next(ws.iter_rows(min_row=1, max_row=1))]
print(sheet, headers)
for row in ws.iter_rows(min_row=2, values_only=True):
print(row)
"Scan every sheet for the target billing month. Look for these columns:
| Column | Accepted header names |
| Date | Date |
| Invoice number | Inv No, Invoice #, Invoice Number |
| Hours | Total Hours |
| Amount | Amount |
Find the row where the Date falls in the target month and year.
- If Total Hours is present, use it directly.
- If Total Hours is missing, calculate:
hours = Amount ÷ hourly_rate - If multiple rows match the same month across different years, prefer the nearest year to today; break ties by favouring the past over the future.
Extract:
invoice_number— from the Invoice columnhours_worked— from the Hours column (or calculated above)invoice_date— today's date
Step 5 — Calculate the amounts
Default hourly rate: $150.00 CAD/hr (senior AI engineer contractor rate in Ontario). Use this unless the user provides a different rate — do not ask.
subtotal = hours_worked × hourly_rate
hst = subtotal × 0.13 # 13% HST (Ontario)
total = subtotal + hstStep 6 — Fill the HTML template
Template file: .agents/skills/invoice-generator/references/invoice_template.html
Do NOT write a Python script to do this. Read the template file directly with your file-reading tools, do the string replacements in memory, and write the result out with your file-writing tools.
The template uses two types of elements — <input> fields (replace the
value="..." attribute) and <td> / <div> display cells (replace the text
content between the tags). Do not prompt the user for client or end-client
details; those are already set in the template.
<div> text content — replace text between the tags:
| Element class / selector | Value to insert |
.company-name (the <div> in the header) | corporation_name |
<input> fields — replace value="...":
| Element id | Value to insert |
invoiceNumber | invoice_number |
invoiceDate | today's date in YYYY-MM-DD format |
payPeriodFrom | StartDate |
payPeriodTo | EndDate |
hours | hours_worked (2 decimal places) |
rate | hourly_rate (2 decimal places, default 150.00) |
<td> display cells — replace text content between the tags:
| Element id | Value to insert |
amount | $subtotal (e.g. $1900.00) |
subtotal-display | $subtotal |
hst | $hst (e.g. $247.00) |
total | $total (e.g. $2147.00) |
Save the filled HTML to the project root as invoice_<invoice_number>.html.
Step 7 — Convert to PDF
Run the helper script (the only script in this skill). Always use absolute paths — Chrome headless silently discards output when given a relative PDF path.
$root = (Get-Location).Path
python .agents/skills/invoice-generator/scripts/html_to_pdf.py `
"$root\invoice_<invoice_number>.html" `
"$root\Inv-<invoice_number>-<corporation_slug>-<Mon>-<YYYY>.pdf"PDF naming convention: Inv-<InvoiceNumber>-<CorporationSlug>-<Mon>-<YYYY>.pdf
CorporationSlug— derived in Step 3 from the exact corporation nameMon— three-letter month abbreviation, e.g.AprYYYY— four-digit year
Step 8 — Validate the PDF
Before cleaning up, confirm the PDF was successfully generated:
$root = (Get-Location).Path
python -c "
import os, sys
pdf = r'$root\Inv-<invoice_number>-<corporation_slug>-<Mon>-<YYYY>.pdf'
if os.path.isfile(pdf) and os.path.getsize(pdf) > 0:
print(f'OK: {pdf} ({os.path.getsize(pdf):,} bytes)')
else:
print(f'ERROR: PDF not found or empty — {pdf}')
sys.exit(1)
"- If the check passes (exit code 0), proceed to Step 9.
- If the check fails (exit code 1), stop and report the error to the user. Do not delete the HTML file.
Step 9 — Clean up
Delete the intermediate HTML file only after the PDF has been validated:
Remove-Item -Path "invoice_<invoice_number>.html" -ErrorAction SilentlyContinueAbout html_to_pdf.py
This is the one script in the skill. It converts an HTML file to PDF using WeasyPrint if available, or falls back to Chrome/Edge headless:
python .agents/skills/invoice-generator/scripts/html_to_pdf.py <input.html> <output.pdf>No other scripts are needed — the agent handles data extraction, calculation, and template filling directly from the instructions above.
Notes
- Ignore workbook lock files that start with
~$. - If the workbook is open in Excel, use the copy at
.agents/skills/invoice-generator/references/Invoice Raised vs Received.xlsx. - Replace
[YOUR_HOURLY_RATE]with your actual rate when running commands. - Update
references/invoice_template.htmlwith your own business details before first use.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

