AI agent skill
Billing Automation
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.
·
When to use this skill
Use Billing Automation when an AI agent needs a reusable SKILL.md workflow for this job: 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.
When not to use it
Skip Billing Automation when the task is outside the productivity category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.
How to install
- Personal install: create ~/.claude/skills/billing-automation/SKILL.md (and any bundled scripts) so Claude Code, Claude Desktop, and compatible agents can load it in every project.
- Project install: commit the same folder at .claude/skills/billing-automation/ so teammates get the skill with the repo.
- Restart the agent session after copying files so it re-scans the skills directory, then ask for the task in words that match the skill description.
What this skill does
# 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
```python 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.
Intended uses
- 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
Related skills
Related skills in this directory, for comparison before you install another skill.
productivity
21risk Automation
Automate 21risk tasks via Rube MCP (Composio). Always search tools first for current schemas.
productivity
2chat Automation
Automate 2chat tasks via Rube MCP (Composio). Always search tools first for current schemas.
productivity
Ably Automation
Automate Ably tasks via Rube MCP (Composio). Always search tools first for current schemas.
productivity
Abstract Automation
Automate Abstract tasks via Rube MCP (Composio). Always search tools first for current schemas.