Skills wshobson agents

billing-automation

Use it when:
You're building SaaS subscription billing yourself and need trials, renewals, failed-payment retries, plan changes or tax handled.
It does:
Explains billing cycles, subscription states, dunning and proration, then gives Python classes for each part of a billing engine.
You get:
Python code for subscriptions, a billing run that invoices and charges through Stripe, dunning, proration, tax, invoices and usage pricing.
Terms:
Dunning is the retry-and-remind process after a failed payment; proration charges or credits part of a period when a plan changes.

TL;DR

A reference of Python code, not a workflow. The SKILL.md covers billing intervals, subscription states from trial through active and past due to canceled, with pause and resume, dunning through retry schedules, notifications, grace periods and account restrictions, and proration on upgrades, seat changes and billing-frequency changes. Its quick start shows the calls; the reference file holds the classes. A subscription moves through trial, activation, past due and cancellation, at once or at period end. The billing engine builds an invoice with subscription and usage line items and tax, charges the customer through Stripe, and starts dunning when the charge fails. The dunning manager retries after 3, 7 and 14 days with an email each time, then cancels the subscription. Proration credits the unused part of the old plan and charges the new one for the rest of the period; added seats are charged, removed seats aren't refunded. Tax comes from a fixed table of a few US state, EU VAT and Australian GST rates, with VAT number validation left as a stub. Invoices render to HTML, and usage billing has tiered and per-unit pricing.

Summarizes the skill at 4bde316.

npx skills add https://github.com/wshobson/agents --skill billing-automation
Total Downloads
11,600 on skills.sh, Nov 9, 2026
Repo stars
42,334 wshobson/agents
First seen
Jan 20, 2026 on skills.sh
Weekly Downloads
154
-18% over the 8 weeks to Nov 9
Weekly values
Week toInstalls
Sep 21187
Sep 28223
Oct 5270
Oct 12214
Oct 19184
Oct 26184
Nov 2178
Nov 9154
Category

Test-first work, implementation from specs, git hygiene and scope control.

Everything for building software: planning, coding, debugging, design, frameworks, cloud, agents and skills.

Type

Knowledge and rules the agent applies while it works: best practices, design principles, API references.

Effect

Adds no side effects of its own. It shapes how the agent thinks, writes or reviews. Guidelines and routers are always effect:none, even when the task they support edits code.

Needs

Instructions only. Works in any agent that supports skills.

Publisher

Everyone else. Unverified vendor claims default to community.

Topics
Stack

SKILL.md

From wshobson/agents at 4bde316. Checked daily, last changed Nov 6, 2026.

Frontmatter
name: billing-automation
description: Build automated billing systems for recurring payments, invoicing, subscription lifecycle, and dunning management. Use when implementing subscription billing, automating invoicing, or managing recurring payment systems.

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()

# Create subscription
subscription = billing.create_subscription(
    customer_id="cus_123",
    plan_id="plan_pro_monthly",
    billing_cycle_anchor=datetime.now(),
    trial_days=14
)

# Process billing cycle
billing.process_billing_cycle(subscription.id)

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.