[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M76XG2Z7R0P5BMSPF8MEPZ37":3,"skill-same:01M76XG2Z7R0P5BMSPF8MEPZ37":47},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M76XG2Z7R0P5BMSPF8MEPZ37","afrexai-invoice-engine",null,"Generate, manage, and track professional invoices with payment terms, recurring billing, overdue automation, and financial reporting. Use when creating invoices, tracking payments, managing clients, or reviewing revenue.","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fa\u002Fafrexai-invoice-engine\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: afrexai-invoice-engine\ndescription: Generate, manage, and track professional invoices with payment terms, recurring billing, overdue automation, and financial reporting. Use when creating invoices, tracking payments, managing clients, or reviewing revenue.\n---\n\n# Invoice Engine — Complete Invoicing & Accounts Receivable\n\nA zero-dependency agent skill for end-to-end invoicing — from quote to payment to reporting.\n\n## Quick Start\n\nWhen the user says \"create an invoice\" or \"bill [client]\":\n\n1. Check if client exists in memory (see Client Registry below)\n2. If new client → run Client Onboarding\n3. Generate invoice using the Invoice Builder\n4. Present for review → finalize\n5. Track in the Invoice Ledger\n\n---\n\n## 1. Client Registry\n\nMaintain a YAML client database in your workspace:\n\n```yaml\n# clients.yaml\nclients:\n  - id: \"CLI-001\"\n    name: \"Acme Corp\"\n    contact: \"Jane Smith\"\n    email: \"jane@acme.com\"\n    address:\n      line1: \"123 Business Ave\"\n      line2: \"Suite 400\"\n      city: \"New York\"\n      state: \"NY\"\n      zip: \"10001\"\n      country: \"US\"\n    tax_id: \"US-EIN-12-3456789\"\n    payment_terms: \"net-30\"       # net-15, net-30, net-45, net-60, due-on-receipt, custom\n    preferred_currency: \"USD\"\n    default_tax_rate: 0           # 0 for B2B cross-border, local rate for domestic\n    notes: \"PO required for invoices > $5,000\"\n    created: \"2026-01-15\"\n    lifetime_revenue: 12500.00\n    invoices_sent: 3\n    invoices_paid: 2\n    avg_days_to_pay: 22\n```\n\n### Client Onboarding Checklist\nWhen adding a new client, collect:\n- [ ] Legal entity name (exactly as on their records)\n- [ ] Billing contact name + email\n- [ ] Billing address (full, with country)\n- [ ] Tax ID \u002F VAT number (if applicable)\n- [ ] Preferred payment terms\n- [ ] Currency preference\n- [ ] Any PO or approval requirements\n- [ ] Tax-exempt? (if so, get certificate reference)\n\n---\n\n## 2. Invoice Builder\n\n### Invoice Number Format\n```\n[PREFIX]-[YEAR].[MONTH].[SEQUENCE]\nExample: INV-2026.02.001\n```\n\nConfigurable prefix per business line:\n- `INV` = standard invoice\n- `PRO` = proforma \u002F quote\n- `REC` = recurring invoice\n- `CN` = credit note\n\n### Invoice Template\n\nWhen generating an invoice, structure it as:\n\n```\n╔══════════════════════════════════════════════════════════╗\n║  [YOUR COMPANY NAME]                                     ║\n║  [Address Line 1]                                        ║\n║  [City, State ZIP]                                       ║\n║  [Country]                                               ║\n║  Tax ID: [YOUR TAX ID]                                   ║\n╠══════════════════════════════════════════════════════════╣\n║                                                          ║\n║  INVOICE [NUMBER]                  Date: [ISSUE DATE]    ║\n║                                    Due:  [DUE DATE]      ║\n║                                                          ║\n║  Bill To:                          Payment Terms:        ║\n║  [CLIENT NAME]                     [Net-30 \u002F etc.]       ║\n║  [Client Address]                                        ║\n║  [City, State ZIP]                 PO Number:            ║\n║  Tax ID: [CLIENT TAX ID]          [If applicable]        ║\n║                                                          ║\n╠══════════════════════════════════════════════════════════╣\n║  #  │ Description          │ Qty │ Rate    │ Amount     ║\n╠═════╪══════════════════════╪═════╪═════════╪════════════╣\n║  1  │ [Service\u002FProduct]    │  1  │ $X,XXX  │ $X,XXX.XX ║\n║  2  │ [Service\u002FProduct]    │  3  │ $XXX    │ $X,XXX.XX ║\n║  3  │ [Expense passthrough]│  1  │ $XXX    │ $XXX.XX   ║\n╠═════╧══════════════════════╧═════╧═════════╧════════════╣\n║                              Subtotal:    $XX,XXX.XX     ║\n║                              Discount:    -$X,XXX.XX     ║\n║                              Tax (X%):    $X,XXX.XX      ║\n║                              ─────────────────────────   ║\n║                              TOTAL DUE:   $XX,XXX.XX     ║\n╠══════════════════════════════════════════════════════════╣\n║  Payment Methods:                                        ║\n║  • Bank Transfer: [Bank] | Acct: [XXXX] | Routing: [XX] ║\n║  • PayPal: [email]                                       ║\n║  • Stripe: [payment link]                                ║\n║  • Bitcoin: [address] \u002F Lightning: [LNURL]               ║\n║                                                          ║\n║  Notes: [Custom message \u002F thank you \u002F late fee notice]   ║\n╚══════════════════════════════════════════════════════════╝\n```\n\n### Line Item Types\n- **Time-based**: Hours × hourly rate (log hours, auto-calculate)\n- **Fixed fee**: Project milestones, retainers\n- **Quantity-based**: Units × unit price\n- **Expense passthrough**: At-cost or with markup %\n- **Discount line**: Negative amount (early payment, volume, loyalty)\n- **Recurring**: Auto-populated from recurring schedule\n\n### Tax Handling Decision Tree\n```\nIs client in same country as you?\n├── YES → Apply local tax rate\n│   ├── Client tax-exempt? → Add exemption reference, 0% tax\n│   └── Client NOT exempt → Apply standard rate\n└── NO → Usually 0% (reverse charge \u002F export)\n    ├── Both in EU? → Reverse charge mechanism (0%, note on invoice)\n    ├── US interstate? → Check nexus rules\n    └── International → 0% with export reference\n```\n\n### Discount & Pricing Framework\n- **Early payment**: 2\u002F10 Net 30 (2% discount if paid within 10 days)\n- **Volume**: Tiered pricing (1-10 units = $X, 11-50 = $Y, 51+ = $Z)\n- **Loyalty**: After 6+ invoices, offer 5% ongoing discount\n- **Bundled**: Package multiple services, discount 10-15% vs à la carte\n- **Seasonal**: Q4 premium (+10%), Q1 discount (-5%) if applicable\n\n---\n\n## 3. Invoice Lifecycle & Status Tracking\n\n### Status Flow\n```\nDRAFT → SENT → VIEWED → PARTIALLY_PAID → PAID → CLOSED\n                  ↓\n              OVERDUE → ESCALATED → WRITTEN_OFF\n                  ↓\n            DISPUTED → RESOLVED → PAID\n```\n\n### Invoice Ledger (YAML)\n\n```yaml\n# invoices.yaml\ninvoices:\n  - number: \"INV-2026.02.001\"\n    client_id: \"CLI-001\"\n    status: \"sent\"\n    issue_date: \"2026-02-13\"\n    due_date: \"2026-03-15\"\n    currency: \"USD\"\n    subtotal: 5000.00\n    discount: 0\n    tax: 0\n    total: 5000.00\n    amount_paid: 0\n    balance_due: 5000.00\n    payment_terms: \"net-30\"\n    line_items:\n      - description: \"AI Integration Consulting — February\"\n        qty: 20\n        rate: 250.00\n        amount: 5000.00\n    payments: []\n    notes: \"\"\n    sent_date: \"2026-02-13\"\n    reminders_sent: 0\n    created: \"2026-02-13T10:30:00Z\"\n```\n\n### Payment Recording\nWhen a payment comes in:\n```yaml\npayments:\n  - date: \"2026-03-10\"\n    amount: 5000.00\n    method: \"bank_transfer\"    # bank_transfer, stripe, paypal, btc, cash, check\n    reference: \"TXN-ABC123\"\n    notes: \"Paid in full\"\n```\n\nUpdate: `amount_paid`, `balance_due`, `status` (→ paid if balance = 0, → partially_paid if balance > 0)\n\n---\n\n## 4. Recurring Invoices\n\n### Schedule Configuration\n```yaml\nrecurring:\n  - id: \"REC-001\"\n    client_id: \"CLI-001\"\n    description: \"Monthly Retainer — AI Ops Support\"\n    frequency: \"monthly\"          # weekly, biweekly, monthly, quarterly, annually\n    day_of_month: 1               # 1-28 (avoid 29-31 for safety)\n    line_items:\n      - description: \"AI Operations Retainer\"\n        qty: 1\n        rate: 3500.00\n    auto_send: true               # false = create as draft\n    start_date: \"2026-01-01\"\n    end_date: null                # null = indefinite\n    next_invoice: \"2026-03-01\"\n    invoices_generated: 2\n    active: true\n```\n\n### Recurring Invoice Routine (run on schedule)\n1. Check `recurring` entries where `next_invoice \u003C= today` and `active = true`\n2. For each: generate invoice from template, assign next number\n3. If `auto_send = true` → mark as sent, notify client\n4. If `auto_send = false` → save as draft, notify user for review\n5. Update `next_invoice` to next occurrence\n6. Log in daily memory\n\n---\n\n## 5. Overdue Management & Collections\n\n### Reminder Schedule\n| Days After Due | Action | Tone |\n|---|---|---|\n| +1 day | Friendly reminder email | \"Just a gentle reminder...\" |\n| +7 days | Follow-up with invoice attached | \"Following up on...\" |\n| +14 days | Firm reminder, mention late fee | \"This invoice is now 14 days past due...\" |\n| +30 days | Final notice before escalation | \"Final notice — please remit payment...\" |\n| +45 days | Escalate to human (Kalin\u002FChristina) | Flag for personal outreach |\n| +60 days | Consider write-off or collections | Business decision |\n\n### Reminder Templates\n\n**Day +1 (Friendly)**\n```\nSubject: Friendly reminder — Invoice [NUMBER] due [DATE]\n\nHi [CONTACT],\n\nHope all is well! Just a quick reminder that invoice [NUMBER] for [AMOUNT] was due on [DATE].\n\nIf you've already sent payment, please disregard this note.\n\nPayment details are on the attached invoice. Let me know if you need anything.\n\nBest,\n[YOUR NAME]\n```\n\n**Day +14 (Firm)**\n```\nSubject: Invoice [NUMBER] — 14 days overdue ([AMOUNT])\n\nHi [CONTACT],\n\nInvoice [NUMBER] for [AMOUNT] is now 14 days past the due date of [DATE].\n\nPer our agreement, a late fee of [X]% may apply to balances outstanding beyond [Y] days.\n\nCould you confirm when we can expect payment? Happy to discuss if there's an issue.\n\nThanks,\n[YOUR NAME]\n```\n\n**Day +30 (Final)**\n```\nSubject: Final notice — Invoice [NUMBER] overdue ([AMOUNT])\n\nHi [CONTACT],\n\nThis is a final reminder that invoice [NUMBER] for [AMOUNT] remains unpaid, now 30 days past the due date.\n\nPlease arrange payment within the next 7 business days to avoid further action.\n\nIf there's a dispute or issue with this invoice, please let me know immediately so we can resolve it.\n\nRegards,\n[YOUR NAME]\n```\n\n### Late Fee Calculation\n```\nStandard: 1.5% per month on overdue balance (18% APR)\nGrace period: 5 business days after due date\nCompound: Simple interest (not compound)\nCap: 25% of invoice total (or local legal maximum)\n\nFormula: late_fee = balance_due × (monthly_rate \u002F 30) × days_overdue\nExample: $5,000 × (0.015 \u002F 30) × 14 = $35.00\n```\n\n---\n\n## 6. Financial Reporting\n\n### Revenue Dashboard (generate weekly\u002Fmonthly)\n\n```\n═══ REVENUE SUMMARY — [MONTH YEAR] ═══\n\nInvoiced This Month:      $XX,XXX.XX  ([N] invoices)\nCollected This Month:     $XX,XXX.XX  ([N] payments)\nOutstanding (not overdue): $XX,XXX.XX  ([N] invoices)\nOverdue:                  $XX,XXX.XX  ([N] invoices, avg [X] days late)\nWritten Off (YTD):        $XX,XXX.XX\n\nCollection Rate:          XX.X%  (collected \u002F invoiced, trailing 90 days)\nAvg Days to Pay:          XX days (trailing 90 days)\nAvg Invoice Size:         $X,XXX.XX\n\n═══ TOP CLIENTS (by revenue, YTD) ═══\n1. [Client] — $XX,XXX  ([N] invoices, avg [X] days to pay)\n2. [Client] — $XX,XXX  ([N] invoices, avg [X] days to pay)\n3. [Client] — $XX,XXX  ([N] invoices, avg [X] days to pay)\n\n═══ AGING REPORT ═══\nCurrent (not yet due):     $XX,XXX  ([N] invoices)\n1-15 days overdue:         $XX,XXX  ([N] invoices)\n16-30 days overdue:        $XX,XXX  ([N] invoices)\n31-60 days overdue:        $XX,XXX  ([N] invoices)\n60+ days overdue:          $XX,XXX  ([N] invoices) ⚠️\n\n═══ MONTHLY TREND ═══\nJan: $XX,XXX ████████████\nFeb: $XX,XXX ████████████████\nMar: $XX,XXX ██████████\n...\n\n═══ ACTIONS NEEDED ═══\n• [N] invoices need reminder emails\n• [N] recurring invoices due for generation\n• [Client] has disputed INV-XXXX — needs resolution\n```\n\n### Key Metrics to Track\n- **Collection Rate**: % of invoiced amount actually collected (target: >95%)\n- **DSO (Days Sales Outstanding)**: avg days from invoice to payment (target: \u003C30)\n- **Overdue Ratio**: overdue balance \u002F total outstanding (target: \u003C10%)\n- **Revenue Concentration**: % from top client (flag if >40% — dependency risk)\n- **MRR from Recurring**: recurring invoice total \u002F month\n\n---\n\n## 7. Credit Notes & Adjustments\n\nWhen a refund or correction is needed:\n\n```yaml\ncredit_note:\n  number: \"CN-2026.02.001\"\n  original_invoice: \"INV-2026.01.003\"\n  client_id: \"CLI-001\"\n  reason: \"Partial refund — service hours overcharged\"\n  line_items:\n    - description: \"Correction: 5 hours overcharged\"\n      qty: -5\n      rate: 250.00\n      amount: -1250.00\n  total: -1250.00\n  issued: \"2026-02-13\"\n```\n\nApply credit notes against:\n1. The original invoice (reduce balance)\n2. Future invoices (credit on account)\n3. Direct refund (record refund method + reference)\n\n---\n\n## 8. Multi-Currency Support\n\n```yaml\ncurrencies:\n  primary: \"USD\"\n  accepted: [\"USD\", \"GBP\", \"EUR\", \"BTC\"]\n  exchange_rates:  # Update weekly or use live rates\n    GBP_USD: 1.27\n    EUR_USD: 1.08\n    BTC_USD: 97500\n  conversion_note: \"Converted at rate on invoice date. Payment accepted in invoiced currency only.\"\n```\n\nRules:\n- Always invoice in the client's preferred currency\n- Record payments in the currency received\n- Convert to primary currency for reporting (use rate on payment date)\n- Note exchange rate on invoice if cross-currency\n- BTC\u002FLightning: include both sats and fiat equivalent\n\n---\n\n## 9. Quote-to-Invoice Pipeline\n\n### Quote (Proforma) Template\nSame as invoice template but:\n- Prefix: `PRO-` instead of `INV-`\n- Header: \"QUOTATION\" instead of \"INVOICE\"\n- Add: \"Valid until: [DATE]\" (typically 30 days)\n- Add: \"This is not a tax invoice\"\n\n### Pipeline Flow\n```\nQUOTE → ACCEPTED → INVOICE → PAID\n  ↓\nEXPIRED (auto-expire after validity period)\n  ↓\nREVISED (new version with changes)\n```\n\nWhen a quote is accepted:\n1. Convert to invoice (change prefix, remove validity notice)\n2. Assign invoice number\n3. Set payment terms based on client profile\n4. Send invoice\n5. Archive quote as \"converted\"\n\n---\n\n## 10. Edge Cases & Rules\n\n### Partial Payments\n- Record each payment separately with reference\n- Update balance_due after each payment\n- On final payment → mark PAID\n- If partial + overdue → chase remaining balance only\n\n### Disputed Invoices\n- Mark status as DISPUTED\n- Record dispute reason and date\n- Pause reminders during dispute\n- Track resolution (adjusted, credit note, or confirmed correct)\n- Resume billing after resolution\n\n### Void vs Credit Note\n- **Void**: Invoice was sent in error, never should have existed → mark VOIDED, exclude from reports\n- **Credit Note**: Services were delivered but need adjustment → issue CN, include in reports\n\n### Tax Invoice Requirements (by region)\n- **US**: No strict format, but include EIN if registered\n- **UK\u002FEU**: Must include VAT number, VAT amount, \"reverse charge\" note if applicable\n- **Australia**: Must say \"Tax Invoice\", include ABN, GST amount\n- **Canada**: Include GST\u002FHST number, province-specific rules\n\n### Rounding\n- Always round line item amounts to 2 decimal places\n- Calculate tax on subtotal (not per-line) to avoid penny discrepancies\n- Display currency symbol before amount: $1,234.56\n\n### Invoice Numbering\n- NEVER reuse or skip numbers (tax audit requirement)\n- Sequential within each prefix\n- If voided, keep the number, just mark status\n\n---\n\n## 11. Automation Opportunities\n\nSet up cron jobs or heartbeat checks for:\n- [ ] Generate recurring invoices on schedule\n- [ ] Send overdue reminders per the schedule above\n- [ ] Weekly revenue dashboard to owner\n- [ ] Monthly aging report\n- [ ] Auto-flag clients with >45 days overdue\n- [ ] Quarterly review: update exchange rates, review pricing\n\n---\n\n## 12. Export Formats\n\nWhen the user needs to export:\n- **CSV**: For spreadsheet \u002F accounting import\n  ```\n  invoice_number,client,date,due_date,total,status,amount_paid,balance\n  ```\n- **JSON**: For API integration or backup\n- **Markdown table**: For quick review in chat\n- **PDF-ready text**: Formatted text block ready for PDF generation tool\n\n---\n\n## Commands Reference\n\n| Command | Action |\n|---|---|\n| \"Invoice [client] for [amount\u002Fdescription]\" | Create new invoice |\n| \"Quote [client] for [service]\" | Create proforma |\n| \"Show outstanding invoices\" | List unpaid invoices |\n| \"What's overdue?\" | Aging report, overdue only |\n| \"Revenue this month\" | Monthly revenue dashboard |\n| \"Send reminder for [invoice]\" | Generate reminder email |\n| \"Record payment [invoice] [amount]\" | Log payment received |\n| \"Recurring: [client] [amount] [frequency]\" | Set up recurring invoice |\n| \"Credit note for [invoice]\" | Issue credit\u002Fadjustment |\n| \"Client report [name]\" | Full client payment history |\n| \"Export invoices [format]\" | CSV\u002FJSON\u002FMarkdown export |\n| \"Void [invoice]\" | Void an invoice |\n| \"Update rates\" | Refresh exchange rates |\n","# Invoice Engine — Complete Invoicing & Accounts Receivable\n\nA zero-dependency agent skill for end-to-end invoicing — from quote to payment to reporting.\n\n## Quick Start\n\nWhen the user says \"create an invoice\" or \"bill [client]\":\n\n1. Check if client exists in memory (see Client Registry below)\n2. If new client → run Client Onboarding\n3. Generate invoice using the Invoice Builder\n4. Present for review → finalize\n5. Track in the Invoice Ledger\n\n---\n\n## 1. Client Registry\n\nMaintain a YAML client database in your workspace:\n\n```yaml\n# clients.yaml\nclients:\n  - id: \"CLI-001\"\n    name: \"Acme Corp\"\n    contact: \"Jane Smith\"\n    email: \"jane@acme.com\"\n    address:\n      line1: \"123 Business Ave\"\n      line2: \"Suite 400\"\n      city: \"New York\"\n      state: \"NY\"\n      zip: \"10001\"\n      country: \"US\"\n    tax_id: \"US-EIN-12-3456789\"\n    payment_terms: \"net-30\"       # net-15, net-30, net-45, net-60, due-on-receipt, custom\n    preferred_currency: \"USD\"\n    default_tax_rate: 0           # 0 for B2B cross-border, local rate for domestic\n    notes: \"PO required for invoices > $5,000\"\n    created: \"2026-01-15\"\n    lifetime_revenue: 12500.00\n    invoices_sent: 3\n    invoices_paid: 2\n    avg_days_to_pay: 22\n```\n\n### Client Onboarding Checklist\nWhen adding a new client, collect:\n- [ ] Legal entity name (exactly as on their records)\n- [ ] Billing contact name + email\n- [ ] Billing address (full, with country)\n- [ ] Tax ID \u002F VAT number (if applicable)\n- [ ] Preferred payment terms\n- [ ] Currency preference\n- [ ] Any PO or approval requirements\n- [ ] Tax-exempt? (if so, get certificate reference)\n\n---\n\n## 2. Invoice Builder\n\n### Invoice Number Format\n```\n[PREFIX]-[YEAR].[MONTH].[SEQUENCE]\nExample: INV-2026.02.001\n```\n\nConfigurable prefix per business line:\n- `INV` = standard invoice\n- `PRO` = proforma \u002F quote\n- `REC` = recurring invoice\n- `CN` = credit note\n\n### Invoice Template\n\nWhen generating an invoice, structure it as:\n\n```\n╔══════════════════════════════════════════════════════════╗\n║  [YOUR COMPANY NAME]                                     ║\n║  [Address Line 1]                                        ║\n║  [City, State ZIP]                                       ║\n║  [Country]                                               ║\n║  Tax ID: [YOUR TAX ID]                                   ║\n╠══════════════════════════════════════════════════════════╣\n║                                                          ║\n║  INVOICE [NUMBER]                  Date: [ISSUE DATE]    ║\n║                                    Due:  [DUE DATE]      ║\n║                                                          ║\n║  Bill To:                          Payment Terms:        ║\n║  [CLIENT NAME]                     [Net-30 \u002F etc.]       ║\n║  [Client Address]                                        ║\n║  [City, State ZIP]                 PO Number:            ║\n║  Tax ID: [CLIENT TAX ID]          [If applicable]        ║\n║                                                          ║\n╠══════════════════════════════════════════════════════════╣\n║  #  │ Description          │ Qty │ Rate    │ Amount     ║\n╠═════╪══════════════════════╪═════╪═════════╪════════════╣\n║  1  │ [Service\u002FProduct]    │  1  │ $X,XXX  │ $X,XXX.XX ║\n║  2  │ [Service\u002FProduct]    │  3  │ $XXX    │ $X,XXX.XX ║\n║  3  │ [Expense passthrough]│  1  │ $XXX    │ $XXX.XX   ║\n╠═════╧══════════════════════╧═════╧═════════╧════════════╣\n║                              Subtotal:    $XX,XXX.XX     ║\n║                              Discount:    -$X,XXX.XX     ║\n║                              Tax (X%):    $X,XXX.XX      ║\n║                              ─────────────────────────   ║\n║                              TOTAL DUE:   $XX,XXX.XX     ║\n╠══════════════════════════════════════════════════════════╣\n║  Payment Methods:                                        ║\n║  • Bank Transfer: [Bank] | Acct: [XXXX] | Routing: [XX] ║\n║  • PayPal: [email]                                       ║\n║  • Stripe: [payment link]                                ║\n║  • Bitcoin: [address] \u002F Lightning: [LNURL]               ║\n║                                                          ║\n║  Notes: [Custom message \u002F thank you \u002F late fee notice]   ║\n╚══════════════════════════════════════════════════════════╝\n```\n\n### Line Item Types\n- **Time-based**: Hours × hourly rate (log hours, auto-calculate)\n- **Fixed fee**: Project milestones, retainers\n- **Quantity-based**: Units × unit price\n- **Expense passthrough**: At-cost or with markup %\n- **Discount line**: Negative amount (early payment, volume, loyalty)\n- **Recurring**: Auto-populated from recurring schedule\n\n### Tax Handling Decision Tree\n```\nIs client in same country as you?\n├── YES → Apply local tax rate\n│   ├── Client tax-exempt? → Add exemption reference, 0% tax\n│   └── Client NOT exempt → Apply standard rate\n└── NO → Usually 0% (reverse charge \u002F export)\n    ├── Both in EU? → Reverse charge mechanism (0%, note on invoice)\n    ├── US interstate? → Check nexus rules\n    └── International → 0% with export reference\n```\n\n### Discount & Pricing Framework\n- **Early payment**: 2\u002F10 Net 30 (2% discount if paid within 10 days)\n- **Volume**: Tiered pricing (1-10 units = $X, 11-50 = $Y, 51+ = $Z)\n- **Loyalty**: After 6+ invoices, offer 5% ongoing discount\n- **Bundled**: Package multiple services, discount 10-15% vs à la carte\n- **Seasonal**: Q4 premium (+10%), Q1 discount (-5%) if applicable\n\n---\n\n## 3. Invoice Lifecycle & Status Tracking\n\n### Status Flow\n```\nDRAFT → SENT → VIEWED → PARTIALLY_PAID → PAID → CLOSED\n                  ↓\n              OVERDUE → ESCALATED → WRITTEN_OFF\n                  ↓\n            DISPUTED → RESOLVED → PAID\n```\n\n### Invoice Ledger (YAML)\n\n```yaml\n# invoices.yaml\ninvoices:\n  - number: \"INV-2026.02.001\"\n    client_id: \"CLI-001\"\n    status: \"sent\"\n    issue_date: \"2026-02-13\"\n    due_date: \"2026-03-15\"\n    currency: \"USD\"\n    subtotal: 5000.00\n    discount: 0\n    tax: 0\n    total: 5000.00\n    amount_paid: 0\n    balance_due: 5000.00\n    payment_terms: \"net-30\"\n    line_items:\n      - description: \"AI Integration Consulting — February\"\n        qty: 20\n        rate: 250.00\n        amount: 5000.00\n    payments: []\n    notes: \"\"\n    sent_date: \"2026-02-13\"\n    reminders_sent: 0\n    created: \"2026-02-13T10:30:00Z\"\n```\n\n### Payment Recording\nWhen a payment comes in:\n```yaml\npayments:\n  - date: \"2026-03-10\"\n    amount: 5000.00\n    method: \"bank_transfer\"    # bank_transfer, stripe, paypal, btc, cash, check\n    reference: \"TXN-ABC123\"\n    notes: \"Paid in full\"\n```\n\nUpdate: `amount_paid`, `balance_due`, `status` (→ paid if balance = 0, → partially_paid if balance > 0)\n\n---\n\n## 4. Recurring Invoices\n\n### Schedule Configuration\n```yaml\nrecurring:\n  - id: \"REC-001\"\n    client_id: \"CLI-001\"\n    description: \"Monthly Retainer — AI Ops Support\"\n    frequency: \"monthly\"          # weekly, biweekly, monthly, quarterly, annually\n    day_of_month: 1               # 1-28 (avoid 29-31 for safety)\n    line_items:\n      - description: \"AI Operations Retainer\"\n        qty: 1\n        rate: 3500.00\n    auto_send: true               # false = create as draft\n    start_date: \"2026-01-01\"\n    end_date: null                # null = indefinite\n    next_invoice: \"2026-03-01\"\n    invoices_generated: 2\n    active: true\n```\n\n### Recurring Invoice Routine (run on schedule)\n1. Check `recurring` entries where `next_invoice \u003C= today` and `active = true`\n2. For each: generate invoice from template, assign next number\n3. If `auto_send = true` → mark as sent, notify client\n4. If `auto_send = false` → save as draft, notify user for review\n5. Update `next_invoice` to next occurrence\n6. Log in daily memory\n\n---\n\n## 5. Overdue Management & Collections\n\n### Reminder Schedule\n| Days After Due | Action | Tone |\n|---|---|---|\n| +1 day | Friendly reminder email | \"Just a gentle reminder...\" |\n| +7 days | Follow-up with invoice attached | \"Following up on...\" |\n| +14 days | Firm reminder, mention late fee | \"This invoice is now 14 days past due...\" |\n| +30 days | Final notice before escalation | \"Final notice — please remit payment...\" |\n| +45 days | Escalate to human (Kalin\u002FChristina) | Flag for personal outreach |\n| +60 days | Consider write-off or collections | Business decision |\n\n### Reminder Templates\n\n**Day +1 (Friendly)**\n```\nSubject: Friendly reminder — Invoice [NUMBER] due [DATE]\n\nHi [CONTACT],\n\nHope all is well! Just a quick reminder that invoice [NUMBER] for [AMOUNT] was due on [DATE].\n\nIf you've already sent payment, please disregard this note.\n\nPayment details are on the attached invoice. Let me know if you need anything.\n\nBest,\n[YOUR NAME]\n```\n\n**Day +14 (Firm)**\n```\nSubject: Invoice [NUMBER] — 14 days overdue ([AMOUNT])\n\nHi [CONTACT],\n\nInvoice [NUMBER] for [AMOUNT] is now 14 days past the due date of [DATE].\n\nPer our agreement, a late fee of [X]% may apply to balances outstanding beyond [Y] days.\n\nCould you confirm when we can expect payment? Happy to discuss if there's an issue.\n\nThanks,\n[YOUR NAME]\n```\n\n**Day +30 (Final)**\n```\nSubject: Final notice — Invoice [NUMBER] overdue ([AMOUNT])\n\nHi [CONTACT],\n\nThis is a final reminder that invoice [NUMBER] for [AMOUNT] remains unpaid, now 30 days past the due date.\n\nPlease arrange payment within the next 7 business days to avoid further action.\n\nIf there's a dispute or issue with this invoice, please let me know immediately so we can resolve it.\n\nRegards,\n[YOUR NAME]\n```\n\n### Late Fee Calculation\n```\nStandard: 1.5% per month on overdue balance (18% APR)\nGrace period: 5 business days after due date\nCompound: Simple interest (not compound)\nCap: 25% of invoice total (or local legal maximum)\n\nFormula: late_fee = balance_due × (monthly_rate \u002F 30) × days_overdue\nExample: $5,000 × (0.015 \u002F 30) × 14 = $35.00\n```\n\n---\n\n## 6. Financial Reporting\n\n### Revenue Dashboard (generate weekly\u002Fmonthly)\n\n```\n═══ REVENUE SUMMARY — [MONTH YEAR] ═══\n\nInvoiced This Month:      $XX,XXX.XX  ([N] invoices)\nCollected This Month:     $XX,XXX.XX  ([N] payments)\nOutstanding (not overdue): $XX,XXX.XX  ([N] invoices)\nOverdue:                  $XX,XXX.XX  ([N] invoices, avg [X] days late)\nWritten Off (YTD):        $XX,XXX.XX\n\nCollection Rate:          XX.X%  (collected \u002F invoiced, trailing 90 days)\nAvg Days to Pay:          XX days (trailing 90 days)\nAvg Invoice Size:         $X,XXX.XX\n\n═══ TOP CLIENTS (by revenue, YTD) ═══\n1. [Client] — $XX,XXX  ([N] invoices, avg [X] days to pay)\n2. [Client] — $XX,XXX  ([N] invoices, avg [X] days to pay)\n3. [Client] — $XX,XXX  ([N] invoices, avg [X] days to pay)\n\n═══ AGING REPORT ═══\nCurrent (not yet due):     $XX,XXX  ([N] invoices)\n1-15 days overdue:         $XX,XXX  ([N] invoices)\n16-30 days overdue:        $XX,XXX  ([N] invoices)\n31-60 days overdue:        $XX,XXX  ([N] invoices)\n60+ days overdue:          $XX,XXX  ([N] invoices) ⚠️\n\n═══ MONTHLY TREND ═══\nJan: $XX,XXX ████████████\nFeb: $XX,XXX ████████████████\nMar: $XX,XXX ██████████\n...\n\n═══ ACTIONS NEEDED ═══\n• [N] invoices need reminder emails\n• [N] recurring invoices due for generation\n• [Client] has disputed INV-XXXX — needs resolution\n```\n\n### Key Metrics to Track\n- **Collection Rate**: % of invoiced amount actually collected (target: >95%)\n- **DSO (Days Sales Outstanding)**: avg days from invoice to payment (target: \u003C30)\n- **Overdue Ratio**: overdue balance \u002F total outstanding (target: \u003C10%)\n- **Revenue Concentration**: % from top client (flag if >40% — dependency risk)\n- **MRR from Recurring**: recurring invoice total \u002F month\n\n---\n\n## 7. Credit Notes & Adjustments\n\nWhen a refund or correction is needed:\n\n```yaml\ncredit_note:\n  number: \"CN-2026.02.001\"\n  original_invoice: \"INV-2026.01.003\"\n  client_id: \"CLI-001\"\n  reason: \"Partial refund — service hours overcharged\"\n  line_items:\n    - description: \"Correction: 5 hours overcharged\"\n      qty: -5\n      rate: 250.00\n      amount: -1250.00\n  total: -1250.00\n  issued: \"2026-02-13\"\n```\n\nApply credit notes against:\n1. The original invoice (reduce balance)\n2. Future invoices (credit on account)\n3. Direct refund (record refund method + reference)\n\n---\n\n## 8. Multi-Currency Support\n\n```yaml\ncurrencies:\n  primary: \"USD\"\n  accepted: [\"USD\", \"GBP\", \"EUR\", \"BTC\"]\n  exchange_rates:  # Update weekly or use live rates\n    GBP_USD: 1.27\n    EUR_USD: 1.08\n    BTC_USD: 97500\n  conversion_note: \"Converted at rate on invoice date. Payment accepted in invoiced currency only.\"\n```\n\nRules:\n- Always invoice in the client's preferred currency\n- Record payments in the currency received\n- Convert to primary currency for reporting (use rate on payment date)\n- Note exchange rate on invoice if cross-currency\n- BTC\u002FLightning: include both sats and fiat equivalent\n\n---\n\n## 9. Quote-to-Invoice Pipeline\n\n### Quote (Proforma) Template\nSame as invoice template but:\n- Prefix: `PRO-` instead of `INV-`\n- Header: \"QUOTATION\" instead of \"INVOICE\"\n- Add: \"Valid until: [DATE]\" (typically 30 days)\n- Add: \"This is not a tax invoice\"\n\n### Pipeline Flow\n```\nQUOTE → ACCEPTED → INVOICE → PAID\n  ↓\nEXPIRED (auto-expire after validity period)\n  ↓\nREVISED (new version with changes)\n```\n\nWhen a quote is accepted:\n1. Convert to invoice (change prefix, remove validity notice)\n2. Assign invoice number\n3. Set payment terms based on client profile\n4. Send invoice\n5. Archive quote as \"converted\"\n\n---\n\n## 10. Edge Cases & Rules\n\n### Partial Payments\n- Record each payment separately with reference\n- Update balance_due after each payment\n- On final payment → mark PAID\n- If partial + overdue → chase remaining balance only\n\n### Disputed Invoices\n- Mark status as DISPUTED\n- Record dispute reason and date\n- Pause reminders during dispute\n- Track resolution (adjusted, credit note, or confirmed correct)\n- Resume billing after resolution\n\n### Void vs Credit Note\n- **Void**: Invoice was sent in error, never should have existed → mark VOIDED, exclude from reports\n- **Credit Note**: Services were delivered but need adjustment → issue CN, include in reports\n\n### Tax Invoice Requirements (by region)\n- **US**: No strict format, but include EIN if registered\n- **UK\u002FEU**: Must include VAT number, VAT amount, \"reverse charge\" note if applicable\n- **Australia**: Must say \"Tax Invoice\", include ABN, GST amount\n- **Canada**: Include GST\u002FHST number, province-specific rules\n\n### Rounding\n- Always round line item amounts to 2 decimal places\n- Calculate tax on subtotal (not per-line) to avoid penny discrepancies\n- Display currency symbol before amount: $1,234.56\n\n### Invoice Numbering\n- NEVER reuse or skip numbers (tax audit requirement)\n- Sequential within each prefix\n- If voided, keep the number, just mark status\n\n---\n\n## 11. Automation Opportunities\n\nSet up cron jobs or heartbeat checks for:\n- [ ] Generate recurring invoices on schedule\n- [ ] Send overdue reminders per the schedule above\n- [ ] Weekly revenue dashboard to owner\n- [ ] Monthly aging report\n- [ ] Auto-flag clients with >45 days overdue\n- [ ] Quarterly review: update exchange rates, review pricing\n\n---\n\n## 12. Export Formats\n\nWhen the user needs to export:\n- **CSV**: For spreadsheet \u002F accounting import\n  ```\n  invoice_number,client,date,due_date,total,status,amount_paid,balance\n  ```\n- **JSON**: For API integration or backup\n- **Markdown table**: For quick review in chat\n- **PDF-ready text**: Formatted text block ready for PDF generation tool\n\n---\n\n## Commands Reference\n\n| Command | Action |\n|---|---|\n| \"Invoice [client] for [amount\u002Fdescription]\" | Create new invoice |\n| \"Quote [client] for [service]\" | Create proforma |\n| \"Show outstanding invoices\" | List unpaid invoices |\n| \"What's overdue?\" | Aging report, overdue only |\n| \"Revenue this month\" | Monthly revenue dashboard |\n| \"Send reminder for [invoice]\" | Generate reminder email |\n| \"Record payment [invoice] [amount]\" | Log payment received |\n| \"Recurring: [client] [amount] [frequency]\" | Set up recurring invoice |\n| \"Credit note for [invoice]\" | Issue credit\u002Fadjustment |\n| \"Client report [name]\" | Full client payment history |\n| \"Export invoices [format]\" | CSV\u002FJSON\u002FMarkdown export |\n| \"Void [invoice]\" | Void an invoice |\n| \"Update rates\" | Refresh exchange rates |\n",{"name":5,"description":7},"master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fa\u002Fafrexai-invoice-engine",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill afrexai-invoice-engine",{"tool":39,"command":40},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill afrexai-invoice-engine",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill afrexai-invoice-engine","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fa\u002Fafrexai-invoice-engine\u002FSKILL.md",true,[],[48,56,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":55},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":55},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":55},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"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":55},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":55},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":55},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]