
Stripe Integration Expert
Wire production Stripe billing—subscriptions, checkout, webhooks, and customer portal—into a solo-builder SaaS on Next.js, Express, or Django.
Overview
Stripe Integration Expert is an agent skill for the Build phase that implements production-grade Stripe subscriptions, checkout, usage billing, and idempotent webhooks for Next.js, Express, and Django apps.
Install
npx skills add https://github.com/alirezarezvani/claude-skills --skill stripe-integration-expertWhat is this skill?
- Subscription lifecycle: create, upgrade, downgrade, cancel, and pause with trials and proration
- One-time payments, Checkout Sessions, invoicing, PDF access, and Customer Portal wiring
- Usage-based and metered billing patterns for seat- or consumption-priced products
- Idempotent webhook handlers with signature verification and Stripe CLI local testing setup
- Framework-oriented patterns for Next.js, Express, and Django
Adoption & trust: 536 installs on skills.sh; 17.5k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need real subscription and payment flows but webhook retries, proration, and plan changes keep causing double charges, missed entitlements, or stuck customers.
Who is it for?
Solo builders shipping or fixing paid SaaS with Stripe who want structured patterns instead of one-off Stack Overflow answers.
Skip if: Teams that only need Stripe Dashboard clicks with no code, or products still choosing pricing model before any backend exists.
When should I use this skill?
Integrating Stripe for the first time, debugging webhook reliability, migrating payment providers, or adding usage-based billing to subscriptions.
What do I get? / Deliverables
After the skill runs, you have verified webhook handling, documented subscription and checkout patterns, and a testable Stripe setup aligned to your framework stack.
- Webhook endpoint with signature verification and idempotent handlers
- Subscription and checkout flow aligned to chosen framework
- Documented test plan using Stripe CLI events
Recommended Skills
Journey fit
Payment provider integration is core product engineering once you are building monetization, not early ideation alone. Stripe SDKs, webhook endpoints, and checkout sessions are third-party payment integrations typical of the integrations subphase.
How it compares
Structured payment-integration playbook for agent implementation—not a hosted billing UI or no-code checkout product.
Common Questions / FAQ
Who is stripe-integration-expert for?
It is for solo and indie builders integrating or hardening Stripe in web apps, especially subscription SaaS on Next.js, Express, or Django.
When should I use stripe-integration-expert?
Use it during Build when adding subscriptions, debugging webhooks, migrating processors, or implementing usage-based billing; also when Ship prep requires reliable billing before go-live.
Is stripe-integration-expert safe to install?
Payment skills touch secrets and money-moving APIs—review the Security Audits panel on this page and restrict keys, webhook signing, and production access in your own repo.
SKILL.md
READMESKILL.md - Stripe Integration Expert
# Stripe Integration Expert **Tier:** POWERFUL **Category:** Engineering Team **Domain:** Payments / Billing Infrastructure --- ## Overview Implement production-grade Stripe integrations: subscriptions with trials and proration, one-time payments, usage-based billing, checkout sessions, idempotent webhook handlers, customer portal, and invoicing. Covers Next.js, Express, and Django patterns. --- ## Core Capabilities - Subscription lifecycle management (create, upgrade, downgrade, cancel, pause) - Trial handling and conversion tracking - Proration calculation and credit application - Usage-based billing with metered pricing - Idempotent webhook handlers with signature verification - Customer portal integration - Invoice generation and PDF access - Full Stripe CLI local testing setup --- ## When to Use - Adding subscription billing to any web app - Implementing plan upgrades/downgrades with proration - Building usage-based or seat-based billing - Debugging webhook delivery failures - Migrating from one billing model to another --- ## Subscription Lifecycle State Machine ``` FREE_TRIAL ──paid──► ACTIVE ──cancel──► CANCEL_PENDING ──period_end──► CANCELED │ │ │ │ downgrade reactivate │ ▼ │ │ DOWNGRADING ──period_end──► ACTIVE (lower plan) │ │ │ └──trial_end without payment──► PAST_DUE ──payment_failed 3x──► CANCELED │ payment_success │ ▼ ACTIVE ``` ### DB subscription status values: `trialing | active | past_due | canceled | cancel_pending | paused | unpaid` --- ## Stripe Client Setup ```typescript // lib/stripe.ts import Stripe from "stripe" export const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, { apiVersion: "2024-04-10", typescript: true, appInfo: { name: "myapp", version: "1.0.0", }, }) // Price IDs by plan (set in env) export const PLANS = { starter: { monthly: process.env.STRIPE_STARTER_MONTHLY_PRICE_ID!, yearly: process.env.STRIPE_STARTER_YEARLY_PRICE_ID!, features: ["5 projects", "10k events"], }, pro: { monthly: process.env.STRIPE_PRO_MONTHLY_PRICE_ID!, yearly: process.env.STRIPE_PRO_YEARLY_PRICE_ID!, features: ["Unlimited projects", "1M events"], }, } as const ``` --- ## Checkout Session (Next.js App Router) ```typescript // app/api/billing/checkout/route.ts import { NextResponse } from "next/server" import { stripe } from "@/lib/stripe" import { getAuthUser } from "@/lib/auth" import { db } from "@/lib/db" export async function POST(req: Request) { const user = await getAuthUser() if (!user) return NextResponse.json({ error: "Unauthorized" }, { status: 401 }) const { priceId, interval = "monthly" } = await req.json() // Get or create Stripe customer let stripeCustomerId = user.stripeCustomerId if (!stripeCustomerId) { const customer = await stripe.customers.create({ email: user.email, name: "username-undefined" metadata: { userId: user.id }, }) stripeCustomerId = customer.id await db.user.u