Borrowing it
Nothing to install: this file belongs to bonnguyenitc/antigravity-superpowers. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/bonnguyenitc/antigravity-superpowers/main/.agent/skills/subscription-billing/SKILL.mdgit clone --depth 1 https://github.com/bonnguyenitc/antigravity-superpowersWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/bonnguyenitc/antigravity-superpowers/subscription-billing)<a href="https://agentmods.dev/skills/bonnguyenitc/antigravity-superpowers/subscription-billing"><img src="https://agentmods.dev/badge/skills/bonnguyenitc/antigravity-superpowers/subscription-billing/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/bonnguyenitc/antigravity-superpowers/subscription-billing"><img src="https://agentmods.dev/badge/skills/bonnguyenitc/antigravity-superpowers/subscription-billing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00031 | $0.01403 |
| Opus 5 | $0.00015 | $0.00701 |
| Sonnet 5 | $0.00006 | $0.00281 |
| Haiku 4.5 | $0.00003 | $0.00140 |
Grade A, and why
subscription-billing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 180 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Subscription Billing Lens
Philosophy: Billing is load-bearing infrastructure. A bug in billing = lost revenue or incorrect charges. Build it like critical path code: idempotent, webhook-driven, logged exhaustively.
Core Instincts
- Webhook-first — Stripe's webhook is the source of truth, not your API response
- Idempotency everywhere — billing operations must be safe to retry
- Never trust client state for billing — always fetch subscription status from Stripe server-side
- All clock-sensitive operations use
event.created— notDate.now() - Soft failures, never hard block — grace period on payment failures protects revenue
Stripe Integration Architecture
User upgrades plan →
1. Client: Stripe.js → Payment Method → PaymentIntent / SetupIntent
2. Server: Create/Update Subscription on Stripe
3. Stripe: Processes payment → emits webhook event
4. Server: Webhook handler updates DB subscription status
5. Server: Return state from DB (never from Stripe API response)
⚠️ Anti-pattern: updating DB from API response
✅ Pattern: update DB only from webhook confirmation
Critical Webhook Events to Handle
| Event | What to do |
|---|---|
checkout.session.completed |
Provision access, send welcome email |
customer.subscription.created |
Set status = active, log |
customer.subscription.updated |
Update plan, seats, feature flags |
customer.subscription.deleted |
Set status = canceled, begin grace period |
invoice.payment_succeeded |
Extend access, reset dunning state |
invoice.payment_failed |
Start dunning, notify user, DON'T revoke access immediately |
invoice.upcoming |
Warn user of upcoming charge |
customer.subscription.trial_will_end |
3-day warning email before trial ends |
Trial Logic Rules
Trial best practices:
- Default trial: 14 days (Stripe default is 30; reduce for faster conversion signal)
- Require payment method at trial start (reduces churn at trial end)
- Free trial without CC = high trial-end churn; use for virality, not conversion
- trial_will_end webhook fires 3 days before → trigger upgrade prompt
Trial states:
trialing → (payment method on file) → auto-converts to active
trialing → (no payment method) → needs_payment_method → upgrade prompt
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 180 lines · 31 tokens per session scan A fd2c2c5c9749
subscription-billing is a skill published in the GitHub repository bonnguyenitc/antigravity-superpowers (19 stars, last pushed 4mo ago), licensed MIT. It adds 31 tokens to every session and 1,403 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
saas-billing
Implement and audit SaaS billing systems, subscription state machines, secure webhooks, and local database synchronization / Implementasi dan audit sistem billing SaaS, state machine langganan, webhook aman, dan sinkronisasi database lokal.
payment-gateway-expert
Expert guide for integrating payment gateways (Stripe, PayPal, Xendit, Midtrans, DOKU) and secure webhooks into SaaS platforms / Panduan ahli integrasi payment gateway dan webhook aman.
doku-mcp-server
Expert guide for DOKU Model Context Protocol (MCP) Server integration. Enables AI Agentic Commerce with tools for payment links, Virtual Accounts, QRIS, transaction status checks, and client configuration (Claude Desktop, Cursor, AGY) / Panduan ahli DOKU MCP Server untuk AI Agentic Commerce.
frappe-payments
Frappe Payments and ERPNext payment workflow guidance for payment gateways, payment requests, subscriptions, invoices, reconciliation, webhooks, and secure checkout flows. Use when work touches payments in Frappe or ERPNext.
codeck
Route explicit requests from a host coding agent to one or more locally configured AI executors through Codeck, attach Markdown or other project files, moderate cross-model consultation, expose disagreements, and synthesize traceable results. Use when the user explicitly names Codeck or asks to consult, compare, or…
customer-billing-ops
Operate customer billing workflows such as subscriptions, refunds, churn triage, billing-portal recovery, and plan analysis using connected billing tools like Stripe. Use when the user needs to help a customer, inspect subscription state, or manage revenue-impacting billing operations.