Works with the AI tools you already use
Stripe Subscription Engine
Scaffold a complete, production-ready Stripe subscription system — Checkout, customer portal, hardened webhooks, plans, seats, proration, and dunning — wired to your database.
Secure checkout via Stripe
See it in action
You say
Set up subscription billing for my Next.js SaaS. I have three plans (Starter, Pro, Team) with Team being per-seat. Use Stripe and our existing Postgres + Prisma setup. I need upgrades to prorate and failed payments to retry before cancelling.
Your agent does
I've scaffolded the full billing layer:
- Prisma models: Customer, Subscription, Price, and a WebhookEvent log for idempotency.
- /api/checkout route that creates a Checkout Session for Starter/Pro/Team (Team collects seat quantity).
- /api/webhooks/stripe with signature verification and an exactly-once handler for created/updated/deleted, invoice.paid, and invoice.payment_failed.
- Customer Portal session route for self-serve upgrades, downgrades (prorated), and cancellations.
- Dunning: 3 smart retries over 7 days with email hooks, then a grace period before downgrade. Next step: add your Stripe price IDs to .env (placeholders generated) and run the included webhook test script against the Stripe CLI.
What you get
About this skill
Billing is the part of your SaaS that has to be perfect — and it is the part most likely to be quietly broken. Stripe Subscription Engine turns your AI agent into a senior payments engineer that scaffolds a complete, production-grade subscription system end to end: Checkout, the customer portal, idempotent webhooks, plan and seat management, proration, and dunning — all wired to your database with the edge cases already handled.
The Problem
Every SaaS needs subscription billing, and almost every hand-rolled implementation is subtly wrong. The happy path (a customer subscribes) is easy. The money-losing parts are everything else: a webhook that fires twice and double-charges, a checkout.session.completed you trusted before the invoice was paid, a downgrade that forgets to prorate, a failed renewal that never triggers a dunning email so the customer silently churns, a subscription whose state drifts out of sync with your database after a Stripe-side change. These bugs do not crash — they leak revenue and erode trust, and you usually find them in a support ticket.
What It Does
Stripe Subscription Engine scaffolds the entire billing layer with production hardening built in:
- Checkout & Portal — Generates the Checkout Session flow for new subscriptions and wires up the Stripe Customer Portal so users can upgrade, downgrade, update cards, and cancel without you building any UI.
- Hardened Webhooks — Builds a signature-verified, idempotent webhook handler that processes every subscription lifecycle event exactly once, with replay safety and an event log.
- Plans, Seats & Proration — Implements tiered plans, per-seat billing, mid-cycle upgrades/downgrades, and correct proration so customers are always charged the right amount.
- Dunning & Recovery — Handles failed payments with retry logic, customer notifications, and a grace period so a declined card does not become silent churn.
- Source-of-Truth Sync — Generates the database schema and reconciliation logic that keeps your local subscription state perfectly in sync with Stripe, even after out-of-band changes.
Why Use This Skill
Billing is the highest-stakes, lowest-tolerance code in your product: a bug here charges real customers real money. This skill encodes the patterns payments teams learn the hard way — idempotency keys, webhook-driven state, never trusting the client, reconciliation over assumption — into a complete scaffold your agent generates in minutes instead of the week it takes to get right by hand. It pays for itself the first time it prevents a single double-charge or a month of silent churn.
Supported Stacks
Frameworks: Next.js (App Router, default), Remix, SvelteKit, Express, NestJS, and most Node/TypeScript backends. Database/ORM: Postgres with Prisma (default), Drizzle, or raw SQL; adaptable to MySQL. Payments: Stripe Billing (Checkout, Customer Portal, Webhooks, the Subscriptions API).
Use Cases
Launch billing for a new SaaS in a day instead of a week, with the edge cases already covered. Replace a fragile hand-rolled Stripe integration with a hardened, idempotent one. Add per-seat or tiered plans and correct proration to an existing product. Stop revenue leakage from failed-payment churn with built-in dunning.
Known Limitations
You bring your own Stripe account and set your product/price IDs; the skill generates the integration and placeholders, not your Stripe catalog. Tax (Stripe Tax) and complex usage-based metered billing are scaffolded as optional extension points rather than fully configured, since they depend on your jurisdiction and metering model. The skill never handles live card data directly — all card entry happens in Stripe-hosted Checkout and Portal, by design.
How to install
Drop the file into your AI Agent. Works with Claude, Cursor, ChatGPT, and 20+ more.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 1 month ago
- 30-day refund guarantee
- One-time purchase, yours forever
- Secure checkout via Stripe
Creator
PubsProToolkit builds rigor-first skills for AI agents — they write your docs and content properly, then adversarially review them to catch what's wrong before it ships. The result: cleaner output and a hard quality gate in one toolkit. Built by a CMPP-certified, PhD medical writer who brings regulated-industry standards to developer docs, content, compliance, and research integrity.
Frequently Asked Questions
Popular in API Development

API Integration Design & Error Handling Architect
Designs reliable API integrations with request validation, contract mapping, retries, timeout policies, idempotency, rate-limit protection, token refresh, dead-letter handling, monitoring, and recovery plans.
igdb-api
Professional IGDB v4 API specialist for advanced game data fetching, Apicalypse queries, and image URL construction.
stripe-billing-scaffold
Production Stripe billing in one shot. Subscriptions, metered usage, webhooks, customer portal, tax, fraud. 12 patterns, TS+Python.
stripe-subscription-engine
Complete Next.js & Stripe billing engine with per-seat proration, secure webhooks, and multi-tenant member management.