neuro-saas-billing

Implements Stripe subscription billing, webhooks, and plan limit enforcement for Next.js SaaS applications.

Updated Apr 18, 2026
One-click install
npx skills add https://github.com/webdevarif/claude-skills --skill neuro-saas-billing-webdevarif
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: neuro-saas-billing
Source: https://github.com/webdevarif/claude-skills/tree/main/neuro-saas-billing
Command: npx skills add https://github.com/webdevarif/claude-skills --skill neuro-saas-billing-webdevarif

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires stripe.

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.

Frequently Asked Questions about neuro-saas-billing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add Stripe subscriptions to a Next.js app?

Create a Checkout Session via the Stripe API in a route handler, redirect the user to the returned URL, and sync subscription state to your database through a webhook handler. Stripe remains the source of truth while your database mirrors state via events.

How to handle Stripe webhooks in Next.js App Router?

Read the raw request body with req.text(), verify the stripe-signature header using stripe.webhooks.constructEvent, and store processed event IDs for idempotency. Never parse the body as JSON before signature verification.

How do I enforce plan limits in a SaaS application?

Centralize plan limits in one config object, then check entitlements server-side before resource creation by comparing current usage counts against the plan limit. Return a 403 with an upgrade prompt when the limit is exceeded.

Should free tier users get a Stripe customer record?

No. Only create a Stripe customer when a user upgrades to a paid plan. Free tier users are handled entirely in your database with a FREE plan designation, avoiding unnecessary Stripe objects and API calls.

How do I test Stripe webhooks locally?

Use the Stripe CLI to forward events to your local server with stripe listen --forward-to localhost:PORT/api/webhooks/stripe. You can trigger test events like checkout.session.completed and use test card numbers such as 4242 4242 4242 4242.

What happens when a subscription payment fails?

The invoice.payment_failed webhook marks the subscription as past_due and starts a grace period rather than locking the user out immediately. Stripe retries the payment automatically, and you should send a payment failed notification email.