What problem does it solve? Building SaaS billing from scratch is error-prone: webhook signature verification, idempotency, plan limit enforcement, trial handling, and upgrade/downgrade proration all have subtle failure modes that cause revenue loss or security issues. This Skill provides production-grade patterns for the entire Stripe subscription lifecycle in Next.js projects. ## Core Features & Use Cases - Checkout & Customer Portal: Create Stripe Checkout Sessions with trials, promotion codes, and customer creation, plus Billing Portal sessions for self-service subscription management. - Production Webhook Handler: Signature verification, idempotency via a WebhookEvent table, and handlers for subscription lifecycle, trial ending, and payment success/failure events. - Plan Limit Enforcement: Centralized entitlement checks with per-plan limits, feature flags, usage counting, and API middleware that returns upgrade prompts on limit exceeded. - Use Case: A Next.js SaaS needs to add paid tiers. Use this Skill to scaffold the checkout API route, webhook handler, Prisma subscription schema, pricing table component, and entitlement middleware in one coherent integration. ## Quick Start Ask the AI to add Stripe subscription billing with a free tier, three paid plans, webhook handling, and plan limit enforcement to your Next.js project.