Stripe Subscription Engine: Ship Production SaaS Billing in a Day
Scaffold a complete, production-ready Stripe subscription system — Checkout, customer portal, hardened webhooks, plans, seats, proration, and dunning — wired to your database.
- 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
$69
· or 345 creditsSecure checkout via Stripe
Included in download
- 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
- terminal, file_read, file_write automation included
- Ready for Works with Next.js
Sample input
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.
Sample output
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.
Stripe Subscription Engine: Ship Production SaaS Billing in a Day
Scaffold a complete, production-ready Stripe subscription system — Checkout, customer portal, hardened webhooks, plans, seats, proration, and dunning — wired to your database.
$69
· or 345 creditsSecure checkout via Stripe
Also available in a bundle
Included in download
- 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
- terminal, file_read, file_write automation included
- Ready for Works with Next.js
- Instant install
Sample input
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.
Sample output
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.
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: 1. 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. 2. Hardened Webhooks — Builds a signature-verified, idempotent webhook handler that processes every subscription lifecycle event exactly once, with replay safety and an event log. 3. Plans, Seats & Proration — Implements tiered plans, per-seat billing, mid-cycle upgrades/downgrades, and correct proration so customers are always charged the right amount. 4. Dunning & Recovery — Handles failed payments with retry logic, customer notifications, and a grace period so a declined card does not become silent churn. 5. 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.
Use Cases
- 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
mkdir -p ~/.claude/skills && curl -sL https://www.agensi.io/api/install/stripe-subscription-engine-ship-production-saas-billing-in-a-day -o /tmp/stripe-subscription-engine-ship-production-saas-billing-in-a-day.zip && unzip -o /tmp/stripe-subscription-engine-ship-production-saas-billing-in-a-day.zip -d ~/.claude/skills && rm /tmp/stripe-subscription-engine-ship-production-saas-billing-in-a-day.zipFree skills install directly. Paid skills require purchase - use the download button above after buying.
Reviews
No reviews yet - be the first to share your experience.
Only users who have downloaded or purchased this skill can leave a review.
Early access skill
Be the first to review this skill.
Only users who have downloaded or purchased this skill can leave a review.
Security Scanned
Passed automated security review
Permissions
File Scopes
Reads your project files and writes the generated billing integration (API routes, webhook handler, database schema, and config). Uses the terminal to install dependencies and run the included webhook test script. It never handles live card data - all card entry stays in Stripe-hosted Checkout and Portal - and does not require your Stripe secret key to scaffold the code (you add keys to .env yourself).
Works with Next.js, Remix, SvelteKit, Express, and most Node/TypeScript backends. Requires a Stripe account and a SQL database (Postgres recommended). Best with Claude Code 1.2+ and an agent with filesystem + terminal access.
Creator
PubsProToolkit builds adversarial "gate" skills for AI agents — they catch problems before your output ships, instead of just generating more. From code, security, and infrastructure to content, hiring, contracts, and finance. Built by a CMPP-certified, PhD medical writer who brings regulated-industry rigor to every domain.
Frequently Asked Questions
Learn More About AI Agent Skills
More Premium Skills

B2B Leadbot: Turn Website Visitors into Warm Leads
Build a production-ready, Claude-powered chat widget that answers visitors' questions in plain language and quietly delivers every warm lead to the owner's inbox.
designing-hybrid-context-layers
Architects the right retrieval strategy for every query — teaching your agent when to use RAG, a knowledge graph, or a temporal index instead of defaulting to vector search for everything.
ai-automation-qa-pack
Professional QA & UAT documentation generator for AI automation agencies and complex agent deployments.
Bounty Security Pattern Master Library — 399 Vulnerability Patterns
A premium library of 399 vulnerability patterns and DeFi attack vectors for AI-driven bug hunting and security audits.