[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EEFJVNN50MD0W678PWDKS2":3,"skill-same:01M6EEFJVNN50MD0W678PWDKS2":52},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":25,"linkOnly":26,"markdownContent":27,"markdownBody":27,"frontMatter":28,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":34,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":36,"updatedAt":37,"install":38,"resources":51},"01M6EEFJVNN50MD0W678PWDKS2","billing-automation",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fbilling-automation\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[23,24],"automation","billing automation","2026-11-10 10:12:30",false,"# Billing Automation\n\n## Overview\n\nThis skill helps you build automated billing workflows covering invoice generation from usage data, PDF rendering, payment processing integration, dunning (payment failure handling), and financial reporting. It handles the complexity of proration, usage-based billing, multi-currency support, and tax calculation.\n\n## Instructions\n\n### 1. Define the Billing Model\n\nDetermine the billing structure:\n- **Flat subscription**: Fixed price per period (monthly\u002Fannual)\n- **Usage-based**: Metered billing (API calls, storage, compute hours)\n- **Tiered**: Volume-based pricing with breakpoints\n- **Hybrid**: Base subscription + usage overage\n- **Per-seat**: Price per active user\n\n### 2. Design the Invoice Data Model\n\n```sql\ninvoices (\n  id, customer_id, invoice_number, status,\n  billing_period_start, billing_period_end,\n  subtotal, tax_amount, total, currency,\n  due_date, paid_at, created_at\n)\ninvoice_line_items (\n  id, invoice_id, description, quantity, unit_price,\n  amount, metadata_json\n)\npayments (\n  id, invoice_id, amount, currency, method,\n  processor_ref, status, paid_at\n)\nbilling_events (\n  id, customer_id, event_type, quantity,\n  unit, timestamp, metadata_json\n)\n```\n\n### 3. Build the Invoice Generation Pipeline\n\n```\nFor each billing cycle:\n  1. Aggregate usage events for the billing period\n  2. Apply pricing rules (tiers, discounts, proration)\n  3. Calculate taxes based on customer location\n  4. Generate invoice record with line items\n  5. Render PDF with company branding\n  6. Send via email and store in customer portal\n  7. Initiate payment collection (auto-charge or payment link)\n  8. Handle payment success\u002Ffailure with appropriate follow-up\n```\n\n### 4. Handle Edge Cases\n\n- **Proration**: When a customer upgrades mid-cycle, calculate partial charges\n- **Credits**: Apply account credits before charging payment method\n- **Disputes**: Mark invoice as disputed, pause dunning\n- **Refunds**: Generate credit notes linked to original invoice\n- **Currency**: Store amounts in smallest unit (cents), display with proper formatting\n- **Tax**: Integrate with tax calculation service for multi-jurisdiction compliance\n\n### 5. Dunning (Payment Failure) Workflow\n\n```\nPayment failed:\n  Day 0: Retry payment, send \"payment failed\" email\n  Day 3: Retry with updated payment method prompt\n  Day 7: Final retry, warn about service suspension\n  Day 14: Suspend service, send \"account suspended\" email\n  Day 30: Cancel subscription, final notice\n```\n\n## Examples\n\n### Example 1: Usage-based invoice generation\n\n**User prompt:**\n```\nGenerate monthly invoices for our API platform. Customers are billed per API call with tiered pricing: first 10,000 calls free, 10,001-100,000 at $0.001 each, 100,001+ at $0.0005 each. Pull usage from our billing_events table and generate PDF invoices.\n```\n\n**Agent output:**\n\n```javascript\n\u002F\u002F services\u002FInvoiceGenerator.js\nclass InvoiceGenerator {\n  constructor({ db, pdfRenderer, emailService, paymentProcessor }) {\n    this.db = db;\n    this.pdfRenderer = pdfRenderer;\n    this.emailService = emailService;\n    this.paymentProcessor = paymentProcessor;\n  }\n\n  async generateMonthlyInvoices(billingMonth) {\n    const customers = await this.db.getActiveCustomers();\n    const results = { generated: 0, skipped: 0, errors: [] };\n\n    for (const customer of customers) {\n      try {\n        const usage = await this.aggregateUsage(customer.id, billingMonth);\n        if (usage.totalCalls === 0) { results.skipped++; continue; }\n\n        const lineItems = this.calculateTieredPricing(usage.totalCalls);\n        const tax = await this.calculateTax(customer, lineItems);\n\n        const invoice = await this.db.createInvoice({\n          customerId: customer.id,\n          invoiceNumber: this.generateInvoiceNumber(billingMonth),\n          billingPeriodStart: billingMonth.start,\n          billingPeriodEnd: billingMonth.end,\n          lineItems,\n          subtotal: lineItems.reduce((sum, li) => sum + li.amount, 0),\n          taxAmount: tax.amount,\n          total: lineItems.reduce((sum, li) => sum + li.amount, 0) + tax.amount,\n          currency: 'USD',\n          dueDate: addDays(billingMonth.end, 30),\n        });\n\n        const pdf = await this.pdfRenderer.render('invoice', { invoice, customer });\n        await this.emailService.send(customer.email, 'invoice', { invoice, pdf });\n        results.generated++;\n      } catch (error) {\n        results.errors.push({ customerId: customer.id, error: error.message });\n      }\n    }\n    return results;\n  }\n\n  calculateTieredPricing(totalCalls) {\n    const items = [];\n    if (totalCalls \u003C= 10000) {\n      items.push({ description: 'API calls (free tier)', quantity: totalCalls, unitPrice: 0, amount: 0 });\n    } else if (totalCalls \u003C= 100000) {\n      items.push({ description: 'API calls (free tier)', quantity: 10000, unitPrice: 0, amount: 0 });\n      const paid = totalCalls - 10000;\n      items.push({ description: 'API calls (standard)', quantity: paid, unitPrice: 0.001, amount: paid * 0.001 });\n    } else {\n      items.push({ description: 'API calls (free tier)', quantity: 10000, unitPrice: 0, amount: 0 });\n      items.push({ description: 'API calls (standard)', quantity: 90000, unitPrice: 0.001, amount: 90 });\n      const bulk = totalCalls - 100000;\n      items.push({ description: 'API calls (volume)', quantity: bulk, unitPrice: 0.0005, amount: bulk * 0.0005 });\n    }\n    return items;\n  }\n}\n```\n\n### Example 2: Dunning workflow with Stripe\n\n**User prompt:**\n```\nImplement a dunning workflow for failed subscription payments. Use Stripe for payment processing. Escalate from retry to email to service suspension.\n```\n\n**Agent generates** a complete dunning service with webhook handlers for `invoice.payment_failed`, configurable retry schedules, email templates for each escalation stage, and automatic subscription status management.\n\n## Guidelines\n\n- Always use idempotency keys for payment operations to prevent double charges\n- Store all monetary amounts as integers in smallest currency unit (cents, pence)\n- Generate sequential invoice numbers with no gaps for tax compliance\n- Keep an immutable audit log of all billing events\n- Send invoices as PDF attachments AND provide a web portal link\n- Include legally required fields: company details, tax ID, payment terms, line items\n- Test billing logic with edge cases: zero usage, negative amounts (credits), currency rounding\n- Implement webhook handlers for payment processor events rather than polling\n- Never delete invoices — void them with a credit note instead\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Fbilling-automation",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill billing-automation",{"tool":44,"command":45},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill billing-automation",{"tool":47,"command":48},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill billing-automation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fbilling-automation\u002FSKILL.md",true,[],[53,63,73,82,88,95],{"skillNo":54,"name":55,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":59,"publishedAt":25},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[58],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[60,61,62],"model","model hierarchy","model hierarchy skill",{"skillNo":64,"name":65,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":69,"publishedAt":25},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[68],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[70,71,72],"MCP","zoom","zoom mcp",{"skillNo":74,"name":75,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":25},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[79,80,81,71],"sdk","zoom apps sdk","apps",{"skillNo":83,"name":84,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":25},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[84],{"skillNo":89,"name":90,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":94,"publishedAt":25},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[93],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[90],{"skillNo":96,"name":97,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":25},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[97]]