wshobson avatar

Billing Automation

Handles the gnarly parts of subscription billing that everyone underestimates. Generates invoices with proper proration when customers upgrade mid-cycle, manages dunning workflows with configurable retry schedules for failed payments, and processes billing cycles with tax calculations. The subscription state machine covers trial to active to past due transitions cleanly. Most useful when you're building SaaS billing from scratch or replacing a brittle homegrown system. The dunning management alone will save you from manually chasing down failed credit cards, and the proration logic handles edge cases like leap years and month-end billing anchors that break naive implementations.

skills.sh installs
11.6K
GitHub stars
42.4K
last updated
Aug 21, 2026

Install

$ npx -y skills add wshobson/agents --skill billing-automation --agent claude-code

Installs into .claude/skills of the current project.

Files

Billing Automation

Master automated billing systems including recurring billing, invoice generation, dunning management, proration, and tax calculation.

When to Use This Skill

  • Implementing SaaS subscription billing
  • Automating invoice generation and delivery
  • Managing failed payment recovery (dunning)
  • Calculating prorated charges for plan changes
  • Handling sales tax, VAT, and GST
  • Processing usage-based billing
  • Managing billing cycles and renewals

Core Concepts

1. Billing Cycles

Common Intervals:

  • Monthly (most common for SaaS)
  • Annual (discounted long-term)
  • Quarterly
  • Weekly
  • Custom (usage-based, per-seat)

2. Subscription States

trial → active → past_due → canceled
              → paused → resumed

3. Dunning Management

Automated process to recover failed payments through:

  • Retry schedules
  • Customer notifications
  • Grace periods
  • Account restrictions

4. Proration

Adjusting charges when:

  • Upgrading/downgrading mid-cycle
  • Adding/removing seats
  • Changing billing frequency

Quick Start

from billing import BillingEngine, Subscription

# Initialize billing engine
billing = BillingEngine()

Sponsors

Details

Repository
github.com/wshobson/agents
Categories
DevOps & CI/CD, Automation & Workflows, Finance & Trading

More from wshobson/agents

All 174
1wshobson avatarrisk-metrics-calculationwshobson/agentsCalculate portfolio risk metrics including VaR, CVaR, Sharpe, Sortino, and drawdown analysis. Use when measuring portfolio risk, implementing risk limits, or bu11.4Kskills.sh installs
2imbad0202 avataracademic-paperimbad0202/academic-research-skills12-agent academic paper writing pipeline. 11 modes (full/plan/outline/revision/revision-coach/abstract/lit-review/format-convert/citation-check/disclosure/rebut11.4Kskills.sh installs
3wshobson avatarairflow-dag-patternswshobson/agentsBuild production Apache Airflow DAGs with best practices for operators, sensors, testing, and deployment. Use when creating data pipelines, orchestrating workfl11.3Kskills.sh installs
4wshobson avatardbt-transformation-patternswshobson/agentsMaster dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data trans11.3Kskills.sh installs
5wshobson avatarnx-workspace-patternswshobson/agentsConfigure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected comman11.2Kskills.sh installs
6wshobson avatarpostmortem-writingwshobson/agentsWrite effective blameless postmortems with root cause analysis, timelines, and action items. Use when conducting incident reviews, writing postmortem documents,11.2Kskills.sh installs