[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71K9DFC2ED8XKDYH89PNGWG":3,"skill-same:01M71K9DFC2ED8XKDYH89PNGWG":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":42,"repositoryHtmlUrl":43,"repositoryHomepageUrl":44,"ownerHtmlUrl":45,"ownerBlogUrl":46,"ownerDescription":47,"updatedAt":48,"install":49,"resources":62},"01M71K9DFC2ED8XKDYH89PNGWG","invoice-generator",null,"Generate professional invoices as HTML pages or React apps with PDF export.","clawdsolana\u002FOpenClawd","clawdsolana","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F279036008?v=4","01M71JTVF9FNGKE2SVJRPTQM31","OpenClawd","01M71JTVGCKWBSS8ZYC1HYWVA5",2,"MIT","https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fsecondary_skills\u002Finvoice-generator\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"invoice generator","generator","invoice","PDF","react","generate","export","html","pages","as","apps","professional","with","invoices","pdf export","2026-11-10 10:12:30",false,"---\nname: invoice-generator\ndescription: Generate professional invoices as HTML pages or React apps with PDF export.\n---\n\n# Invoice Generator\n\n## OpenClawd Operator Adaptation\n\nRun this skill as part of the OpenClawd operator deck. Preserve the skill-specific workflow below, but frame outputs for Solana-native agents when relevant: prefer OpenClawd language, note whether the work can support autonomous agent operations, and keep financial, legal, tax, hiring, medical, or other regulated outputs informational unless the skill already requires a stricter disclaimer. Use the Llobster Legend persona only as light operator framing; do not let branding override accuracy, safety, or the user's stated domain.\n\n\nBuild invoices as standalone HTML pages (preferred for simplicity) or React web artifacts. They auto-scale to fit the page and export to PDF via the browser's native print dialog. The web page is the single source of truth — the PDF is a print of it.\n\n> **NixOS note:** Puppeteer \u002F headless Chromium fails on this platform due to missing system libraries (`libglib-2.0.so.0`). Use`window.print()` (browser print dialog → Save as PDF) instead. The approach below is designed for that reality.\n\n## Before You Start Building — Gather Information First\n\n**Do NOT start building the invoice until you have enough information to populate real line items and details.** An invoice with placeholder data is useless.\n\n### If the user provides complete invoice details\n\nGo ahead and start building immediately. You have what you need.\n\n### If the user asks to \"make me an invoice\" without providing details\n\nYou MUST ask clarifying questions before writing any code. Ask about:\n\n1. **Seller info** — Business name, address, email, phone, logo (if any), VAT\u002Ftax ID (if applicable)\n2. **Client info** — Client\u002Fcompany name, address, contact email, VAT number (if B2B in EU)\n\n3. **Line items** — Description of each service\u002Fproduct, quantity, rate\u002Fprice per unit\n4. **Payment terms** — Net 30, due on receipt, etc. + preferred payment method (bank transfer, Stripe, PayPal, etc.)\n\n5. **Invoice number** — Do they have an existing numbering scheme, or should you start one?\n6. **Dates** — Invoice date, service\u002Fdelivery date (if different), due date\n\n7. **Tax** — What tax rate applies? (Sales tax, VAT, ITBIS, none?) This depends on jurisdiction.\n8. **Where is the seller based?** — Determines required legal fields, page size (US = Letter, everyone else = A4), and tax handling\n\n9. **Billing contact email** — Always ask explicitly. Do NOT invent a placeholder like `billing@company.com` — the user must confirm the real email address.\n10. **Production domain** — Always ask what domain the app is deployed to. Do NOT use the Replit dev domain or a made-up domain on the invoice itself.\n\n### How to ask\n\nStart with the essentials:\n\n> \"To create your invoice, I need a few details:\n>\n>\n>\n> 1. Your business name and address (the seller)\n>\n> 2. Who you're billing — client name and address\n>\n> 3. What you're billing for — list each item\u002Fservice with the quantity and price\n>\n> 4. Payment terms — when is it due, and how should they pay?\n>\n> 5. What email should clients contact for billing questions?\n>\n> 6. What domain is your app deployed to (for the website shown on the invoice)?\"\n\nThen follow up for tax details, numbering, branding, etc. based on what they share.\n\n### If the invoice feels incomplete\n\nIf the user gives vague descriptions like \"consulting work,\" push for specifics: *\"Can you break that down into specific deliverables? e.g., 'Website redesign — 3 revision rounds' at $5,000. Specific line items look more professional and reduce client pushback.\"*\n\n## Flag Guesses and Inferred Details\n\nIf you had to guess or infer any details — tax rates, payment terms, invoice numbers, dates — you MUST tell the user what you assumed. After presenting the first draft, explicitly list anything you weren't sure about. For example:\n\n> \"A few things I assumed — let me know if any need adjusting:\n>\n>\n>\n> - I used invoice number INV-2026-0001 — do you have an existing numbering scheme?\n>\n> - I set the tax rate to 0% since you didn't mention taxes — should I add sales tax or VAT?\n>\n> - I set payment terms to Net 30 with a due date of April 13 — is that right?\"\n\nDo NOT silently present fabricated details as fact. Getting invoice details wrong can cause real payment and legal issues.\n\n## Two Approaches: Choose Based on Use Case\n\n### Approach A — Standalone HTML (preferred for SaaS\u002Fsubscription templates)\n\n**Use when:** The same invoice template will be sent to many different clients (e.g., a subscription SaaS billing its users). Client-specific data (name, email, invoice number, dates, amount) is passed via URL query parameters. One file serves all clients.\n\n#### Architecture\n\n```text\n\nclient\u002Fpublic\u002Finvoice-template.html \\# Single file, URL-param driven\n\n```\n\n##### How it works\n\n- The template lives in the main app's `public\u002F` folder, served as a static asset\n- All client-specific fields are read from `URLSearchParams` at runtime\n\n- Seller info, domain, and billing email are hardcoded (they never change)\n- Client pastes the parameterized link into any browser → prints to PDF\n\n**File location:** `client\u002Fpublic\u002Finvoice-template.html`→ served at`\u002Finvoice-template.html`\n\n### Approach B — React Component (preferred for one-off custom invoices)\n\n**Use when:** Building a one-off invoice for a specific client with complex line items, custom branding per client, or when integrated into an app's billing flow.\n\n#### Architecture (2)\n\n```text\n\nartifacts\u002F\u003Cclient>-invoice\u002F\n\nclient\u002Fsrc\u002Fpages\u002FInvoice.tsx \\# Invoice data + component with auto-scale\n\nclient\u002Fsrc\u002Findex.css \\# Print-ready styles (A4 or Letter)\n\n```\n\n## URL Parameter Pattern (Approach A)\n\nThis is the cleanest pattern for subscription\u002FSaaS invoices. Every field that varies per client is a query param; everything that belongs to the seller is hardcoded.\n\n### Supported parameters\n\n| Param | Description | Default |\n\n|-------|-------------|---------|\n\n| `client` | Client \u002F company name | \"Client Name\" (shown in amber as warning) |\n\n| `email` | Client email address | empty |\n\n| `inv`| Invoice number |`PREFIX-YYYY-0001` |\n\n| `date` | Invoice date (ISO: YYYY-MM-DD) | today |\n\n| `due` | Due date (ISO: YYYY-MM-DD) | today + 30 days |\n\n| `period` | Service period label | next calendar month |\n\n| `amount` | Line item amount | plan default |\n\n| `plan` | Plan name label | \"Pro\" |\n\n| `stripe` | Stripe payment link URL | placeholder (shown dimmed) |\n\n### Example parameterized URL\n\n```text\n\nhttps:\u002F\u002Fnido.com.do\u002Finvoice-template.html\n\n?client=Familia+García\n\n&email=garcia@email.com\n\n&inv=NiDO-2026-0014\n\n&date=2026-04-01\n\n&due=2026-05-01\n\n&period=April+2026\n\n&amount=35\n\n&plan=Pro\n\n&stripe=https:\u002F\u002Fbuy.stripe.com\u002Fabc123\n\n```\n\n### URL parsing boilerplate\n\n```javascript\n\nfunction parseParam(name, fallback) {\n\nconst v = new URLSearchParams(window.location.search).get(name);\n\nreturn (v && v.trim()) ? v.trim() : fallback;\n\n}\n\nfunction parseDate(param, fallback) {\n\nconst raw = new URLSearchParams(window.location.search).get(param);\n\nif (raw && raw.trim()) {\n\nconst d = new Date(raw.trim() + 'T12:00:00'); \u002F\u002F noon avoids TZ off-by-one\n\nif (!isNaN(d)) return d;\n\n}\n\nreturn fallback;\n\n}\n\n```\n\n### Always show the shareable URL in the UI\n\nAdd a URL display bar above the invoice so the user can see and copy the full parameterized link:\n\n```html\n\n\u003Cdiv class=\"print-bar\">\n\n\u003Cdiv class=\"url-display\" id=\"url-display\" onclick=\"copyLink()\" title=\"Click to copy\">\n\n\u003Csvg>\u003C!-- link icon -->\u003C\u002Fsvg>\n\n\u003Cspan id=\"url-text\">loading…\u003C\u002Fspan>\n\n\u003C\u002Fdiv>\n\n\u003Cbutton class=\"btn-copy\" onclick=\"copyLink()\">Copy Link\u003C\u002Fbutton>\n\n\u003Cbutton class=\"btn-print\" onclick=\"window.print()\">Download \u002F Print PDF\u003C\u002Fbutton>\n\n\u003C\u002Fdiv>\n\n```\n\n```javascript\n\n\u002F\u002F Show the actual full URL so user can copy and send it\n\ndocument.getElementById('url-text').textContent = window.location.href;\n\n```\n\nThe URL bar should be hidden in `@media print`.\n\n## Page Cutoff \u002F Auto-Scale Logic\n\nThis is the most important implementation detail. Use a **two-layer structure**:\n\n1. **`.invoice-page`** — fixed`height: 1056px`(Letter) or`height: 1122px`(A4),`overflow: hidden`. This is the page boundary.\n2. **`.inv-scaler`** — inner wrapper,`min-height: 1056px`,`display: flex; flex-direction: column; transform-origin: top left`. This holds all content and gets scaled.\n\n### CSS\n\n```css\n\n.invoice-page {\n\nwidth: 816px; \u002F* 8.5in at 96dpi *\u002F\n\nheight: 1056px; \u002F* 11in at 96dpi — Letter *\u002F\n\noverflow: hidden;\n\nposition: relative;\n\n}\n\n.inv-scaler {\n\nwidth: 100%;\n\nmin-height: 1056px; \u002F* Fills page by default so footer stays at bottom *\u002F\n\ndisplay: flex;\n\nflex-direction: column;\n\ntransform-origin: top left;\n\n}\n\n```\n\n### JavaScript scaleToFit function\n\n```javascript\n\nfunction scaleToFit() {\n\nconst page = document.querySelector('.invoice-page');\n\nconst scaler = document.querySelector('.inv-scaler');\n\nif (!page || !scaler) return;\n\n\u002F\u002F Reset any existing transform so we measure true content height\n\nscaler.style.transform = 'none';\n\nscaler.style.width = '100%';\n\nconst pageH = page.clientHeight; \u002F\u002F 1056px\n\nconst contentH = scaler.scrollHeight;\n\nif (contentH > pageH) {\n\nconst scale = pageH \u002F contentH;\n\nscaler.style.transformOrigin = 'top left';\n\nscaler.style.transform = `scale(${scale})`;\n\n\u002F\u002F Compensate horizontal shrink so content stays full-width visually\n\nscaler.style.width = `${100 \u002F scale}%`;\n\n}\n\n}\n\n\u002F\u002F Run on load, after fonts resolve, on resize, and via safety timeouts\n\nscaleToFit();\n\ndocument.fonts.ready.then(scaleToFit);\n\nwindow.addEventListener('resize', scaleToFit);\n\nsetTimeout(scaleToFit, 300);\n\nsetTimeout(scaleToFit, 1000);\n\n```\n\n**Why `min-height`on`.inv-scaler`?** Without it,`flex: 1`on`.inv-body`does nothing (no constrained parent height), and the footer won't stick to the bottom of short invoices. With`min-height: 1056px`, the scaler always fills the full page — footer stays at the bottom — and only grows taller if content genuinely overflows, at which point`scaleToFit` shrinks it back.\n\n## Page Length Rules\n\n- **Most invoices should fit on one page.** The auto-scale handles this for typical invoices (up to ~15 line items).\n- **It's OK to go multi-page** if the invoice has many line items. Don't shrink text to an unreadable size just to force everything onto one page.\n\n- **If going multi-page**: repeat the table header (Description | Qty | Rate | Amount) on each page, and put the totals section on the final page.\n- **Always put payment instructions and totals on the last page** so the client sees how much they owe and how to pay without hunting.\n\n## Brand Domain and Contact Email\n\n- **Never invent placeholder domains** like `yourcompany.com`or`nido.app` — always ask the user what their real production domain is.\n- **Never invent billing emails** — always ask explicitly. The billing email and the app domain are often different (e.g., website: `nido.com.do`, billing email:`billing@nido.com`).\n\n- **Hardcode seller info directly** in the script — do not make it a URL param. The seller never changes between invoices.\n- **Do not use `window.location.hostname`** as the brand domain — the dev\u002FReplit URL is not the brand domain.\n\n```javascript\n\n\u002F\u002F ── Hardcode seller info — never use window.location or placeholders ──\n\nconst appDomain = 'nido.com.do'; \u002F\u002F confirmed with user\n\nconst billingEmail = 'billing@nido.com'; \u002F\u002F confirmed with user\n\n```\n\n## Required Fields by Jurisdiction\n\n### EU (VAT Directive 2006\u002F112\u002FEC, Article 226) — legally mandatory\n\n- Sequential invoice number (gaps must be documented — auditors **will** assess VAT on missing numbers)\n- Invoice date + date of supply (if different)\n\n- Seller's full name, address, and **VAT number**\n- Customer's name and address (and VAT number if B2B)\n\n- Description of goods\u002Fservices, quantity\u002Fextent\n- Unit price excluding VAT, VAT rate per line, VAT amount **in the member state's currency** (even if invoice is in USD)\n\n- **Reverse charge:** if selling B2B cross-border within EU, charge 0% VAT and add the notation `\"Reverse charge — VAT to be accounted for by the recipient (Art. 196, Directive 2006\u002F112\u002FEC)\"`. Include the customer's VAT number (validate via VIES).\n\n**US — no federal invoice law.** Sequential numbering is best practice (IRS wants unique IDs for audit trail) but not legally required. Sales tax rules vary by state; many services are untaxed.\n\n**Other jurisdictions:** Always ask the user which country they operate in before assuming a tax regime. Key questions: Is the tax called VAT, GST, HST, sales tax, or something else? What is the rate? Are digital services exempt or taxable? If exempt, label the tax line clearly (e.g., `VAT — Exempt`or the local equivalent) with`$0.00` rather than omitting the line entirely — omitting it looks like you forgot, whereas labeling it exempt looks intentional and professional.\n\n**Numbering scheme:** `{PREFIX}-{YYYY}-{SEQ:04d}`e.g.`NiDO-2026-0042`. Prefix can distinguish clients or entities. Never reuse or skip; if you void one, keep the voided record.\n\n## Payment Terms Glossary\n\n| Term | Meaning | Typical use |\n\n|------|---------|-------------|\n\n| Due on receipt | Pay immediately | Small amounts, new clients |\n\n| Net 30 | Due 30 days from invoice date | Standard B2B |\n\n| Net 60 \u002F Net 90 | 60\u002F90 days | Large enterprise (push back on this) |\n\n| 2\u002F10 Net 30 | 2% discount if paid in 10 days, else full in 30 | Incentivize fast payment |\n\n| EOM | Due end of month | |\n\n| 1.5% monthly late fee | Compounds on overdue balance | Check local usury caps — often ~18% APR max |\n\n## Layout Structure\n\n```html\n\n\u003Cdiv class=\"invoice-page\">\n\n\u003Cdiv class=\"inv-scaler\">\n\n\u003C!-- Teal\u002Fbrand header bar -->\n\n\u003Cdiv class=\"inv-header\">\n\nLogo + \"INVOICE\" title + invoice number\n\n\u003C\u002Fdiv>\n\n\u003C!-- Accent stripe (thin colored bar below header) -->\n\n\u003Cdiv class=\"accent-stripe\">\u003C\u002Fdiv>\n\n\u003C!-- Main content -->\n\n\u003Cdiv class=\"inv-body\">\n\n\u003C!-- Two columns: From (seller) \u002F Bill To (client) -->\n\n\u003Cdiv class=\"parties\">...\u003C\u002Fdiv>\n\n\u003C!-- Invoice date \u002F service period \u002F due date \u002F payment terms -->\n\n\u003Cdiv class=\"dates-row\">...\u003C\u002Fdiv>\n\n\u003C!-- Line items table -->\n\n\u003Ctable>Description | Plan | Qty | Rate | Amount\u003C\u002Ftable>\n\n\u003C!-- Subtotal \u002F Tax \u002F Total -->\n\n\u003Cdiv class=\"totals-section\">...\u003C\u002Fdiv>\n\n\u003C!-- How to pay (Stripe link, bank details, contact email) -->\n\n\u003Cdiv class=\"payment-box\">...\u003C\u002Fdiv>\n\n\u003C!-- Footer: seller brand + late fee policy -->\n\n\u003Cdiv class=\"inv-footer\">...\u003C\u002Fdiv>\n\n\u003C\u002Fdiv>\u003C!-- \u002Finv-body -->\n\n\u003C\u002Fdiv>\u003C!-- \u002Finv-scaler -->\n\n\u003C\u002Fdiv>\u003C!-- \u002Finvoice-page -->\n\n```\n\n## Stripe Payment Link Pattern\n\nMake the Stripe URL a query param so each invoice can have a unique checkout link:\n\n```javascript\n\nconst stripeUrl = parseParam('stripe', 'https:\u002F\u002Fbuy.stripe.com\u002Fyour-link');\n\nconst stripeEl = document.getElementById('stripe-link');\n\nstripeEl.href = stripeUrl;\n\n\u002F\u002F Visually dim the link if it's still a placeholder\n\nif (stripeUrl === 'https:\u002F\u002Fbuy.stripe.com\u002Fyour-link') {\n\nstripeEl.style.opacity = '.5';\n\nstripeEl.title = 'Add ?stripe=YOUR_LINK to set the real payment URL';\n\n}\n\n```\n\n## Print Styles\n\n```css\n\n@page { size: letter; margin: 0; }\n\n@media print {\n\nbody { background: \\#fff; padding: 0; }\n\n.print-bar { display: none; } \u002F* Hide URL bar and buttons *\u002F\n\n.invoice-page {\n\nwidth: 100%;\n\nheight: 100vh;\n\nbox-shadow: none;\n\noverflow: hidden;\n\n}\n\n}\n\n```\n\n## Best Practices\n\n1. **Show the due date as an actual date** — \"Due: April 13, 2026\" not just \"Net 30\" (clients miscount)\n2. **Specific line items** — \"NiDO Plan Pro — Monthly Subscription\" not \"Subscription\"\n\n3. **Payment instructions on the invoice itself** — Stripe link, bank details, or payment link\n4. **Always ask for billing email and production domain** — never invent placeholders\n\n5. **Right-align all numbers** — amounts, quantities, rates, totals\n6. **Bold the total due** — it should be the most visually prominent number on the page\n\n7. **Highlight missing required fields in amber** — if `client`param is missing, color the field`#D97706` as a visual warning to the sender\n8. **Auto-fill dates dynamically** — invoice date defaults to today, due date to today + 30 days, service period to next calendar month. Only override if the user passes explicit date params.\n\n9. **Dates: use noon (`T12:00:00`) when parsing ISO dates** — avoids timezone off-by-one errors where`2026-04-01` renders as March 31\n\n## Limitations\n\n- Cannot send invoices, process payments, or track payment status\n- Tax calculation is flat-rate per invoice — doesn't handle mixed VAT rates per line or US multi-state nexus\n\n- Not a substitute for accounting software; no ledger integration\n- Puppeteer \u002F headless Chrome does not work on NixOS — use `window.print()` (browser print → Save as PDF) instead\n","# Invoice Generator\n\n## OpenClawd Operator Adaptation\n\nRun this skill as part of the OpenClawd operator deck. Preserve the skill-specific workflow below, but frame outputs for Solana-native agents when relevant: prefer OpenClawd language, note whether the work can support autonomous agent operations, and keep financial, legal, tax, hiring, medical, or other regulated outputs informational unless the skill already requires a stricter disclaimer. Use the Llobster Legend persona only as light operator framing; do not let branding override accuracy, safety, or the user's stated domain.\n\n\nBuild invoices as standalone HTML pages (preferred for simplicity) or React web artifacts. They auto-scale to fit the page and export to PDF via the browser's native print dialog. The web page is the single source of truth — the PDF is a print of it.\n\n> **NixOS note:** Puppeteer \u002F headless Chromium fails on this platform due to missing system libraries (`libglib-2.0.so.0`). Use`window.print()` (browser print dialog → Save as PDF) instead. The approach below is designed for that reality.\n\n## Before You Start Building — Gather Information First\n\n**Do NOT start building the invoice until you have enough information to populate real line items and details.** An invoice with placeholder data is useless.\n\n### If the user provides complete invoice details\n\nGo ahead and start building immediately. You have what you need.\n\n### If the user asks to \"make me an invoice\" without providing details\n\nYou MUST ask clarifying questions before writing any code. Ask about:\n\n1. **Seller info** — Business name, address, email, phone, logo (if any), VAT\u002Ftax ID (if applicable)\n2. **Client info** — Client\u002Fcompany name, address, contact email, VAT number (if B2B in EU)\n\n3. **Line items** — Description of each service\u002Fproduct, quantity, rate\u002Fprice per unit\n4. **Payment terms** — Net 30, due on receipt, etc. + preferred payment method (bank transfer, Stripe, PayPal, etc.)\n\n5. **Invoice number** — Do they have an existing numbering scheme, or should you start one?\n6. **Dates** — Invoice date, service\u002Fdelivery date (if different), due date\n\n7. **Tax** — What tax rate applies? (Sales tax, VAT, ITBIS, none?) This depends on jurisdiction.\n8. **Where is the seller based?** — Determines required legal fields, page size (US = Letter, everyone else = A4), and tax handling\n\n9. **Billing contact email** — Always ask explicitly. Do NOT invent a placeholder like `billing@company.com` — the user must confirm the real email address.\n10. **Production domain** — Always ask what domain the app is deployed to. Do NOT use the Replit dev domain or a made-up domain on the invoice itself.\n\n### How to ask\n\nStart with the essentials:\n\n> \"To create your invoice, I need a few details:\n>\n>\n>\n> 1. Your business name and address (the seller)\n>\n> 2. Who you're billing — client name and address\n>\n> 3. What you're billing for — list each item\u002Fservice with the quantity and price\n>\n> 4. Payment terms — when is it due, and how should they pay?\n>\n> 5. What email should clients contact for billing questions?\n>\n> 6. What domain is your app deployed to (for the website shown on the invoice)?\"\n\nThen follow up for tax details, numbering, branding, etc. based on what they share.\n\n### If the invoice feels incomplete\n\nIf the user gives vague descriptions like \"consulting work,\" push for specifics: *\"Can you break that down into specific deliverables? e.g., 'Website redesign — 3 revision rounds' at $5,000. Specific line items look more professional and reduce client pushback.\"*\n\n## Flag Guesses and Inferred Details\n\nIf you had to guess or infer any details — tax rates, payment terms, invoice numbers, dates — you MUST tell the user what you assumed. After presenting the first draft, explicitly list anything you weren't sure about. For example:\n\n> \"A few things I assumed — let me know if any need adjusting:\n>\n>\n>\n> - I used invoice number INV-2026-0001 — do you have an existing numbering scheme?\n>\n> - I set the tax rate to 0% since you didn't mention taxes — should I add sales tax or VAT?\n>\n> - I set payment terms to Net 30 with a due date of April 13 — is that right?\"\n\nDo NOT silently present fabricated details as fact. Getting invoice details wrong can cause real payment and legal issues.\n\n## Two Approaches: Choose Based on Use Case\n\n### Approach A — Standalone HTML (preferred for SaaS\u002Fsubscription templates)\n\n**Use when:** The same invoice template will be sent to many different clients (e.g., a subscription SaaS billing its users). Client-specific data (name, email, invoice number, dates, amount) is passed via URL query parameters. One file serves all clients.\n\n#### Architecture\n\n```text\n\nclient\u002Fpublic\u002Finvoice-template.html \\# Single file, URL-param driven\n\n```\n\n##### How it works\n\n- The template lives in the main app's `public\u002F` folder, served as a static asset\n- All client-specific fields are read from `URLSearchParams` at runtime\n\n- Seller info, domain, and billing email are hardcoded (they never change)\n- Client pastes the parameterized link into any browser → prints to PDF\n\n**File location:** `client\u002Fpublic\u002Finvoice-template.html`→ served at`\u002Finvoice-template.html`\n\n### Approach B — React Component (preferred for one-off custom invoices)\n\n**Use when:** Building a one-off invoice for a specific client with complex line items, custom branding per client, or when integrated into an app's billing flow.\n\n#### Architecture (2)\n\n```text\n\nartifacts\u002F\u003Cclient>-invoice\u002F\n\nclient\u002Fsrc\u002Fpages\u002FInvoice.tsx \\# Invoice data + component with auto-scale\n\nclient\u002Fsrc\u002Findex.css \\# Print-ready styles (A4 or Letter)\n\n```\n\n## URL Parameter Pattern (Approach A)\n\nThis is the cleanest pattern for subscription\u002FSaaS invoices. Every field that varies per client is a query param; everything that belongs to the seller is hardcoded.\n\n### Supported parameters\n\n| Param | Description | Default |\n\n|-------|-------------|---------|\n\n| `client` | Client \u002F company name | \"Client Name\" (shown in amber as warning) |\n\n| `email` | Client email address | empty |\n\n| `inv`| Invoice number |`PREFIX-YYYY-0001` |\n\n| `date` | Invoice date (ISO: YYYY-MM-DD) | today |\n\n| `due` | Due date (ISO: YYYY-MM-DD) | today + 30 days |\n\n| `period` | Service period label | next calendar month |\n\n| `amount` | Line item amount | plan default |\n\n| `plan` | Plan name label | \"Pro\" |\n\n| `stripe` | Stripe payment link URL | placeholder (shown dimmed) |\n\n### Example parameterized URL\n\n```text\n\nhttps:\u002F\u002Fnido.com.do\u002Finvoice-template.html\n\n?client=Familia+García\n\n&email=garcia@email.com\n\n&inv=NiDO-2026-0014\n\n&date=2026-04-01\n\n&due=2026-05-01\n\n&period=April+2026\n\n&amount=35\n\n&plan=Pro\n\n&stripe=https:\u002F\u002Fbuy.stripe.com\u002Fabc123\n\n```\n\n### URL parsing boilerplate\n\n```javascript\n\nfunction parseParam(name, fallback) {\n\nconst v = new URLSearchParams(window.location.search).get(name);\n\nreturn (v && v.trim()) ? v.trim() : fallback;\n\n}\n\nfunction parseDate(param, fallback) {\n\nconst raw = new URLSearchParams(window.location.search).get(param);\n\nif (raw && raw.trim()) {\n\nconst d = new Date(raw.trim() + 'T12:00:00'); \u002F\u002F noon avoids TZ off-by-one\n\nif (!isNaN(d)) return d;\n\n}\n\nreturn fallback;\n\n}\n\n```\n\n### Always show the shareable URL in the UI\n\nAdd a URL display bar above the invoice so the user can see and copy the full parameterized link:\n\n```html\n\n\u003Cdiv class=\"print-bar\">\n\n\u003Cdiv class=\"url-display\" id=\"url-display\" onclick=\"copyLink()\" title=\"Click to copy\">\n\n\u003Csvg>\u003C!-- link icon -->\u003C\u002Fsvg>\n\n\u003Cspan id=\"url-text\">loading…\u003C\u002Fspan>\n\n\u003C\u002Fdiv>\n\n\u003Cbutton class=\"btn-copy\" onclick=\"copyLink()\">Copy Link\u003C\u002Fbutton>\n\n\u003Cbutton class=\"btn-print\" onclick=\"window.print()\">Download \u002F Print PDF\u003C\u002Fbutton>\n\n\u003C\u002Fdiv>\n\n```\n\n```javascript\n\n\u002F\u002F Show the actual full URL so user can copy and send it\n\ndocument.getElementById('url-text').textContent = window.location.href;\n\n```\n\nThe URL bar should be hidden in `@media print`.\n\n## Page Cutoff \u002F Auto-Scale Logic\n\nThis is the most important implementation detail. Use a **two-layer structure**:\n\n1. **`.invoice-page`** — fixed`height: 1056px`(Letter) or`height: 1122px`(A4),`overflow: hidden`. This is the page boundary.\n2. **`.inv-scaler`** — inner wrapper,`min-height: 1056px`,`display: flex; flex-direction: column; transform-origin: top left`. This holds all content and gets scaled.\n\n### CSS\n\n```css\n\n.invoice-page {\n\nwidth: 816px; \u002F* 8.5in at 96dpi *\u002F\n\nheight: 1056px; \u002F* 11in at 96dpi — Letter *\u002F\n\noverflow: hidden;\n\nposition: relative;\n\n}\n\n.inv-scaler {\n\nwidth: 100%;\n\nmin-height: 1056px; \u002F* Fills page by default so footer stays at bottom *\u002F\n\ndisplay: flex;\n\nflex-direction: column;\n\ntransform-origin: top left;\n\n}\n\n```\n\n### JavaScript scaleToFit function\n\n```javascript\n\nfunction scaleToFit() {\n\nconst page = document.querySelector('.invoice-page');\n\nconst scaler = document.querySelector('.inv-scaler');\n\nif (!page || !scaler) return;\n\n\u002F\u002F Reset any existing transform so we measure true content height\n\nscaler.style.transform = 'none';\n\nscaler.style.width = '100%';\n\nconst pageH = page.clientHeight; \u002F\u002F 1056px\n\nconst contentH = scaler.scrollHeight;\n\nif (contentH > pageH) {\n\nconst scale = pageH \u002F contentH;\n\nscaler.style.transformOrigin = 'top left';\n\nscaler.style.transform = `scale(${scale})`;\n\n\u002F\u002F Compensate horizontal shrink so content stays full-width visually\n\nscaler.style.width = `${100 \u002F scale}%`;\n\n}\n\n}\n\n\u002F\u002F Run on load, after fonts resolve, on resize, and via safety timeouts\n\nscaleToFit();\n\ndocument.fonts.ready.then(scaleToFit);\n\nwindow.addEventListener('resize', scaleToFit);\n\nsetTimeout(scaleToFit, 300);\n\nsetTimeout(scaleToFit, 1000);\n\n```\n\n**Why `min-height`on`.inv-scaler`?** Without it,`flex: 1`on`.inv-body`does nothing (no constrained parent height), and the footer won't stick to the bottom of short invoices. With`min-height: 1056px`, the scaler always fills the full page — footer stays at the bottom — and only grows taller if content genuinely overflows, at which point`scaleToFit` shrinks it back.\n\n## Page Length Rules\n\n- **Most invoices should fit on one page.** The auto-scale handles this for typical invoices (up to ~15 line items).\n- **It's OK to go multi-page** if the invoice has many line items. Don't shrink text to an unreadable size just to force everything onto one page.\n\n- **If going multi-page**: repeat the table header (Description | Qty | Rate | Amount) on each page, and put the totals section on the final page.\n- **Always put payment instructions and totals on the last page** so the client sees how much they owe and how to pay without hunting.\n\n## Brand Domain and Contact Email\n\n- **Never invent placeholder domains** like `yourcompany.com`or`nido.app` — always ask the user what their real production domain is.\n- **Never invent billing emails** — always ask explicitly. The billing email and the app domain are often different (e.g., website: `nido.com.do`, billing email:`billing@nido.com`).\n\n- **Hardcode seller info directly** in the script — do not make it a URL param. The seller never changes between invoices.\n- **Do not use `window.location.hostname`** as the brand domain — the dev\u002FReplit URL is not the brand domain.\n\n```javascript\n\n\u002F\u002F ── Hardcode seller info — never use window.location or placeholders ──\n\nconst appDomain = 'nido.com.do'; \u002F\u002F confirmed with user\n\nconst billingEmail = 'billing@nido.com'; \u002F\u002F confirmed with user\n\n```\n\n## Required Fields by Jurisdiction\n\n### EU (VAT Directive 2006\u002F112\u002FEC, Article 226) — legally mandatory\n\n- Sequential invoice number (gaps must be documented — auditors **will** assess VAT on missing numbers)\n- Invoice date + date of supply (if different)\n\n- Seller's full name, address, and **VAT number**\n- Customer's name and address (and VAT number if B2B)\n\n- Description of goods\u002Fservices, quantity\u002Fextent\n- Unit price excluding VAT, VAT rate per line, VAT amount **in the member state's currency** (even if invoice is in USD)\n\n- **Reverse charge:** if selling B2B cross-border within EU, charge 0% VAT and add the notation `\"Reverse charge — VAT to be accounted for by the recipient (Art. 196, Directive 2006\u002F112\u002FEC)\"`. Include the customer's VAT number (validate via VIES).\n\n**US — no federal invoice law.** Sequential numbering is best practice (IRS wants unique IDs for audit trail) but not legally required. Sales tax rules vary by state; many services are untaxed.\n\n**Other jurisdictions:** Always ask the user which country they operate in before assuming a tax regime. Key questions: Is the tax called VAT, GST, HST, sales tax, or something else? What is the rate? Are digital services exempt or taxable? If exempt, label the tax line clearly (e.g., `VAT — Exempt`or the local equivalent) with`$0.00` rather than omitting the line entirely — omitting it looks like you forgot, whereas labeling it exempt looks intentional and professional.\n\n**Numbering scheme:** `{PREFIX}-{YYYY}-{SEQ:04d}`e.g.`NiDO-2026-0042`. Prefix can distinguish clients or entities. Never reuse or skip; if you void one, keep the voided record.\n\n## Payment Terms Glossary\n\n| Term | Meaning | Typical use |\n\n|------|---------|-------------|\n\n| Due on receipt | Pay immediately | Small amounts, new clients |\n\n| Net 30 | Due 30 days from invoice date | Standard B2B |\n\n| Net 60 \u002F Net 90 | 60\u002F90 days | Large enterprise (push back on this) |\n\n| 2\u002F10 Net 30 | 2% discount if paid in 10 days, else full in 30 | Incentivize fast payment |\n\n| EOM | Due end of month | |\n\n| 1.5% monthly late fee | Compounds on overdue balance | Check local usury caps — often ~18% APR max |\n\n## Layout Structure\n\n```html\n\n\u003Cdiv class=\"invoice-page\">\n\n\u003Cdiv class=\"inv-scaler\">\n\n\u003C!-- Teal\u002Fbrand header bar -->\n\n\u003Cdiv class=\"inv-header\">\n\nLogo + \"INVOICE\" title + invoice number\n\n\u003C\u002Fdiv>\n\n\u003C!-- Accent stripe (thin colored bar below header) -->\n\n\u003Cdiv class=\"accent-stripe\">\u003C\u002Fdiv>\n\n\u003C!-- Main content -->\n\n\u003Cdiv class=\"inv-body\">\n\n\u003C!-- Two columns: From (seller) \u002F Bill To (client) -->\n\n\u003Cdiv class=\"parties\">...\u003C\u002Fdiv>\n\n\u003C!-- Invoice date \u002F service period \u002F due date \u002F payment terms -->\n\n\u003Cdiv class=\"dates-row\">...\u003C\u002Fdiv>\n\n\u003C!-- Line items table -->\n\n\u003Ctable>Description | Plan | Qty | Rate | Amount\u003C\u002Ftable>\n\n\u003C!-- Subtotal \u002F Tax \u002F Total -->\n\n\u003Cdiv class=\"totals-section\">...\u003C\u002Fdiv>\n\n\u003C!-- How to pay (Stripe link, bank details, contact email) -->\n\n\u003Cdiv class=\"payment-box\">...\u003C\u002Fdiv>\n\n\u003C!-- Footer: seller brand + late fee policy -->\n\n\u003Cdiv class=\"inv-footer\">...\u003C\u002Fdiv>\n\n\u003C\u002Fdiv>\u003C!-- \u002Finv-body -->\n\n\u003C\u002Fdiv>\u003C!-- \u002Finv-scaler -->\n\n\u003C\u002Fdiv>\u003C!-- \u002Finvoice-page -->\n\n```\n\n## Stripe Payment Link Pattern\n\nMake the Stripe URL a query param so each invoice can have a unique checkout link:\n\n```javascript\n\nconst stripeUrl = parseParam('stripe', 'https:\u002F\u002Fbuy.stripe.com\u002Fyour-link');\n\nconst stripeEl = document.getElementById('stripe-link');\n\nstripeEl.href = stripeUrl;\n\n\u002F\u002F Visually dim the link if it's still a placeholder\n\nif (stripeUrl === 'https:\u002F\u002Fbuy.stripe.com\u002Fyour-link') {\n\nstripeEl.style.opacity = '.5';\n\nstripeEl.title = 'Add ?stripe=YOUR_LINK to set the real payment URL';\n\n}\n\n```\n\n## Print Styles\n\n```css\n\n@page { size: letter; margin: 0; }\n\n@media print {\n\nbody { background: \\#fff; padding: 0; }\n\n.print-bar { display: none; } \u002F* Hide URL bar and buttons *\u002F\n\n.invoice-page {\n\nwidth: 100%;\n\nheight: 100vh;\n\nbox-shadow: none;\n\noverflow: hidden;\n\n}\n\n}\n\n```\n\n## Best Practices\n\n1. **Show the due date as an actual date** — \"Due: April 13, 2026\" not just \"Net 30\" (clients miscount)\n2. **Specific line items** — \"NiDO Plan Pro — Monthly Subscription\" not \"Subscription\"\n\n3. **Payment instructions on the invoice itself** — Stripe link, bank details, or payment link\n4. **Always ask for billing email and production domain** — never invent placeholders\n\n5. **Right-align all numbers** — amounts, quantities, rates, totals\n6. **Bold the total due** — it should be the most visually prominent number on the page\n\n7. **Highlight missing required fields in amber** — if `client`param is missing, color the field`#D97706` as a visual warning to the sender\n8. **Auto-fill dates dynamically** — invoice date defaults to today, due date to today + 30 days, service period to next calendar month. Only override if the user passes explicit date params.\n\n9. **Dates: use noon (`T12:00:00`) when parsing ISO dates** — avoids timezone off-by-one errors where`2026-04-01` renders as March 31\n\n## Limitations\n\n- Cannot send invoices, process payments, or track payment status\n- Tax calculation is flat-rate per invoice — doesn't handle mixed VAT rates per line or US multi-state nexus\n\n- Not a substitute for accounting software; no ledger integration\n- Puppeteer \u002F headless Chrome does not work on NixOS — use `window.print()` (browser print → Save as PDF) instead\n",{"name":5,"description":7},"main","6b4a291df75c639681e93b4b5b812126443fd6ed","secondary_skills\u002Finvoice-generator",3,"https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd","https:\u002F\u002Fsolanaclawd.com\u002Fopenclawd","https:\u002F\u002Fgithub.com\u002Fclawdsolana","https:\u002F\u002Fmusebook.trade","Welcome to Open Clawd. The future of Ai on and off chain. Bringing webMCP to web 3 using X402, A2A, MPP and so much more!","2026-08-01 09:30:51",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add clawdsolana\u002FOpenClawd --skill invoice-generator",{"tool":55,"command":56},"bunx","bunx skills add clawdsolana\u002FOpenClawd --skill invoice-generator",{"tool":58,"command":59},"pnpm","pnpm dlx skills add clawdsolana\u002FOpenClawd --skill invoice-generator","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fsecondary_skills\u002Finvoice-generator\u002FSKILL.md",true,[63],{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":68},".fingerprint","OTHER","其他",32,"https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fsecondary_skills\u002Finvoice-generator\u002F.fingerprint",[70,97,122,147,157,181],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":96},"01M71KRBD0W01EAXJ8YM4M1SJ2","solana-dev","End-to-end Solana development playbook (Jan 2026). Prefer Solana Foundation framework-kit (@solana\u002Fclient + @solana\u002Freact-hooks) for React\u002FNext.js UI. Prefer @solana\u002Fkit for all new client\u002FRPC\u002Ftransaction code. When legacy dependencies require web3.js, isolate it behind @solana\u002Fweb3-compat (or @solana\u002Fweb3.js as a true legacy fallback). Covers wallet-standard-first connection (incl. ConnectorKit), Anchor\u002FPinocchio programs, Codama-based client generation, LiteSVM\u002FMollusk\u002FSurfpool testing, and security checklists.","https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fsrc\u002Fskills\u002Fsolana-dev\u002FSKILL.md",[],[77,78,79,80,81,82,83,84,85,86,87,88,23,89,90,91,92,93,94,95],"solana dev","dev","solana","Wallet","end","testing","hooks","kit","new","when","web3","code","next","2026","playbook","security","ui","fallback","framework","2026-11-10 10:56:23",{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":96},"01M71KR8QPESSY61SVE8ZTFNVT","xurl","A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.","https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fskills\u002Fxurl\u002FSKILL.md",[],[99,104,105,106,107,108,109,86,110,111,112,113,114,115,116,117,118,119,120,121],"posts","Media","x api","search","send","tap","you","api","cli","read","install","cli tool","endpoint","brew","for","manage","tool","twitter",{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":96},"01M71KR6FSXV88YDKWP7NBY3SH","wurk-integration","WURK API integration for monetizing agents with x402 payments on Solana\u002FBase - create social jobs, custom challenges, and agent help tasks","https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fskills\u002Fwurk-integration\u002FSKILL.md",[],[129,130,131,132,133,134,135,136,111,137,138,139,140,141,142,143,118,144,145,146],"wurk","wurk integration","integration","x402","social","payments","tasks","team","create","social-jobs","command","agent-help","custom-jobs","clawd","safe","api integration","custom","true",{"skillNo":148,"name":149,"nameZh":6,"description":150,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":151,"categories":152,"keywords":153,"publishedAt":96},"01M71KR4HCX41BPAK9GP7RPRRP","workflows","Manage application workflows including configuration, restart, and removal.","https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fskills\u002Fworkflows\u002FSKILL.md",[],[149,119,154,155,156],"configuration","application","restart",{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":96},"01M71KR1VM0F5GPEQDNG5J7A0H","web-search","Search the web, fetch content, extract branding profiles, and capture screenshots from URLs. Use for real-time information, API documentation, current events, design matching, and visual reference.","https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fskills\u002Fweb-search\u002FSKILL.md",[],[164,107,165,166,167,118,168,169,170,171,172,173,174,111,175,176,177,178,179,180],"web search","web","fetch","api documentation","real-time","time","profiles","design","use","information","visual","documentation","branding","matching","reference","capture","content",{"skillNo":182,"name":183,"nameZh":6,"description":184,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":185,"categories":186,"keywords":187,"publishedAt":96},"01M71KQZN5MR1JFQHG5GWXYAHS","weather","Get current weather and forecasts via wttr.in or Open-Meteo. Use when: user asks about weather, temperature, or forecasts for any location. NOT for: historical weather data, severe weather alerts, or detailed meteorological analysis. No API key needed.","https:\u002F\u002Fgithub.com\u002Fclawdsolana\u002FOpenClawd\u002Fblob\u002Fmain\u002Fskills\u002Fweather\u002FSKILL.md",[],[183,188,118,189,172,86,190,111,191,192,193,194,195,196,197,198,199,200],"get","open","analysis","alerts","temperature","curl","via","help","about","https","location","data","user"]