{
  "schemaVersion": "1.0",
  "item": {
    "slug": "afrexai-invoice-engine",
    "name": "Invoice Engine",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/1kalin/afrexai-invoice-engine",
    "canonicalUrl": "https://clawhub.ai/1kalin/afrexai-invoice-engine",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/afrexai-invoice-engine",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-invoice-engine",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "README.md",
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/afrexai-invoice-engine"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/afrexai-invoice-engine",
    "agentPageUrl": "https://openagent3.xyz/skills/afrexai-invoice-engine/agent",
    "manifestUrl": "https://openagent3.xyz/skills/afrexai-invoice-engine/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/afrexai-invoice-engine/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Invoice Engine — Complete Invoicing & Accounts Receivable",
        "body": "A zero-dependency agent skill for end-to-end invoicing — from quote to payment to reporting."
      },
      {
        "title": "Quick Start",
        "body": "When the user says \"create an invoice\" or \"bill [client]\":\n\nCheck if client exists in memory (see Client Registry below)\nIf new client → run Client Onboarding\nGenerate invoice using the Invoice Builder\nPresent for review → finalize\nTrack in the Invoice Ledger"
      },
      {
        "title": "1. Client Registry",
        "body": "Maintain a YAML client database in your workspace:\n\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"
      },
      {
        "title": "Client Onboarding Checklist",
        "body": "When adding a new client, collect:\n\nLegal entity name (exactly as on their records)\n Billing contact name + email\n Billing address (full, with country)\n Tax ID / 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)"
      },
      {
        "title": "Invoice Number Format",
        "body": "[PREFIX]-[YEAR].[MONTH].[SEQUENCE]\nExample: INV-2026.02.001\n\nConfigurable prefix per business line:\n\nINV = standard invoice\nPRO = proforma / quote\nREC = recurring invoice\nCN = credit note"
      },
      {
        "title": "Invoice Template",
        "body": "When generating an invoice, structure it as:\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 / 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/Product]    │  1  │ $X,XXX  │ $X,XXX.XX ║\n║  2  │ [Service/Product]    │  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] / Lightning: [LNURL]               ║\n║                                                          ║\n║  Notes: [Custom message / thank you / late fee notice]   ║\n╚══════════════════════════════════════════════════════════╝"
      },
      {
        "title": "Line Item Types",
        "body": "Time-based: Hours × hourly rate (log hours, auto-calculate)\nFixed fee: Project milestones, retainers\nQuantity-based: Units × unit price\nExpense passthrough: At-cost or with markup %\nDiscount line: Negative amount (early payment, volume, loyalty)\nRecurring: Auto-populated from recurring schedule"
      },
      {
        "title": "Tax Handling Decision Tree",
        "body": "Is 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 / export)\n    ├── Both in EU? → Reverse charge mechanism (0%, note on invoice)\n    ├── US interstate? → Check nexus rules\n    └── International → 0% with export reference"
      },
      {
        "title": "Discount & Pricing Framework",
        "body": "Early payment: 2/10 Net 30 (2% discount if paid within 10 days)\nVolume: Tiered pricing (1-10 units = $X, 11-50 = $Y, 51+ = $Z)\nLoyalty: After 6+ invoices, offer 5% ongoing discount\nBundled: Package multiple services, discount 10-15% vs à la carte\nSeasonal: Q4 premium (+10%), Q1 discount (-5%) if applicable"
      },
      {
        "title": "Status Flow",
        "body": "DRAFT → SENT → VIEWED → PARTIALLY_PAID → PAID → CLOSED\n                  ↓\n              OVERDUE → ESCALATED → WRITTEN_OFF\n                  ↓\n            DISPUTED → RESOLVED → PAID"
      },
      {
        "title": "Invoice Ledger (YAML)",
        "body": "# 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\""
      },
      {
        "title": "Payment Recording",
        "body": "When a payment comes in:\n\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\nUpdate: amount_paid, balance_due, status (→ paid if balance = 0, → partially_paid if balance > 0)"
      },
      {
        "title": "Schedule Configuration",
        "body": "recurring:\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"
      },
      {
        "title": "Recurring Invoice Routine (run on schedule)",
        "body": "Check recurring entries where next_invoice <= today and active = true\nFor each: generate invoice from template, assign next number\nIf auto_send = true → mark as sent, notify client\nIf auto_send = false → save as draft, notify user for review\nUpdate next_invoice to next occurrence\nLog in daily memory"
      },
      {
        "title": "Reminder Schedule",
        "body": "Days After DueActionTone+1 dayFriendly reminder email\"Just a gentle reminder...\"+7 daysFollow-up with invoice attached\"Following up on...\"+14 daysFirm reminder, mention late fee\"This invoice is now 14 days past due...\"+30 daysFinal notice before escalation\"Final notice — please remit payment...\"+45 daysEscalate to human (Kalin/Christina)Flag for personal outreach+60 daysConsider write-off or collectionsBusiness decision"
      },
      {
        "title": "Reminder Templates",
        "body": "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\nDay +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\nDay +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]"
      },
      {
        "title": "Late Fee Calculation",
        "body": "Standard: 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 / 30) × days_overdue\nExample: $5,000 × (0.015 / 30) × 14 = $35.00"
      },
      {
        "title": "Revenue Dashboard (generate weekly/monthly)",
        "body": "═══ 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 / 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"
      },
      {
        "title": "Key Metrics to Track",
        "body": "Collection Rate: % of invoiced amount actually collected (target: >95%)\nDSO (Days Sales Outstanding): avg days from invoice to payment (target: <30)\nOverdue Ratio: overdue balance / total outstanding (target: <10%)\nRevenue Concentration: % from top client (flag if >40% — dependency risk)\nMRR from Recurring: recurring invoice total / month"
      },
      {
        "title": "7. Credit Notes & Adjustments",
        "body": "When a refund or correction is needed:\n\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\nApply credit notes against:\n\nThe original invoice (reduce balance)\nFuture invoices (credit on account)\nDirect refund (record refund method + reference)"
      },
      {
        "title": "8. Multi-Currency Support",
        "body": "currencies:\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\nRules:\n\nAlways invoice in the client's preferred currency\nRecord payments in the currency received\nConvert to primary currency for reporting (use rate on payment date)\nNote exchange rate on invoice if cross-currency\nBTC/Lightning: include both sats and fiat equivalent"
      },
      {
        "title": "Quote (Proforma) Template",
        "body": "Same as invoice template but:\n\nPrefix: PRO- instead of INV-\nHeader: \"QUOTATION\" instead of \"INVOICE\"\nAdd: \"Valid until: [DATE]\" (typically 30 days)\nAdd: \"This is not a tax invoice\""
      },
      {
        "title": "Pipeline Flow",
        "body": "QUOTE → ACCEPTED → INVOICE → PAID\n  ↓\nEXPIRED (auto-expire after validity period)\n  ↓\nREVISED (new version with changes)\n\nWhen a quote is accepted:\n\nConvert to invoice (change prefix, remove validity notice)\nAssign invoice number\nSet payment terms based on client profile\nSend invoice\nArchive quote as \"converted\""
      },
      {
        "title": "Partial Payments",
        "body": "Record each payment separately with reference\nUpdate balance_due after each payment\nOn final payment → mark PAID\nIf partial + overdue → chase remaining balance only"
      },
      {
        "title": "Disputed Invoices",
        "body": "Mark status as DISPUTED\nRecord dispute reason and date\nPause reminders during dispute\nTrack resolution (adjusted, credit note, or confirmed correct)\nResume billing after resolution"
      },
      {
        "title": "Void vs Credit Note",
        "body": "Void: Invoice was sent in error, never should have existed → mark VOIDED, exclude from reports\nCredit Note: Services were delivered but need adjustment → issue CN, include in reports"
      },
      {
        "title": "Tax Invoice Requirements (by region)",
        "body": "US: No strict format, but include EIN if registered\nUK/EU: Must include VAT number, VAT amount, \"reverse charge\" note if applicable\nAustralia: Must say \"Tax Invoice\", include ABN, GST amount\nCanada: Include GST/HST number, province-specific rules"
      },
      {
        "title": "Rounding",
        "body": "Always round line item amounts to 2 decimal places\nCalculate tax on subtotal (not per-line) to avoid penny discrepancies\nDisplay currency symbol before amount: $1,234.56"
      },
      {
        "title": "Invoice Numbering",
        "body": "NEVER reuse or skip numbers (tax audit requirement)\nSequential within each prefix\nIf voided, keep the number, just mark status"
      },
      {
        "title": "11. Automation Opportunities",
        "body": "Set up cron jobs or heartbeat checks for:\n\nGenerate 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"
      },
      {
        "title": "12. Export Formats",
        "body": "When the user needs to export:\n\nCSV: For spreadsheet / accounting import\ninvoice_number,client,date,due_date,total,status,amount_paid,balance\n\n\nJSON: For API integration or backup\nMarkdown table: For quick review in chat\nPDF-ready text: Formatted text block ready for PDF generation tool"
      },
      {
        "title": "Commands Reference",
        "body": "CommandAction\"Invoice [client] for [amount/description]\"Create new invoice\"Quote [client] for [service]\"Create proforma\"Show outstanding invoices\"List unpaid invoices\"What's overdue?\"Aging report, overdue only\"Revenue this month\"Monthly revenue dashboard\"Send reminder for [invoice]\"Generate reminder email\"Record payment [invoice] [amount]\"Log payment received\"Recurring: [client] [amount] [frequency]\"Set up recurring invoice\"Credit note for [invoice]\"Issue credit/adjustment\"Client report [name]\"Full client payment history\"Export invoices [format]\"CSV/JSON/Markdown export\"Void [invoice]\"Void an invoice\"Update rates\"Refresh exchange rates"
      }
    ],
    "body": "Invoice Engine — Complete Invoicing & Accounts Receivable\n\nA zero-dependency agent skill for end-to-end invoicing — from quote to payment to reporting.\n\nQuick Start\n\nWhen the user says \"create an invoice\" or \"bill [client]\":\n\nCheck if client exists in memory (see Client Registry below)\nIf new client → run Client Onboarding\nGenerate invoice using the Invoice Builder\nPresent for review → finalize\nTrack in the Invoice Ledger\n1. Client Registry\n\nMaintain a YAML client database in your workspace:\n\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\nClient Onboarding Checklist\n\nWhen adding a new client, collect:\n\n Legal entity name (exactly as on their records)\n Billing contact name + email\n Billing address (full, with country)\n Tax ID / 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)\n2. Invoice Builder\nInvoice Number Format\n[PREFIX]-[YEAR].[MONTH].[SEQUENCE]\nExample: INV-2026.02.001\n\n\nConfigurable prefix per business line:\n\nINV = standard invoice\nPRO = proforma / quote\nREC = recurring invoice\nCN = credit note\nInvoice Template\n\nWhen generating an invoice, structure it as:\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 / 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/Product]    │  1  │ $X,XXX  │ $X,XXX.XX ║\n║  2  │ [Service/Product]    │  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] / Lightning: [LNURL]               ║\n║                                                          ║\n║  Notes: [Custom message / thank you / late fee notice]   ║\n╚══════════════════════════════════════════════════════════╝\n\nLine Item Types\nTime-based: Hours × hourly rate (log hours, auto-calculate)\nFixed fee: Project milestones, retainers\nQuantity-based: Units × unit price\nExpense passthrough: At-cost or with markup %\nDiscount line: Negative amount (early payment, volume, loyalty)\nRecurring: Auto-populated from recurring schedule\nTax Handling Decision Tree\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 / 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\nDiscount & Pricing Framework\nEarly payment: 2/10 Net 30 (2% discount if paid within 10 days)\nVolume: Tiered pricing (1-10 units = $X, 11-50 = $Y, 51+ = $Z)\nLoyalty: After 6+ invoices, offer 5% ongoing discount\nBundled: Package multiple services, discount 10-15% vs à la carte\nSeasonal: Q4 premium (+10%), Q1 discount (-5%) if applicable\n3. Invoice Lifecycle & Status Tracking\nStatus Flow\nDRAFT → SENT → VIEWED → PARTIALLY_PAID → PAID → CLOSED\n                  ↓\n              OVERDUE → ESCALATED → WRITTEN_OFF\n                  ↓\n            DISPUTED → RESOLVED → PAID\n\nInvoice Ledger (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\nPayment Recording\n\nWhen a payment comes in:\n\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\n4. Recurring Invoices\nSchedule Configuration\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\nRecurring Invoice Routine (run on schedule)\nCheck recurring entries where next_invoice <= today and active = true\nFor each: generate invoice from template, assign next number\nIf auto_send = true → mark as sent, notify client\nIf auto_send = false → save as draft, notify user for review\nUpdate next_invoice to next occurrence\nLog in daily memory\n5. Overdue Management & Collections\nReminder Schedule\nDays After Due\tAction\tTone\n+1 day\tFriendly reminder email\t\"Just a gentle reminder...\"\n+7 days\tFollow-up with invoice attached\t\"Following up on...\"\n+14 days\tFirm reminder, mention late fee\t\"This invoice is now 14 days past due...\"\n+30 days\tFinal notice before escalation\t\"Final notice — please remit payment...\"\n+45 days\tEscalate to human (Kalin/Christina)\tFlag for personal outreach\n+60 days\tConsider write-off or collections\tBusiness decision\nReminder Templates\n\nDay +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\nDay +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\nDay +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\nLate Fee Calculation\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 / 30) × days_overdue\nExample: $5,000 × (0.015 / 30) × 14 = $35.00\n\n6. Financial Reporting\nRevenue Dashboard (generate weekly/monthly)\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 / 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\nKey Metrics to Track\nCollection Rate: % of invoiced amount actually collected (target: >95%)\nDSO (Days Sales Outstanding): avg days from invoice to payment (target: <30)\nOverdue Ratio: overdue balance / total outstanding (target: <10%)\nRevenue Concentration: % from top client (flag if >40% — dependency risk)\nMRR from Recurring: recurring invoice total / month\n7. Credit Notes & Adjustments\n\nWhen a refund or correction is needed:\n\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:\n\nThe original invoice (reduce balance)\nFuture invoices (credit on account)\nDirect refund (record refund method + reference)\n8. Multi-Currency Support\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\nAlways invoice in the client's preferred currency\nRecord payments in the currency received\nConvert to primary currency for reporting (use rate on payment date)\nNote exchange rate on invoice if cross-currency\nBTC/Lightning: include both sats and fiat equivalent\n9. Quote-to-Invoice Pipeline\nQuote (Proforma) Template\n\nSame as invoice template but:\n\nPrefix: PRO- instead of INV-\nHeader: \"QUOTATION\" instead of \"INVOICE\"\nAdd: \"Valid until: [DATE]\" (typically 30 days)\nAdd: \"This is not a tax invoice\"\nPipeline Flow\nQUOTE → ACCEPTED → INVOICE → PAID\n  ↓\nEXPIRED (auto-expire after validity period)\n  ↓\nREVISED (new version with changes)\n\n\nWhen a quote is accepted:\n\nConvert to invoice (change prefix, remove validity notice)\nAssign invoice number\nSet payment terms based on client profile\nSend invoice\nArchive quote as \"converted\"\n10. Edge Cases & Rules\nPartial Payments\nRecord each payment separately with reference\nUpdate balance_due after each payment\nOn final payment → mark PAID\nIf partial + overdue → chase remaining balance only\nDisputed Invoices\nMark status as DISPUTED\nRecord dispute reason and date\nPause reminders during dispute\nTrack resolution (adjusted, credit note, or confirmed correct)\nResume billing after resolution\nVoid vs Credit Note\nVoid: Invoice was sent in error, never should have existed → mark VOIDED, exclude from reports\nCredit Note: Services were delivered but need adjustment → issue CN, include in reports\nTax Invoice Requirements (by region)\nUS: No strict format, but include EIN if registered\nUK/EU: Must include VAT number, VAT amount, \"reverse charge\" note if applicable\nAustralia: Must say \"Tax Invoice\", include ABN, GST amount\nCanada: Include GST/HST number, province-specific rules\nRounding\nAlways round line item amounts to 2 decimal places\nCalculate tax on subtotal (not per-line) to avoid penny discrepancies\nDisplay currency symbol before amount: $1,234.56\nInvoice Numbering\nNEVER reuse or skip numbers (tax audit requirement)\nSequential within each prefix\nIf voided, keep the number, just mark status\n11. Automation Opportunities\n\nSet up cron jobs or heartbeat checks for:\n\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\n12. Export Formats\n\nWhen the user needs to export:\n\nCSV: For spreadsheet / accounting import\ninvoice_number,client,date,due_date,total,status,amount_paid,balance\n\nJSON: For API integration or backup\nMarkdown table: For quick review in chat\nPDF-ready text: Formatted text block ready for PDF generation tool\nCommands Reference\nCommand\tAction\n\"Invoice [client] for [amount/description]\"\tCreate new invoice\n\"Quote [client] for [service]\"\tCreate proforma\n\"Show outstanding invoices\"\tList unpaid invoices\n\"What's overdue?\"\tAging report, overdue only\n\"Revenue this month\"\tMonthly revenue dashboard\n\"Send reminder for [invoice]\"\tGenerate reminder email\n\"Record payment [invoice] [amount]\"\tLog payment received\n\"Recurring: [client] [amount] [frequency]\"\tSet up recurring invoice\n\"Credit note for [invoice]\"\tIssue credit/adjustment\n\"Client report [name]\"\tFull client payment history\n\"Export invoices [format]\"\tCSV/JSON/Markdown export\n\"Void [invoice]\"\tVoid an invoice\n\"Update rates\"\tRefresh exchange rates"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/1kalin/afrexai-invoice-engine",
    "publisherUrl": "https://clawhub.ai/1kalin/afrexai-invoice-engine",
    "owner": "1kalin",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/afrexai-invoice-engine",
    "downloadUrl": "https://openagent3.xyz/downloads/afrexai-invoice-engine",
    "agentUrl": "https://openagent3.xyz/skills/afrexai-invoice-engine/agent",
    "manifestUrl": "https://openagent3.xyz/skills/afrexai-invoice-engine/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/afrexai-invoice-engine/agent.md"
  }
}